From 5467afd87f229643cc9f280b8f0eface88775886 Mon Sep 17 00:00:00 2001 From: njupthan Date: Wed, 9 Mar 2022 10:18:07 +0000 Subject: [PATCH] Componentization: ability_base to remove bms dependencies Signed-off-by: njupthan --- common/task_dispatcher/BUILD.gn | 11 +- .../include/dispatcher/blocking_queue.h | 6 +- .../parallel_task_dispatcher_base.h | 2 +- .../include/task/barrier_handler.h | 2 +- .../task_dispatcher/include/task/sync_task.h | 2 +- .../task/task_handler_libevent_adapter.h | 6 +- .../include/threading/concurrent_queue.h | 6 +- .../threading/default_thread_factory.h | 2 +- .../include/threading/delay_queue.h | 6 +- .../include/threading/work_thread.h | 2 +- .../include/threading/worker_pool.h | 2 +- .../src/dispatcher/base_task_dispatcher.cpp | 74 +- .../src/dispatcher/group_impl.cpp | 36 +- .../dispatcher/parallel_task_dispatcher.cpp | 28 +- .../parallel_task_dispatcher_base.cpp | 64 +- .../src/dispatcher/serial_task_dispatcher.cpp | 66 +- .../src/dispatcher/spec_task_dispatcher.cpp | 34 +- .../dispatcher/task_dispatcher_context.cpp | 52 +- .../src/task/barrier_handler.cpp | 50 +- common/task_dispatcher/src/task/sync_task.cpp | 8 +- common/task_dispatcher/src/task/task.cpp | 34 +- .../src/threading/default_thread_factory.cpp | 4 +- .../src/threading/task_executor.cpp | 54 +- .../src/threading/work_thread.cpp | 6 +- .../src/threading/worker_pool.cpp | 70 +- common/task_dispatcher/test/BUILD.gn | 1 + .../serial_task_dispatcher_test.cpp | 2 +- .../spec_task_dispatcher_test.cpp | 18 +- .../sync_task_test/sync_task_test.cpp | 8 +- .../work_thread_test/work_thread_test.cpp | 2 +- .../test/moduletest/task_dispatcher/BUILD.gn | 1 + .../global_task_dispatcher_module_test.cpp | 2 +- .../parallel_task_dispatcher_module_test.cpp | 2 +- .../serial_task_dispatcher_module_test.cpp | 2 +- .../spec_task_dispatcher_module_test.cpp | 2 +- .../kits/ability/ability_runtime/BUILD.gn | 15 +- frameworks/kits/ability/native/BUILD.gn | 59 +- .../kits/ability/native/src/ability.cpp | 715 ++++++++--------- .../ability/native/src/ability_context.cpp | 208 ++--- .../kits/ability/native/src/ability_impl.cpp | 214 ++--- .../native/src/ability_impl_factory.cpp | 8 +- .../ability/native/src/ability_lifecycle.cpp | 20 +- .../ability/native/src/ability_loader.cpp | 10 +- .../native/src/ability_post_event_timeout.cpp | 16 +- .../ability/native/src/ability_process.cpp | 59 +- .../ability/native/src/ability_thread.cpp | 574 +++++++------- .../ability/native/src/ability_window.cpp | 76 +- .../distributed/continuation_handler.cpp | 136 ++-- .../distributed/continuation_manager.cpp | 206 ++--- ...reverse_continuation_scheduler_primary.cpp | 30 +- ...e_continuation_scheduler_primary_proxy.cpp | 24 +- ...se_continuation_scheduler_primary_stub.cpp | 24 +- ...reverse_continuation_scheduler_replica.cpp | 44 +- ...e_continuation_scheduler_replica_proxy.cpp | 36 +- ...se_continuation_scheduler_replica_stub.cpp | 20 +- .../connect_callback_proxy.cpp | 18 +- .../connect_callback_stub.cpp | 16 +- .../continuation_connector.cpp | 64 +- .../continuation_device_callback_proxy.cpp | 14 +- .../continuation_register_manager.cpp | 32 +- .../continuation_register_manager_proxy.cpp | 62 +- .../remote_register_service_proxy.cpp | 44 +- .../remote_register_service_stub.cpp | 30 +- .../native/src/data_ability_helper.cpp | 587 +++++++------- .../ability/native/src/data_ability_impl.cpp | 38 +- .../native/src/data_ability_operation.cpp | 133 ++-- .../src/data_ability_operation_builder.cpp | 63 +- .../native/src/data_ability_result.cpp | 3 +- .../native/src/datashare_connection.cpp | 22 +- .../ability/native/src/datashare_helper.cpp | 386 ++++----- .../ability/native/src/datashare_proxy.cpp | 210 ++--- .../ability/native/src/datashare_stub.cpp | 116 +-- .../src/dummy_data_ability_predicates.cpp | 6 +- .../ability/native/src/dummy_result_set.cpp | 6 +- .../native/src/dummy_values_bucket.cpp | 6 +- .../native/src/form_js_event_handler.cpp | 39 +- .../native/src/form_provider_client.cpp | 92 +-- .../form_extension_provider_client.cpp | 88 +-- .../ability/native/src/new_ability_impl.cpp | 18 +- .../ability/native/src/page_ability_impl.cpp | 48 +- .../native/src/service_ability_impl.cpp | 14 +- .../native/src/task_handler_client.cpp | 11 +- frameworks/kits/ability/native/test/BUILD.gn | 13 +- .../native/test/mock/include/mock_ability.cpp | 30 +- .../include/mock_ability_manager_client.h | 2 +- .../mock/include/mock_data_ability_impl.cpp | 2 +- .../include/mock_form_supply_callback.cpp | 6 +- .../include/mock_replace_ability_impl.cpp | 18 +- .../unittest/ability_impl_active_test.cpp | 2 +- .../test/unittest/ability_impl_test.cpp | 2 +- .../ability_thread_dataability_test.cpp | 2 +- .../test/unittest/ability_thread_test.cpp | 2 +- .../test/unittest/continuation_test.cpp | 2 +- ...data_ability_impl_file_secondpart_test.cpp | 2 +- .../unittest/data_ability_impl_file_test.cpp | 2 +- .../test/unittest/data_ability_impl_test.cpp | 2 +- .../unittest/service_ability_impl_test.cpp | 2 +- .../unittest/task_handler_client_test.cpp | 2 +- frameworks/kits/appkit/BUILD.gn | 96 +-- .../src/ability_delegator.cpp | 106 +-- .../src/delegator_thread.cpp | 6 +- .../src/iability_monitor.cpp | 16 +- .../src/runner_runtime/js_test_runner.cpp | 32 +- .../ability_delegator/src/test_runner.cpp | 10 +- .../appkit/native/app/src/ability_manager.cpp | 38 +- .../native/app/src/ability_record_mgr.cpp | 22 +- .../kits/appkit/native/app/src/app_loader.cpp | 6 +- .../native/app/src/application_context.cpp | 26 +- .../native/app/src/application_impl.cpp | 30 +- .../native/app/src/context_container.cpp | 163 ++-- .../appkit/native/app/src/context_deal.cpp | 280 +++---- .../appkit/native/app/src/hdc_register.cpp | 20 +- .../kits/appkit/native/app/src/main.cpp | 2 +- .../appkit/native/app/src/main_thread.cpp | 564 ++++++------- .../native/app/src/ohos_application.cpp | 143 ++-- .../appkit/native/app/src/sys_mgr_client.cpp | 4 +- .../kits/appkit/native/app/src/watchdog.cpp | 8 +- frameworks/kits/appkit/native/test/BUILD.gn | 10 +- frameworks/kits/appkit/test/BUILD.gn | 4 +- .../test/Mock/include/mock_app_mgr_service.h | 12 +- .../Mock/include/mock_ipc_object_stub.cpp | 84 +- .../src/ohos/aafwk/content/element_name.cpp | 12 +- .../cpp/src/ohos/aafwk/content/operation.cpp | 22 +- .../cpp/src/ohos/aafwk/content/pac_map.cpp | 2 +- .../ohos/aafwk/content/patterns_matcher.cpp | 4 +- .../cpp/src/ohos/aafwk/content/skills.cpp | 1 - .../cpp/src/ohos/aafwk/content/want.cpp | 14 +- .../src/ohos/aafwk/content/want_params.cpp | 151 ++-- frameworks/kits/content/cpp/test/BUILD.gn | 8 +- frameworks/kits/fmskit/BUILD.gn | 13 +- .../fmskit/native/src/form_host_client.cpp | 46 +- .../kits/fmskit/native/src/form_mgr.cpp | 126 +-- frameworks/kits/test/BUILD.gn | 2 + frameworks/kits/wantagent/BUILD.gn | 13 +- interfaces/innerkits/ability_manager/BUILD.gn | 22 +- interfaces/innerkits/app_manager/BUILD.gn | 41 +- .../src/appmgr/ability_controller_proxy.cpp | 13 +- .../src/appmgr/ability_controller_stub.cpp | 12 +- .../src/appmgr/ability_state_data.cpp | 4 +- .../app_manager/src/appmgr/ams_mgr_proxy.cpp | 172 ++-- .../app_manager/src/appmgr/ams_mgr_stub.cpp | 28 +- .../src/appmgr/app_launch_data.cpp | 30 +- .../app_manager/src/appmgr/app_mgr_client.cpp | 20 +- .../app_manager/src/appmgr/app_mgr_proxy.cpp | 181 +++-- .../app_manager/src/appmgr/app_mgr_stub.cpp | 26 +- .../src/appmgr/app_process_data.cpp | 4 +- .../src/appmgr/app_resident_process_info.cpp | 6 +- .../src/appmgr/app_scheduler_host.cpp | 20 +- .../src/appmgr/app_scheduler_proxy.cpp | 70 +- .../src/appmgr/app_state_callback_host.cpp | 12 +- .../src/appmgr/app_state_callback_proxy.cpp | 20 +- .../app_manager/src/appmgr/app_state_data.cpp | 4 +- .../app_manager/src/appmgr/app_task_info.cpp | 4 +- .../application_state_observer_proxy.cpp | 52 +- .../application_state_observer_stub.cpp | 20 +- .../app_manager/src/appmgr/configuration.cpp | 16 +- .../src/appmgr/priority_object.cpp | 4 +- .../app_manager/src/appmgr/process_data.cpp | 4 +- .../app_manager/src/appmgr/process_info.cpp | 4 +- .../app_manager/src/appmgr/profile.cpp | 4 +- .../src/appmgr/render_scheduler_host.cpp | 6 +- .../src/appmgr/render_scheduler_proxy.cpp | 14 +- .../src/appmgr/running_process_info.cpp | 4 +- ...start_specified_ability_response_proxy.cpp | 20 +- .../start_specified_ability_response_stub.cpp | 10 +- .../src/appmgr/system_memory_attr.cpp | 6 +- interfaces/innerkits/base/BUILD.gn | 3 +- interfaces/innerkits/dataobs_manager/BUILD.gn | 10 +- interfaces/innerkits/form_manager/BUILD.gn | 9 +- .../form_manager/include/form_host_proxy.h | 2 +- .../include/form_provider_proxy.h | 2 +- .../form_manager/include/form_supply_proxy.h | 2 +- .../form_manager/src/form_host_proxy.cpp | 24 +- .../form_manager/src/form_host_stub.cpp | 10 +- .../form_manager/src/form_mgr_proxy.cpp | 176 ++--- .../form_manager/src/form_mgr_stub.cpp | 66 +- .../form_manager/src/form_provider_proxy.cpp | 80 +- .../form_manager/src/form_provider_stub.cpp | 34 +- .../form_manager/src/form_supply_proxy.cpp | 20 +- .../form_manager/src/form_supply_stub.cpp | 14 +- .../src/provider_connect_proxy.cpp | 27 +- .../src/provider_connect_stub.cpp | 8 +- interfaces/innerkits/intent/BUILD.gn | 20 +- .../log/include/ability_base_log_wrapper.h | 104 +++ .../innerkits/log/include/parcel_macro_base.h | 42 + interfaces/innerkits/runtime/BUILD.gn | 11 +- interfaces/innerkits/uri_permission/BUILD.gn | 3 +- interfaces/innerkits/want/BUILD.gn | 14 +- .../want/include/ohos/aafwk/content/skills.h | 2 +- .../kits/napi/aafwk/abilityManager/BUILD.gn | 20 +- .../kits/napi/aafwk/ability_constant/BUILD.gn | 7 +- .../kits/napi/aafwk/ability_manager/BUILD.gn | 21 +- .../napi/aafwk/app/ability_delegator/BUILD.gn | 9 +- .../kits/napi/aafwk/app/appMgr/BUILD.gn | 24 +- .../kits/napi/aafwk/app/app_manager/BUILD.gn | 26 +- .../aafwk/configuration_constant/BUILD.gn | 11 +- interfaces/kits/napi/aafwk/dataShare/BUILD.gn | 10 +- .../kits/napi/aafwk/dataUriUtils/BUILD.gn | 11 +- .../kits/napi/aafwk/featureAbility/BUILD.gn | 12 +- .../kits/napi/aafwk/formManager/BUILD.gn | 21 +- .../napi/aafwk/form_binding_data/BUILD.gn | 6 +- .../napi/aafwk/inner/napi_common/BUILD.gn | 10 +- .../kits/napi/aafwk/mission_manager/BUILD.gn | 28 +- .../kits/napi/aafwk/particleAbility/BUILD.gn | 10 +- .../kits/napi/aafwk/uri_permission/BUILD.gn | 2 +- .../kits/napi/aafwk/wantConstant/BUILD.gn | 10 +- interfaces/kits/napi/aafwk/wantagent/BUILD.gn | 7 +- services/abilitymgr/BUILD.gn | 34 +- services/abilitymgr/test/BUILD.gn | 1 + .../test/mock/libs/appexecfwk_core/BUILD.gn | 2 + .../src/appmgr/app_state_callback_host.cpp | 6 +- .../src/appmgr/app_state_callback_proxy.cpp | 2 +- .../ability_connect_manage_test/BUILD.gn | 1 + .../phone/ability_manager_proxy_test/BUILD.gn | 1 + services/appmgr/BUILD.gn | 40 +- services/appmgr/examples/BUILD.gn | 43 +- services/appmgr/src/ams_mgr_scheduler.cpp | 36 +- services/appmgr/src/app_death_recipient.cpp | 8 +- services/appmgr/src/app_lifecycle_deal.cpp | 26 +- services/appmgr/src/app_mgr_service.cpp | 74 +- .../src/app_mgr_service_event_handler.cpp | 10 +- services/appmgr/src/app_mgr_service_inner.cpp | 545 ++++++------- services/appmgr/src/app_process_manager.cpp | 2 +- services/appmgr/src/app_running_manager.cpp | 86 +- services/appmgr/src/app_running_record.cpp | 131 ++-- services/appmgr/src/app_spawn_client.cpp | 22 +- services/appmgr/src/app_spawn_msg_wrapper.cpp | 40 +- services/appmgr/src/app_spawn_socket.cpp | 36 +- services/appmgr/src/module_running_record.cpp | 68 +- services/appmgr/src/remote_client_manager.cpp | 4 +- services/appmgr/src/start_via_asan.cpp | 6 +- .../src/system_environment_information.cpp | 12 +- services/appmgr/test/BUILD.gn | 14 +- .../mock/include/mock_app_mgr_service_inner.h | 2 +- .../test/mock/include/mock_app_service_mgr.h | 4 +- .../test/mock/include/mock_app_spawn_socket.h | 2 +- .../ams_ability_running_record_test.cpp | 62 +- .../ams_app_death_recipient_test.cpp | 8 +- .../ams_app_mgr_client_test.cpp | 70 +- .../ams_app_running_record_test.cpp | 66 +- .../ams_workflow_test.cpp | 76 +- .../ams_ipc_appmgr_interface_test.cpp | 46 +- .../ams_ipc_appscheduler_interface_test.cpp | 34 +- .../ams_mgr_kill_process_test.cpp | 6 +- .../test/unittest/ams_mgr_proxy_test/BUILD.gn | 1 + .../ams_mgr_scheduler_dump_test/BUILD.gn | 1 + .../ams_mgr_scheduler_dump_test.cpp | 6 +- .../ams_mgr_scheduler_test.cpp | 46 +- .../ams_service_app_spawn_client_test.cpp | 102 +-- ...ams_service_app_spawn_msg_wrapper_test.cpp | 42 +- .../ams_service_app_spawn_socket_test.cpp | 54 +- .../ams_service_event_drive_test.cpp | 142 ++-- .../ams_service_load_ability_process_test.cpp | 98 +-- .../ams_service_startup_test.cpp | 22 +- .../ams_start_via_asan_test.cpp | 10 +- .../app_mgr_service_event_handler_test.cpp | 14 +- .../app_running_processes_info_test.cpp | 2 +- services/dataobsmgr/BUILD.gn | 24 +- services/formmgr/BUILD.gn | 22 +- services/formmgr/include/form_host_record.h | 2 +- .../formmgr/src/form_ability_connection.cpp | 15 +- .../formmgr/src/form_acquire_connection.cpp | 8 +- services/formmgr/src/form_ams_helper.cpp | 22 +- .../src/form_batch_delete_connection.cpp | 6 +- services/formmgr/src/form_bms_helper.cpp | 18 +- services/formmgr/src/form_cache_mgr.cpp | 28 +- .../formmgr/src/form_cast_temp_connection.cpp | 6 +- services/formmgr/src/form_data_mgr.cpp | 152 ++-- services/formmgr/src/form_db_cache.cpp | 32 +- .../formmgr/src/form_delete_connection.cpp | 8 +- services/formmgr/src/form_dump_mgr.cpp | 14 +- .../src/form_event_notify_connection.cpp | 6 +- services/formmgr/src/form_host_callback.cpp | 14 +- services/formmgr/src/form_host_record.cpp | 14 +- services/formmgr/src/form_info_mgr.cpp | 52 +- .../formmgr/src/form_info_storage_mgr.cpp | 80 +- services/formmgr/src/form_item_info.cpp | 24 +- services/formmgr/src/form_mgr_adapter.cpp | 343 ++++---- services/formmgr/src/form_mgr_service.cpp | 60 +- .../formmgr/src/form_msg_event_connection.cpp | 8 +- services/formmgr/src/form_provider_mgr.cpp | 64 +- .../formmgr/src/form_refresh_connection.cpp | 6 +- services/formmgr/src/form_refresh_limiter.cpp | 46 +- services/formmgr/src/form_storage_mgr.cpp | 68 +- services/formmgr/src/form_supply_callback.cpp | 40 +- .../formmgr/src/form_sys_event_receiver.cpp | 76 +- services/formmgr/src/form_task_mgr.cpp | 92 +-- services/formmgr/src/form_timer_mgr.cpp | 243 +++--- services/formmgr/src/form_util.cpp | 16 +- .../src/kvstore_death_recipient_callback.cpp | 14 +- .../mock/include/mock_form_death_callback.h | 8 +- .../test/mock/src/mock_form_host_client.cpp | 8 +- .../mock/src/mock_form_provider_client.cpp | 18 +- .../fms_form_cache_mgr_test.cpp | 20 +- .../fms_form_data_mgr_test.cpp | 2 +- .../fms_form_db_record_test.cpp | 2 +- ...s_form_mgr_notify_invisible_forms_test.cpp | 2 +- ...fms_form_mgr_notify_visible_forms_test.cpp | 2 +- .../fms_form_mgr_release_form_test.cpp | 2 +- .../fms_form_mgr_request_form_test.cpp | 14 +- .../fms_form_mgr_update_form_test.cpp | 2 +- .../fms_form_provider_data_test.cpp | 6 +- .../fms_form_set_next_refresh_test.cpp | 2 +- services/test/BUILD.gn | 4 +- .../mock/src/appmgr/system_ability_helper.cpp | 12 +- .../ability_mgr_module_account_test/BUILD.gn | 1 + .../moduletest/ability_record_test/BUILD.gn | 1 + .../ability_timeout_module_test/BUILD.gn | 1 + services/test/moduletest/common/ams/BUILD.gn | 16 +- ...ams_ability_running_record_module_test.cpp | 34 +- .../ams_app_life_cycle_module_test.cpp | 2 +- .../ams_app_recent_list_module_test.cpp | 30 +- .../ams_app_service_flow_module_test.cpp | 54 +- ...s_service_app_spawn_client_module_test.cpp | 84 +- .../ams_service_event_drive_module_test.cpp | 62 +- .../ams_service_start_process_module_test.cpp | 10 +- .../ipc_ability_scheduler_test/BUILD.gn | 1 + .../running_infos_module_test/BUILD.gn | 1 + .../static_start_ability_test/BUILD.gn | 1 + services/uripermmgr/BUILD.gn | 6 +- .../abilitySrc/amsAbilityAppendTestA/BUILD.gn | 4 +- .../src/main_ability.cpp | 28 +- .../src/second_ability.cpp | 32 +- .../abilitySrc/amsAbilityAppendTestB/BUILD.gn | 4 +- .../src/main_ability.cpp | 26 +- .../amsAbilityVisibleTestPageA/BUILD.gn | 5 +- .../include/amsabilityvisibletestpagea1.h | 6 +- .../include/amsabilityvisibletestpagea2.h | 6 +- .../include/amsabilityvisibletestpagea3.h | 6 +- .../include/amsabilityvisibletestpagea4.h | 6 +- .../src/amsabilityvisibletestpagea1.cpp | 16 +- .../src/amsabilityvisibletestpagea2.cpp | 22 +- .../src/amsabilityvisibletestpagea3.cpp | 14 +- .../src/amsabilityvisibletestpagea4.cpp | 14 +- .../amsAbilityVisibleTestServiceB/BUILD.gn | 5 +- .../include/amsabilityvisibletestpageb1.h | 6 +- .../include/amsabilityvisibletestpageb2.h | 6 +- .../include/amsabilityvisibletestservice.h | 6 +- .../include/amsabilityvisibletestservicea1.h | 6 +- .../src/amsabilityvisibletestdata.cpp | 16 +- .../src/amsabilityvisibletestpageb1.cpp | 16 +- .../src/amsabilityvisibletestpageb2.cpp | 22 +- .../src/amsabilityvisibletestservice.cpp | 20 +- .../src/amsabilityvisibletestservicea1.cpp | 20 +- .../BUILD.gn | 4 +- .../src/main_ability.cpp | 26 +- .../amsConfigurationUpdatedTest/BUILD.gn | 4 +- .../src/main_ability.cpp | 30 +- .../src/second_ability.cpp | 26 +- .../abilitySrc/amsDataSystemTestA/BUILD.gn | 4 +- .../src/ams_st_data_ability_data_a.cpp | 54 +- .../src/ams_st_data_ability_page_a.cpp | 56 +- .../abilitySrc/amsDataSystemTestB/BUILD.gn | 5 +- .../src/ams_st_data_ability_data_b.cpp | 32 +- .../src/ams_st_data_ability_page_b.cpp | 40 +- .../abilitySrc/amsDataSystemTestC/BUILD.gn | 5 +- .../src/ams_st_data_ability_data_c1.cpp | 52 +- .../src/ams_st_data_ability_data_c2.cpp | 32 +- .../amsKitSTAbilityManager/BUILD.gn | 5 +- .../src/kit_test_ability_manager_second.cpp | 68 +- .../amsKitSTAbilityManagerFirst/BUILD.gn | 5 +- .../src/kit_test_ability_manager.cpp | 116 +-- .../abilitySrc/amsKitSystemTest/BUILD.gn | 5 +- .../amsKitSystemTest/src/fifth_ability.cpp | 34 +- .../amsKitSystemTest/src/fourth_ability.cpp | 28 +- .../src/kit_test_ability_manager.cpp | 116 +-- .../amsKitSystemTest/src/main_ability.cpp | 36 +- .../amsKitSystemTest/src/second_ability.cpp | 34 +- .../amsKitSystemTest/src/sixth_ability.cpp | 132 ++-- .../amsKitSystemTest/src/third_ability.cpp | 28 +- .../abilitySrc/amsKitSystemTestA/BUILD.gn | 4 +- .../amsKitSystemTestA/src/main_ability.cpp | 32 +- .../amsKitSystemTestA/src/second_ability.cpp | 32 +- .../abilitySrc/amsKitSystemTestB/BUILD.gn | 4 +- .../amsKitSystemTestB/src/main_ability.cpp | 32 +- .../abilitySrc/amsKitSystemTestDataA/BUILD.gn | 4 +- .../src/ams_st_kit_data_ability_data_a1.cpp | 70 +- .../src/ams_st_kit_data_ability_data_a2.cpp | 70 +- .../src/ams_st_kit_data_ability_data_a3.cpp | 70 +- .../src/ams_st_kit_data_ability_page_a.cpp | 50 +- .../src/ams_st_kit_data_ability_service_a.cpp | 46 +- .../abilitySrc/amsKitSystemTestDataB/BUILD.gn | 4 +- .../src/ams_st_kit_data_ability_data_b.cpp | 76 +- .../src/ams_st_kit_data_ability_page_b.cpp | 40 +- .../src/ams_st_kit_data_ability_service_b.cpp | 46 +- .../abilitySrc/amsKitSystemTestPageA/BUILD.gn | 5 +- .../src/ability_ability.cpp | 56 +- .../src/ability_context_ability.cpp | 30 +- .../src/ability_life_cycle_ability.cpp | 30 +- .../src/base_ability.cpp | 28 +- .../src/life_cycle_call_backs_ability.cpp | 29 +- .../src/life_cycle_observer_ability.cpp | 30 +- .../amsKitSystemTestService/BUILD.gn | 5 +- .../src/ability_ability.cpp | 56 +- .../src/ability_connection_ability.cpp | 30 +- .../src/ability_context_ability.cpp | 30 +- .../src/ability_life_cycle_ability.cpp | 30 +- .../src/base_ability.cpp | 24 +- .../src/life_cycle_call_backs_ability.cpp | 27 +- .../src/life_cycle_observer_ability.cpp | 28 +- .../abilitySrc/amsMissionStackTest/BUILD.gn | 4 +- .../amsMissionStackTest/src/main_ability.cpp | 72 +- .../src/second_ability.cpp | 48 +- .../amsMissionStackTest/src/third_ability.cpp | 30 +- .../amsMissionStackTestSubsidiary/BUILD.gn | 4 +- .../src/main_ability.cpp | 42 +- .../src/second_ability.cpp | 34 +- .../src/third_ability.cpp | 26 +- .../abilitySrc/amsStDataAbility/BUILD.gn | 5 +- .../src/verify_act_data_ability.cpp | 24 +- .../src/verify_act_data_ability2.cpp | 26 +- .../src/verify_act_page_ability.cpp | 42 +- .../abilitySrc/amsSystemTestA/BUILD.gn | 5 +- .../amsSystemTestA/include/amsstabilitya1.h | 2 +- .../amsSystemTestA/include/amsstabilitya2.h | 2 +- .../amsSystemTestA/src/amsstabilitya1.cpp | 14 +- .../amsSystemTestA/src/amsstabilitya2.cpp | 14 +- .../abilitySrc/amsSystemTestB/BUILD.gn | 5 +- .../amsSystemTestB/include/amsstabilityb1.h | 2 +- .../amsSystemTestB/src/amsstabilityb1.cpp | 14 +- .../abilitySrc/amsSystemTestC/BUILD.gn | 5 +- .../amsSystemTestC/include/amsstabilityc1.h | 2 +- .../amsSystemTestC/include/amsstabilityc2.h | 2 +- .../amsSystemTestC/include/amsstabilityc3.h | 2 +- .../amsSystemTestC/src/amsstabilityc1.cpp | 14 +- .../amsSystemTestC/src/amsstabilityc2.cpp | 14 +- .../amsSystemTestC/src/amsstabilityc3.cpp | 14 +- .../abilitySrc/amsSystemTestD/BUILD.gn | 5 +- .../amsSystemTestD/include/amsstabilityd1.h | 2 +- .../amsSystemTestD/include/amsstabilityd2.h | 2 +- .../amsSystemTestD/src/amsstabilityd1.cpp | 14 +- .../amsSystemTestD/src/amsstabilityd2.cpp | 14 +- .../abilitySrc/amsSystemTestDFX/BUILD.gn | 5 +- .../src/ams_dfx_st_service_ability_a1.cpp | 20 +- .../src/ams_dfx_st_service_ability_a2.cpp | 20 +- .../abilitySrc/amsSystemTestE/BUILD.gn | 5 +- .../amsSystemTestE/include/amsstabilitye1.h | 2 +- .../amsSystemTestE/src/amsstabilitye1.cpp | 14 +- .../abilitySrc/amsSystemTestErrorK/BUILD.gn | 5 +- .../include/amsstabilityerrork1.h | 2 +- .../src/amsstabilityerrork1.cpp | 10 +- .../abilitySrc/amsSystemTestErrorL/BUILD.gn | 5 +- .../include/amsstabilityerrorl1.h | 2 +- .../src/amsstabilityerrorl1.cpp | 10 +- .../abilitySrc/amsSystemTestF/BUILD.gn | 5 +- .../amsSystemTestF/include/amsstabilityf1.h | 2 +- .../amsSystemTestF/include/amsstabilityf2.h | 2 +- .../amsSystemTestF/include/amsstabilityf3.h | 2 +- .../amsSystemTestF/src/amsstabilityf1.cpp | 14 +- .../amsSystemTestF/src/amsstabilityf2.cpp | 14 +- .../amsSystemTestF/src/amsstabilityf3.cpp | 14 +- .../abilitySrc/amsSystemTestG/BUILD.gn | 5 +- .../amsSystemTestG/include/amsstabilityg1.h | 2 +- .../amsSystemTestG/include/amsstabilityg2.h | 2 +- .../amsSystemTestG/src/amsstabilityg1.cpp | 14 +- .../amsSystemTestG/src/amsstabilityg2.cpp | 14 +- .../abilitySrc/amsSystemTestH/BUILD.gn | 5 +- .../amsSystemTestH/include/amsstabilityh1.h | 2 +- .../amsSystemTestH/src/amsstabilityh1.cpp | 14 +- .../abilitySrc/amsSystemTestI/BUILD.gn | 5 +- .../amsSystemTestI/include/amsstabilityi1.h | 2 +- .../amsSystemTestI/include/amsstabilityi2.h | 2 +- .../amsSystemTestI/include/amsstabilityi3.h | 2 +- .../amsSystemTestI/include/amsstabilityi4.h | 2 +- .../amsSystemTestI/src/amsstabilityi1.cpp | 14 +- .../amsSystemTestI/src/amsstabilityi2.cpp | 14 +- .../amsSystemTestI/src/amsstabilityi3.cpp | 14 +- .../amsSystemTestI/src/amsstabilityi4.cpp | 14 +- .../abilitySrc/amsSystemTestM/BUILD.gn | 5 +- .../amsSystemTestM/include/amsstabilitym1.h | 2 +- .../amsSystemTestM/src/amsstabilitym1.cpp | 16 +- .../abilitySrc/amsSystemTestN/BUILD.gn | 5 +- .../amsSystemTestN/include/amsstabilityn1.h | 2 +- .../amsSystemTestN/include/amsstabilityn2.h | 2 +- .../amsSystemTestN/include/amsstabilityn3.h | 2 +- .../amsSystemTestN/include/amsstabilityn4.h | 2 +- .../amsSystemTestN/src/amsstabilityn1.cpp | 16 +- .../amsSystemTestN/src/amsstabilityn2.cpp | 16 +- .../amsSystemTestN/src/amsstabilityn3.cpp | 14 +- .../amsSystemTestN/src/amsstabilityn4.cpp | 14 +- .../abilitySrc/amsSystemTestO/BUILD.gn | 5 +- .../amsSystemTestO/include/amsstabilityo1.h | 2 +- .../amsSystemTestO/src/amsstabilityo1.cpp | 14 +- .../abilitySrc/amsSystemTestP/BUILD.gn | 5 +- .../amsSystemTestP/include/amsstabilityp1.h | 2 +- .../amsSystemTestP/src/amsstabilityp1.cpp | 14 +- .../abilitySrc/amsSystemTestQ/BUILD.gn | 5 +- .../amsSystemTestQ/include/amsstabilityq1.h | 2 +- .../amsSystemTestQ/include/amsstabilityq2.h | 2 +- .../amsSystemTestQ/include/amsstabilityq3.h | 2 +- .../amsSystemTestQ/include/amsstabilityq4.h | 2 +- .../amsSystemTestQ/src/amsstabilityq1.cpp | 16 +- .../amsSystemTestQ/src/amsstabilityq2.cpp | 16 +- .../amsSystemTestQ/src/amsstabilityq3.cpp | 14 +- .../amsSystemTestQ/src/amsstabilityq4.cpp | 14 +- .../abilitySrc/amsSystemTestR/BUILD.gn | 5 +- .../amsSystemTestR/include/amsstabilityr1.h | 2 +- .../amsSystemTestR/include/amsstabilityr2.h | 2 +- .../amsSystemTestR/include/amsstabilityr3.h | 2 +- .../amsSystemTestR/include/amsstabilityr4.h | 2 +- .../amsSystemTestR/src/amsstabilityr1.cpp | 16 +- .../amsSystemTestR/src/amsstabilityr2.cpp | 16 +- .../amsSystemTestR/src/amsstabilityr3.cpp | 14 +- .../amsSystemTestR/src/amsstabilityr4.cpp | 14 +- .../abilitySrc/amsSystemTestServiceA/BUILD.gn | 5 +- .../src/ams_st_service_ability_a1.cpp | 46 +- .../abilitySrc/amsSystemTestServiceB/BUILD.gn | 5 +- .../src/ams_st_service_ability_b2.cpp | 48 +- .../src/ams_st_service_ability_b3.cpp | 48 +- .../abilitySrc/amsSystemTestServiceC/BUILD.gn | 5 +- .../src/ams_st_service_ability_c4.cpp | 32 +- .../abilitySrc/amsSystemTestServiceD/BUILD.gn | 5 +- .../src/ams_st_service_ability_d1.cpp | 52 +- .../abilitySrc/amsSystemTestServiceE/BUILD.gn | 5 +- .../src/ams_st_service_ability_e2.cpp | 52 +- .../abilitySrc/amsSystemTestServiceF/BUILD.gn | 5 +- .../src/ams_st_service_ability_f3.cpp | 20 +- .../abilitySrc/amsSystemTestServiceG/BUILD.gn | 5 +- .../src/ams_st_service_ability_g1.cpp | 52 +- .../abilitySrc/amsSystemTestServiceH/BUILD.gn | 5 +- .../src/ams_st_service_ability_h1.cpp | 52 +- .../abilitySrc/fwkAbilityState/BUILD.gn | 5 +- .../include/ability_state_main.h | 2 +- .../include/ability_state_second.h | 2 +- .../src/ability_state_main.cpp | 32 +- .../src/ability_state_second.cpp | 20 +- .../abilitySrc/serviceAbilityA/BUILD.gn | 4 +- .../include/service_ability_a.h | 2 +- .../include/verify_act_first_ability.h | 2 +- .../serviceAbilityA/src/service_ability_a.cpp | 12 +- .../src/verify_act_first_ability.cpp | 62 +- .../abilitySrc/taskDispatcherTestA/BUILD.gn | 4 +- .../taskDispatcherTestA/src/main_ability.cpp | 742 +++++++++--------- .../src/second_ability.cpp | 28 +- .../abilitySrc/taskDispatcherTestB/BUILD.gn | 4 +- .../taskDispatcherTestB/src/main_ability.cpp | 78 +- .../src/second_ability.cpp | 26 +- .../tools/include/stpageabilityevent.h | 2 +- .../tools/src/stpageabilityevent.cpp | 10 +- .../fmsSystemPerformance/BUILD.gn | 5 +- .../src/form_ability_performance.cpp | 100 +-- .../fmsSystemStress/BUILD.gn | 5 +- .../src/form_ability_stress.cpp | 146 ++-- .../fmsSystemTestHostCommonA/BUILD.gn | 5 +- .../src/form_ability_commona.cpp | 56 +- .../fmsSystemTestHostCommonB/BUILD.gn | 5 +- .../src/form_ability_commonb.cpp | 56 +- .../fmsSystemTestHostNoPerm/BUILD.gn | 5 +- .../src/form_ability_no_perm.cpp | 36 +- .../fmsSystemTestHostNormal/BUILD.gn | 5 +- .../src/form_ability_a.cpp | 238 +++--- .../src/form_ability_deleteform.cpp | 218 ++--- .../src/form_ability_releaseform.cpp | 139 ++-- .../fmsSystemTestHostNormalB/BUILD.gn | 5 +- .../src/form_ability_b.cpp | 100 +-- .../fmsSystemTestHostNormalC/BUILD.gn | 5 +- .../src/form_ability_c.cpp | 66 +- .../fmsSystemTestHostNotSys/BUILD.gn | 5 +- .../src/form_ability_not_sys.cpp | 36 +- .../selfStartingTestHostA/BUILD.gn | 5 +- .../src/form_ability_self_starting_a.cpp | 38 +- .../selfStartingTestHostB/BUILD.gn | 5 +- .../src/form_ability_self_starting_b.cpp | 44 +- .../formSystemTestServiceA/BUILD.gn | 5 +- .../src/form_st_service_ability_A.cpp | 72 +- .../formSystemTestServiceB/BUILD.gn | 5 +- .../src/form_st_service_ability_B.cpp | 72 +- .../formSystemTestServiceC/BUILD.gn | 5 +- .../src/form_st_service_ability_C.cpp | 72 +- .../formSystemTestServiceD/BUILD.gn | 5 +- .../src/form_st_service_ability_D.cpp | 72 +- .../formSystemTestServiceE/BUILD.gn | 5 +- .../src/form_st_service_ability_E.cpp | 72 +- test/systemtest/common/ams/BUILD.gn | 4 +- .../BUILD.gn | 12 +- .../ams/ams_ability_state_test/BUILD.gn | 12 +- .../common/ams/ams_check_service/BUILD.gn | 12 +- test/systemtest/common/fms/BUILD.gn | 4 +- .../common/fms/fms_acquire_form_test/BUILD.gn | 2 +- .../fms_acquire_form_test.cpp | 2 +- .../fms/fms_acquire_form_test_max/BUILD.gn | 2 +- .../fms_acquire_form_test_batch.cpp | 2 +- .../fms_acquire_form_test_max.cpp | 2 +- .../common/fms/fms_delete_form_test/BUILD.gn | 2 +- .../fms_delete_form_test.cpp | 2 +- .../common/fms/fms_fuzz_test/BUILD.gn | 2 +- .../fms/fms_fuzz_test/src/fms_fuzz_test.cpp | 2 +- .../common/fms/fms_performance_test/BUILD.gn | 2 +- .../fms_performance_test.cpp | 2 +- .../common/fms/fms_release_form_test/BUILD.gn | 2 +- .../fms_release_form_test.cpp | 2 +- .../fms/fms_self_starting_test/BUILD.gn | 2 +- .../fms_self_starting_test.cpp | 6 +- .../self_starting_test_config_parser.h | 10 +- .../common/fms/fms_stress_test/BUILD.gn | 2 +- .../fms/fms_stress_test/fms_stress_test.cpp | 2 +- .../common/task_dispatcher/BUILD.gn | 12 +- .../include/task_dispatcher_tools.h | 2 +- .../src/task_dispatcher_tools.cpp | 42 +- tools/aa/BUILD.gn | 12 +- tools/fm/BUILD.gn | 21 +- tools/fm/src/fms_command.cpp | 80 +- 602 files changed, 10261 insertions(+), 10060 deletions(-) create mode 100644 interfaces/innerkits/log/include/ability_base_log_wrapper.h create mode 100644 interfaces/innerkits/log/include/parcel_macro_base.h diff --git a/common/task_dispatcher/BUILD.gn b/common/task_dispatcher/BUILD.gn index ad7a6c3f64..ceba1aafa6 100644 --- a/common/task_dispatcher/BUILD.gn +++ b/common/task_dispatcher/BUILD.gn @@ -16,6 +16,7 @@ import("//foundation/aafwk/standard/aafwk.gni") config("task_dispatcher_public_config") { include_dirs = [ + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", @@ -52,12 +53,12 @@ ohos_shared_library("task_dispatcher") { if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } - deps = [ - "${appexecfwk_path}/common:libappexecfwk_common", - "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base:appexecfwk_base", - "${appexecfwk_path}/interfaces/innerkits/libeventhandler:libeventhandler", + deps = [ "${appexecfwk_path}/common:libappexecfwk_common" ] + external_deps = [ + "bundle_framework:appexecfwk_base", + "eventhandler:libeventhandler", + "hiviewdfx_hilog_native:libhilog", ] - external_deps = [ "hiviewdfx_hilog_native:libhilog" ] subsystem_name = "aafwk" part_name = "ability_runtime" diff --git a/common/task_dispatcher/include/dispatcher/blocking_queue.h b/common/task_dispatcher/include/dispatcher/blocking_queue.h index 74d6605ba8..305c861422 100644 --- a/common/task_dispatcher/include/dispatcher/blocking_queue.h +++ b/common/task_dispatcher/include/dispatcher/blocking_queue.h @@ -22,7 +22,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "task.h" #include "task_priority.h" @@ -80,7 +80,7 @@ public: { std::unique_lock lock(mutex_); while (queue_.empty() && !stopFlag_) { - APP_LOGI("BlockingQueue::Take empty_wait"); + HILOG_INFO("BlockingQueue::Take empty_wait"); empty_.wait(lock); } @@ -98,7 +98,7 @@ public: std::unique_lock lock(mutex_); while (queue_.empty() && !stopFlag_) { if (empty_.wait_until(lock, timeout) == std::cv_status::timeout) { - APP_LOGI("BlockingQueue::Poll timeout"); + HILOG_INFO("BlockingQueue::Poll timeout"); break; } } diff --git a/common/task_dispatcher/include/dispatcher/parallel_task_dispatcher_base.h b/common/task_dispatcher/include/dispatcher/parallel_task_dispatcher_base.h index 22b248f0df..87381bd557 100644 --- a/common/task_dispatcher/include/dispatcher/parallel_task_dispatcher_base.h +++ b/common/task_dispatcher/include/dispatcher/parallel_task_dispatcher_base.h @@ -104,7 +104,7 @@ private: void OnChanged(const TaskStage &stage) { if (stage.IsDone()) { - APP_LOGI("ParallelTaskDispatcherBase task done."); + HILOG_INFO("ParallelTaskDispatcherBase task done."); callback_(); } } diff --git a/common/task_dispatcher/include/task/barrier_handler.h b/common/task_dispatcher/include/task/barrier_handler.h index 179de54592..c2c52234be 100644 --- a/common/task_dispatcher/include/task/barrier_handler.h +++ b/common/task_dispatcher/include/task/barrier_handler.h @@ -68,7 +68,7 @@ private: void OnChanged(const TaskStage &stage) { if (stage.IsDone()) { - APP_LOGI("BarrierHandler task done."); + HILOG_INFO("BarrierHandler task done."); callback_(); } }; diff --git a/common/task_dispatcher/include/task/sync_task.h b/common/task_dispatcher/include/task/sync_task.h index 08df7c7cf4..5901e6bbc2 100644 --- a/common/task_dispatcher/include/task/sync_task.h +++ b/common/task_dispatcher/include/task/sync_task.h @@ -22,7 +22,7 @@ #include "runnable.h" #include "task_priority.h" #include "task.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "base_task_dispatcher.h" namespace OHOS { diff --git a/common/task_dispatcher/include/task/task_handler_libevent_adapter.h b/common/task_dispatcher/include/task/task_handler_libevent_adapter.h index b5cfb0e86d..84d9973e04 100644 --- a/common/task_dispatcher/include/task/task_handler_libevent_adapter.h +++ b/common/task_dispatcher/include/task/task_handler_libevent_adapter.h @@ -30,18 +30,18 @@ public: virtual ~TaskHandlerLibeventAdapter(){}; bool Dispatch(const std::shared_ptr &runnable) override { - APP_LOGI("TaskHandlerLibeventAdapter::Dispatch called."); + HILOG_INFO("TaskHandlerLibeventAdapter::Dispatch called."); return EventHandler::PostTask(*(runnable.get()), EventQueue::Priority::HIGH); } bool Dispatch(const std::shared_ptr &runnable, long delayMs) override { - APP_LOGI("TaskHandlerLibeventAdapter::Delay Dispatch called."); + HILOG_INFO("TaskHandlerLibeventAdapter::Delay Dispatch called."); return EventHandler::PostTask(*(runnable.get()), delayMs, EventQueue::Priority::HIGH); } bool DispatchSync(const std::shared_ptr &runnable) override { - APP_LOGI("TaskHandlerLibeventAdapter::Delay Dispatch Sync called."); + HILOG_INFO("TaskHandlerLibeventAdapter::Delay Dispatch Sync called."); return EventHandler::PostSyncTask(*(runnable.get()), EventQueue::Priority::HIGH); } }; diff --git a/common/task_dispatcher/include/threading/concurrent_queue.h b/common/task_dispatcher/include/threading/concurrent_queue.h index a5b7cc6530..7e9286e0fb 100644 --- a/common/task_dispatcher/include/threading/concurrent_queue.h +++ b/common/task_dispatcher/include/threading/concurrent_queue.h @@ -19,7 +19,7 @@ #include #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -51,7 +51,7 @@ public: { std::unique_lock lock(mutex_); while (queue_.empty()) { - APP_LOGI("ConcurrentQueue::Take blocked"); + HILOG_INFO("ConcurrentQueue::Take blocked"); empty_.wait(lock); } @@ -63,7 +63,7 @@ public: { std::unique_lock lock(mutex_); if (queue_.empty()) { - APP_LOGI("ConcurrentQueue::Poll empty"); + HILOG_INFO("ConcurrentQueue::Poll empty"); return nullptr; } T front(queue_.front()); diff --git a/common/task_dispatcher/include/threading/default_thread_factory.h b/common/task_dispatcher/include/threading/default_thread_factory.h index 67dc559d12..6ee8ef91d8 100644 --- a/common/task_dispatcher/include/threading/default_thread_factory.h +++ b/common/task_dispatcher/include/threading/default_thread_factory.h @@ -19,7 +19,7 @@ #include #include "thread_factory.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/common/task_dispatcher/include/threading/delay_queue.h b/common/task_dispatcher/include/threading/delay_queue.h index 49b72d4a5e..d010f661a2 100644 --- a/common/task_dispatcher/include/threading/delay_queue.h +++ b/common/task_dispatcher/include/threading/delay_queue.h @@ -22,7 +22,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -65,12 +65,12 @@ public: while (true) { std::unique_lock lock(mutex_); while (taskQueue_.empty() && !stopFlag_) { - APP_LOGI("DelayQueue::taskQueue_ is empty"); + HILOG_INFO("DelayQueue::taskQueue_ is empty"); emptyWait_.wait(lock); } if (taskQueue_.empty() && stopFlag_) { - APP_LOGI("DelayQueue::taskQueue is empty and stopFlag is true"); + HILOG_INFO("DelayQueue::taskQueue is empty and stopFlag is true"); return nullptr; } diff --git a/common/task_dispatcher/include/threading/work_thread.h b/common/task_dispatcher/include/threading/work_thread.h index 036670bd6a..6aca9c78c3 100644 --- a/common/task_dispatcher/include/threading/work_thread.h +++ b/common/task_dispatcher/include/threading/work_thread.h @@ -20,7 +20,7 @@ #include "thread_factory.h" #include "task.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "appexecfwk_errors.h" namespace OHOS { diff --git a/common/task_dispatcher/include/threading/worker_pool.h b/common/task_dispatcher/include/threading/worker_pool.h index eee7721300..5b5b3cc5ce 100644 --- a/common/task_dispatcher/include/threading/worker_pool.h +++ b/common/task_dispatcher/include/threading/worker_pool.h @@ -22,7 +22,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "runnable.h" #include "task.h" #include "thread_factory.h" diff --git a/common/task_dispatcher/src/dispatcher/base_task_dispatcher.cpp b/common/task_dispatcher/src/dispatcher/base_task_dispatcher.cpp index 979bcaa986..91767f8715 100644 --- a/common/task_dispatcher/src/dispatcher/base_task_dispatcher.cpp +++ b/common/task_dispatcher/src/dispatcher/base_task_dispatcher.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "base_task_dispatcher.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -31,101 +31,101 @@ BaseTaskDispatcher::BaseTaskDispatcher(const std::string &dispatcherName, const ErrCode BaseTaskDispatcher::SyncDispatchBarrier(const std::shared_ptr &task) { - APP_LOGI("BaseTaskDispatcher::SyncDispatchBarrier called"); + HILOG_INFO("BaseTaskDispatcher::SyncDispatchBarrier called"); return SyncDispatch(task); } ErrCode BaseTaskDispatcher::AsyncDispatchBarrier(const std::shared_ptr &task) { - APP_LOGI("BaseTaskDispatcher::AsyncDispatchBarrier start"); + HILOG_INFO("BaseTaskDispatcher::AsyncDispatchBarrier start"); std::shared_ptr revocable = AsyncDispatch(task); if (revocable != nullptr) { - APP_LOGI("BaseTaskDispatcher::AsyncDispatchBarrier end"); + HILOG_INFO("BaseTaskDispatcher::AsyncDispatchBarrier end"); return ERR_OK; } - APP_LOGE("BaseTaskDispatcher::AsyncDispatchBarrier revocable is nullptr"); + HILOG_ERROR("BaseTaskDispatcher::AsyncDispatchBarrier revocable is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } std::shared_ptr BaseTaskDispatcher::CreateDispatchGroup() { - APP_LOGI("BaseTaskDispatcher::CreateDispatchGroup called."); + HILOG_INFO("BaseTaskDispatcher::CreateDispatchGroup called."); return std::make_shared(); } std::shared_ptr BaseTaskDispatcher::AsyncGroupDispatch( const std::shared_ptr &group, const std::shared_ptr &task) { - APP_LOGI("BaseTaskDispatcher::AsyncGroupDispatch called."); + HILOG_INFO("BaseTaskDispatcher::AsyncGroupDispatch called."); return AsyncDispatch(task); } bool BaseTaskDispatcher::GroupDispatchWait(const std::shared_ptr &group, long timeout) { - APP_LOGI("BaseTaskDispatcher::GroupDispatchWait start"); + HILOG_INFO("BaseTaskDispatcher::GroupDispatchWait start"); if (group == nullptr) { - APP_LOGE("BaseTaskDispatcher::GroupDispatchWait group is nullptr"); + HILOG_ERROR("BaseTaskDispatcher::GroupDispatchWait group is nullptr"); return false; } std::shared_ptr groupImpl = CastToGroupImpl(group); if (groupImpl == nullptr) { - APP_LOGE("BaseTaskDispatcher::GroupDispatchWait groupImpl is nullptr"); + HILOG_ERROR("BaseTaskDispatcher::GroupDispatchWait groupImpl is nullptr"); return false; } bool result = groupImpl->AwaitAllTasks(timeout); - APP_LOGI("BaseTaskDispatcher::GroupDispatchWait start"); + HILOG_INFO("BaseTaskDispatcher::GroupDispatchWait start"); return result; } ErrCode BaseTaskDispatcher::GroupDispatchNotify( const std::shared_ptr &group, const std::shared_ptr &task) { - APP_LOGI("BaseTaskDispatcher::GroupDispatchNotify start"); + HILOG_INFO("BaseTaskDispatcher::GroupDispatchNotify start"); if (group == nullptr) { - APP_LOGE("BaseTaskDispatcher::GroupDispatchNotify group cannot be null."); + HILOG_ERROR("BaseTaskDispatcher::GroupDispatchNotify group cannot be null."); return ERR_APPEXECFWK_CHECK_FAILED; } if (task == nullptr) { - APP_LOGE("BaseTaskDispatcher::GroupDispatchNotify task cannot be null"); + HILOG_ERROR("BaseTaskDispatcher::GroupDispatchNotify task cannot be null"); return ERR_APPEXECFWK_CHECK_FAILED; } const std::function asyncDispatch = std::bind(&BaseTaskDispatcher::AsyncDispatch, this, task); if (asyncDispatch == nullptr) { - APP_LOGE("BaseTaskDispatcher::GroupDispatchNotify asyncDispatch is nullptr"); + HILOG_ERROR("BaseTaskDispatcher::GroupDispatchNotify asyncDispatch is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } std::shared_ptr ptrCallback = std::make_shared(asyncDispatch); if (ptrCallback == nullptr) { - APP_LOGE("BaseTaskDispatcher::GroupDispatchNotify runnable is nullptr"); + HILOG_ERROR("BaseTaskDispatcher::GroupDispatchNotify runnable is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } if (group == nullptr) { - APP_LOGE("BaseTaskDispatcher::GroupDispatchNotify group is nullptr"); + HILOG_ERROR("BaseTaskDispatcher::GroupDispatchNotify group is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } std::shared_ptr groupImpl = CastToGroupImpl(group); if (groupImpl == nullptr) { - APP_LOGE("BaseTaskDispatcher::GroupDispatchNotify groupImpl is nullptr"); + HILOG_ERROR("BaseTaskDispatcher::GroupDispatchNotify groupImpl is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } if (groupImpl->AddNotification(ptrCallback)) { - APP_LOGI("BaseTaskDispatcher::GroupDispatchNotify end"); + HILOG_INFO("BaseTaskDispatcher::GroupDispatchNotify end"); return ERR_OK; } - APP_LOGE("BaseTaskDispatcher::GroupDispatchNotify addNotification failed"); + HILOG_ERROR("BaseTaskDispatcher::GroupDispatchNotify addNotification failed"); return ERR_APPEXECFWK_CHECK_FAILED; } ErrCode BaseTaskDispatcher::ApplyDispatch(const std::shared_ptr> &task, long iterations) { - APP_LOGI("BaseTaskDispatcher::ApplyDispatch start"); + HILOG_INFO("BaseTaskDispatcher::ApplyDispatch start"); if (task == nullptr) { - APP_LOGE("BaseTaskDispatcher::ApplyDispatch task object is not set"); + HILOG_ERROR("BaseTaskDispatcher::ApplyDispatch task object is not set"); return ERR_APPEXECFWK_CHECK_FAILED; } if (iterations <= 0) { - APP_LOGE("BaseTaskDispatcher::ApplyDispatch iterations must giant than 0"); + HILOG_ERROR("BaseTaskDispatcher::ApplyDispatch iterations must giant than 0"); return ERR_APPEXECFWK_CHECK_FAILED; } @@ -133,28 +133,28 @@ ErrCode BaseTaskDispatcher::ApplyDispatch(const std::shared_ptr ptrCallback = std::make_shared([task, i]() { (*task)(i); }); if (ptrCallback == nullptr) { - APP_LOGE("BaseTaskDispatcher::ApplyDispatch runnable is nullptr"); + HILOG_ERROR("BaseTaskDispatcher::ApplyDispatch runnable is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } std::shared_ptr revocable = AsyncDispatch(ptrCallback); if (revocable == nullptr) { - APP_LOGE("BaseTaskDispatcher::ApplyDispatch revocable is nullptr, index:%{public}ld", i); + HILOG_ERROR("BaseTaskDispatcher::ApplyDispatch revocable is nullptr, index:%{public}ld", i); flag = false; } } if (flag) { - APP_LOGI("BaseTaskDispatcher::ApplyDispatch end"); + HILOG_INFO("BaseTaskDispatcher::ApplyDispatch end"); return ERR_OK; } - APP_LOGI("BaseTaskDispatcher::ApplyDispatch failed"); + HILOG_INFO("BaseTaskDispatcher::ApplyDispatch failed"); return ERR_APPEXECFWK_CHECK_FAILED; } ErrCode BaseTaskDispatcher::Check(const std::shared_ptr &task) const { - APP_LOGI("BaseTaskDispatcher::Check called"); + HILOG_INFO("BaseTaskDispatcher::Check called"); if (task == nullptr) { - APP_LOGE("dispatch task cannot be null."); + HILOG_ERROR("dispatch task cannot be null."); return ERR_APPEXECFWK_CHECK_FAILED; } return ERR_OK; @@ -162,12 +162,12 @@ ErrCode BaseTaskDispatcher::Check(const std::shared_ptr &task) const std::shared_ptr BaseTaskDispatcher::CastToGroupImpl(const std::shared_ptr &group) { - APP_LOGI("BaseTaskDispatcher::CastToGroupImpl called"); + HILOG_INFO("BaseTaskDispatcher::CastToGroupImpl called"); std::shared_ptr groupImpl_ptr = std::static_pointer_cast(group); if (groupImpl_ptr != nullptr) { return groupImpl_ptr; } - APP_LOGE("group cannot instance of groupImpl "); + HILOG_ERROR("group cannot instance of groupImpl "); return nullptr; } @@ -184,14 +184,14 @@ TaskPriority BaseTaskDispatcher::GetPriority() const void BaseTaskDispatcher::TracePointBeforePost( std::shared_ptr &task, bool isAsyncTask, const std::string &dispatcherName) const { - APP_LOGI("BaseTaskDispatcher::TracePointBeforePost called"); + HILOG_INFO("BaseTaskDispatcher::TracePointBeforePost called"); if (task == nullptr) { - APP_LOGE("BaseTaskDispatcher::TracePointBeforePost the task is nullptr"); + HILOG_ERROR("BaseTaskDispatcher::TracePointBeforePost the task is nullptr"); return; } std::string taskType = isAsyncTask ? "ASYNC_TASK_STRING" : "SYNC_TASK_STRING"; long seq = task->GetSequence(); - APP_LOGI("BaseTaskDispatcher::TracePointBeforePost " + HILOG_INFO("BaseTaskDispatcher::TracePointBeforePost " "log---TaskType:%{public}s,TaskSeq:%{public}ld,DispatcherName::%{public}s", taskType.c_str(), seq, @@ -201,14 +201,14 @@ void BaseTaskDispatcher::TracePointBeforePost( void BaseTaskDispatcher::TracePointAfterPost( std::shared_ptr &task, bool isAsyncTask, const std::string &dispatcherName) const { - APP_LOGI("BaseTaskDispatcher::TracePointAfterPost called"); + HILOG_INFO("BaseTaskDispatcher::TracePointAfterPost called"); if (task == nullptr) { - APP_LOGE("BaseTaskDispatcher::TracePointAfterPost the task is nullptr"); + HILOG_ERROR("BaseTaskDispatcher::TracePointAfterPost the task is nullptr"); return; } std::string taskType = isAsyncTask ? "ASYNC_TASK_STRING" : "SYNC_TASK_STRING"; long seq = task->GetSequence(); - APP_LOGI("BaseTaskDispatcher::TracePointAfterPost " + HILOG_INFO("BaseTaskDispatcher::TracePointAfterPost " "log---TaskType:%{public}s,TaskSeq:%{public}ld,DispatcherName::%{public}s", taskType.c_str(), seq, diff --git a/common/task_dispatcher/src/dispatcher/group_impl.cpp b/common/task_dispatcher/src/dispatcher/group_impl.cpp index 79ad0da534..ff4ceee648 100644 --- a/common/task_dispatcher/src/dispatcher/group_impl.cpp +++ b/common/task_dispatcher/src/dispatcher/group_impl.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "group_impl.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { GroupImpl::GroupImpl() @@ -30,13 +30,13 @@ GroupImpl::GroupImpl() */ bool GroupImpl::AwaitAllTasks(long timeout) { - APP_LOGI("GroupImpl::AwaitAllTasks start"); + HILOG_INFO("GroupImpl::AwaitAllTasks start"); if (count_.load() == 0) { - APP_LOGI("GroupImpl::AwaitAllTasks number of count_ is zero"); + HILOG_INFO("GroupImpl::AwaitAllTasks number of count_ is zero"); return true; } if (timeout <= 0L) { - APP_LOGW("GroupImpl::AwaitAllTasks timeout<=0"); + HILOG_WARN("GroupImpl::AwaitAllTasks timeout<=0"); return false; } bool success = true; @@ -44,12 +44,12 @@ bool GroupImpl::AwaitAllTasks(long timeout) while (count_.load() > 0) { if (condition_.wait_for(lock, std::chrono::milliseconds(timeout)) == std::cv_status::timeout) { success = false; - APP_LOGI("GroupImpl::awaitAllTasks timeout"); + HILOG_INFO("GroupImpl::awaitAllTasks timeout"); break; } - APP_LOGI("GroupImpl::awaitAllTasks success"); + HILOG_INFO("GroupImpl::awaitAllTasks success"); } - APP_LOGI("GroupImpl::AwaitAllTasks end"); + HILOG_INFO("GroupImpl::AwaitAllTasks end"); return success; } @@ -59,7 +59,7 @@ bool GroupImpl::AwaitAllTasks(long timeout) */ void GroupImpl::Associate() { - APP_LOGI("GroupImpl::Associate called add a task"); + HILOG_INFO("GroupImpl::Associate called add a task"); count_.fetch_add(1); } /** @@ -69,7 +69,7 @@ void GroupImpl::Associate() void GroupImpl::NotifyTaskDone() { - APP_LOGI("GroupImpl::NotifyTaskDone start. Called notify a task to complete"); + HILOG_INFO("GroupImpl::NotifyTaskDone start. Called notify a task to complete"); count_.fetch_sub(1); int newValue = count_.load(); if (newValue > 0) { @@ -79,7 +79,7 @@ void GroupImpl::NotifyTaskDone() condition_.notify_all(); DrainNotifications(); - APP_LOGI("GroupImpl::NotifyTaskDone end"); + HILOG_INFO("GroupImpl::NotifyTaskDone end"); } /** * @brief Adds the |notification| to notification list. @@ -91,24 +91,24 @@ void GroupImpl::NotifyTaskDone() */ bool GroupImpl::AddNotification(const std::shared_ptr ¬ification) { - APP_LOGI("GroupImpl::AddNotification start"); + HILOG_INFO("GroupImpl::AddNotification start"); if (count_.load() != 0) { std::unique_lock lock(dataMutex_); if (notifications_.size() == MAX_TASK) { - APP_LOGW("GroupImpl::AddNotification called maximun number of tasks exceeded"); + HILOG_WARN("GroupImpl::AddNotification called maximun number of tasks exceeded"); return false; } if (count_.load() != 0) { - APP_LOGI("GroupImpl::AddNotification called add task"); + HILOG_INFO("GroupImpl::AddNotification called add task"); notifications_.push_back(notification); return true; } } if (notification) { - APP_LOGI("GroupImpl::AddNotification notification execute"); + HILOG_INFO("GroupImpl::AddNotification notification execute"); (*notification)(); } - APP_LOGI("GroupImpl::AddNotification end"); + HILOG_INFO("GroupImpl::AddNotification end"); return true; } /** @@ -118,14 +118,14 @@ bool GroupImpl::AddNotification(const std::shared_ptr ¬ification) */ void GroupImpl::DrainNotifications() { - APP_LOGI("GroupImpl::DrainNotifications start"); + HILOG_INFO("GroupImpl::DrainNotifications start"); while (notifications_.size() > 0) { std::shared_ptr notification = notifications_.front(); notifications_.pop_front(); - APP_LOGI("GroupImpl::DrainNotifications execute notification"); + HILOG_INFO("GroupImpl::DrainNotifications execute notification"); (*notification)(); } - APP_LOGI("GroupImpl::DrainNotifications end"); + HILOG_INFO("GroupImpl::DrainNotifications end"); } } // namespace AppExecFwk } // namespace OHOS diff --git a/common/task_dispatcher/src/dispatcher/parallel_task_dispatcher.cpp b/common/task_dispatcher/src/dispatcher/parallel_task_dispatcher.cpp index ba4daec14d..d0341e24e7 100644 --- a/common/task_dispatcher/src/dispatcher/parallel_task_dispatcher.cpp +++ b/common/task_dispatcher/src/dispatcher/parallel_task_dispatcher.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "parallel_task_dispatcher.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -34,53 +34,53 @@ std::shared_ptr ParallelTaskDispatcher::GetInterceptor() ErrCode ParallelTaskDispatcher::SyncDispatchBarrier(const std::shared_ptr &runnable) { - APP_LOGD("ParallelTaskDispatcher::SyncDispatchBarrier start"); + HILOG_DEBUG("ParallelTaskDispatcher::SyncDispatchBarrier start"); if (Check(runnable) != ERR_OK) { - APP_LOGE("ParallelTaskDispatcher::SyncDispatchBarrier Check failed"); + HILOG_ERROR("ParallelTaskDispatcher::SyncDispatchBarrier Check failed"); return ERR_APPEXECFWK_CHECK_FAILED; } std::shared_ptr innerSyncTask = std::make_shared(runnable, GetPriority(), shared_from_this()); if (innerSyncTask == nullptr) { - APP_LOGE("ParallelTaskDispatcher::SyncDispatchBarrier innerSyncTask is nullptr"); + HILOG_ERROR("ParallelTaskDispatcher::SyncDispatchBarrier innerSyncTask is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } std::shared_ptr innerTask = std::static_pointer_cast(innerSyncTask); if (innerTask == nullptr) { - APP_LOGE("ParallelTaskDispatcher::SyncDispatchBarrier innerTask is nullptr"); + HILOG_ERROR("ParallelTaskDispatcher::SyncDispatchBarrier innerTask is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } - APP_LOGD("ParallelTaskDispatcher::SyncDispatchBarrier into new sync task"); + HILOG_DEBUG("ParallelTaskDispatcher::SyncDispatchBarrier into new sync task"); if (barrierHandler_ == nullptr) { - APP_LOGE("ParallelTaskDispatcher::SyncDispatchBarrier barrierHandler_ is nullptr"); + HILOG_ERROR("ParallelTaskDispatcher::SyncDispatchBarrier barrierHandler_ is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } barrierHandler_->AddBarrier(innerTask); innerSyncTask->WaitTask(); - APP_LOGD("ParallelTaskDispatcher::SyncDispatchBarrier end"); + HILOG_DEBUG("ParallelTaskDispatcher::SyncDispatchBarrier end"); return ERR_OK; } ErrCode ParallelTaskDispatcher::AsyncDispatchBarrier(const std::shared_ptr &runnable) { - APP_LOGD("ParallelTaskDispatcher::AsyncDispatchBarrier start"); + HILOG_DEBUG("ParallelTaskDispatcher::AsyncDispatchBarrier start"); if (Check(runnable) != ERR_OK) { - APP_LOGE("ParallelTaskDispatcher::AsyncDispatchBarrier check failed"); + HILOG_ERROR("ParallelTaskDispatcher::AsyncDispatchBarrier check failed"); return ERR_APPEXECFWK_CHECK_FAILED; } if (barrierHandler_ == nullptr) { - APP_LOGE("ParallelTaskDispatcher::AsyncDispatchBarrier barrierHandler_ is nullptr"); + HILOG_ERROR("ParallelTaskDispatcher::AsyncDispatchBarrier barrierHandler_ is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } std::shared_ptr innerTask = std::make_shared(runnable, GetPriority(), shared_from_this()); - APP_LOGI("ParallelTaskDispatcher::AsyncDispatchBarrier into new async task"); + HILOG_INFO("ParallelTaskDispatcher::AsyncDispatchBarrier into new async task"); if (innerTask == nullptr) { - APP_LOGE("ParallelTaskDispatcher::AsyncDispatchBarrier innerTask is nullptr"); + HILOG_ERROR("ParallelTaskDispatcher::AsyncDispatchBarrier innerTask is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } barrierHandler_->AddBarrier(innerTask); - APP_LOGI("ParallelTaskDispatcher::AsyncDispatchBarrier end"); + HILOG_INFO("ParallelTaskDispatcher::AsyncDispatchBarrier end"); return ERR_OK; } } // namespace AppExecFwk diff --git a/common/task_dispatcher/src/dispatcher/parallel_task_dispatcher_base.cpp b/common/task_dispatcher/src/dispatcher/parallel_task_dispatcher_base.cpp index 6bc0e19c2a..a68596f54a 100644 --- a/common/task_dispatcher/src/dispatcher/parallel_task_dispatcher_base.cpp +++ b/common/task_dispatcher/src/dispatcher/parallel_task_dispatcher_base.cpp @@ -14,7 +14,7 @@ */ #include "parallel_task_dispatcher_base.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "appexecfwk_errors.h" namespace OHOS { @@ -33,93 +33,93 @@ ParallelTaskDispatcherBase::ParallelTaskDispatcherBase( ErrCode ParallelTaskDispatcherBase::InterceptedExecute(std::shared_ptr &task) { - APP_LOGD("ParallelTaskDispatcherBase::InterceptedExecute start"); + HILOG_DEBUG("ParallelTaskDispatcherBase::InterceptedExecute start"); if (executor_ == nullptr) { - APP_LOGE("ParallelTaskDispatcherBase::InterceptedExecute executor_ is nullptr"); + HILOG_ERROR("ParallelTaskDispatcherBase::InterceptedExecute executor_ is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } if ((GetInterceptor() != nullptr) && GetInterceptor()->Intercept(task) == ERR_APPEXECFWK_INTERCEPT_TASK_EXECUTE_SUCCESS) { - APP_LOGE("ParallelTaskDispatcherBase::InterceptedExecute intercept task execute success"); + HILOG_ERROR("ParallelTaskDispatcherBase::InterceptedExecute intercept task execute success"); return ERR_APPEXECFWK_INTERCEPT_TASK_EXECUTE_SUCCESS; } executor_->Execute(task); - APP_LOGI("ParallelTaskDispatcherBase::InterceptedExecute end"); + HILOG_INFO("ParallelTaskDispatcherBase::InterceptedExecute end"); return ERR_OK; } ErrCode ParallelTaskDispatcherBase::SyncDispatch(const std::shared_ptr &runnable) { - APP_LOGI("ParallelTaskDispatcherBase::SyncDispatch start"); + HILOG_INFO("ParallelTaskDispatcherBase::SyncDispatch start"); if (Check(runnable) != ERR_OK) { - APP_LOGE("ParallelTaskDispatcherBase::SyncDispatch check failed"); + HILOG_ERROR("ParallelTaskDispatcherBase::SyncDispatch check failed"); return ERR_APPEXECFWK_CHECK_FAILED; } std::shared_ptr innerSyncTask = std::make_shared(runnable, GetPriority(), shared_from_this()); if (innerSyncTask == nullptr) { - APP_LOGE("ParallelTaskDispatcherBase::SyncDispatch innerSyncTask is nullptr"); + HILOG_ERROR("ParallelTaskDispatcherBase::SyncDispatch innerSyncTask is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } std::shared_ptr innerTask = std::static_pointer_cast(innerSyncTask); if (innerTask == nullptr) { - APP_LOGE("ParallelTaskDispatcherBase::SyncDispatch innerTask is nullptr"); + HILOG_ERROR("ParallelTaskDispatcherBase::SyncDispatch innerTask is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } - APP_LOGI("ParallelTaskDispatcherBase::SyncDispatch into new sync task"); + HILOG_INFO("ParallelTaskDispatcherBase::SyncDispatch into new sync task"); ErrCode execute = InterceptedExecute(innerTask); if (execute != ERR_OK) { - APP_LOGE("ParallelTaskDispatcherBase::SyncDispatch execute failed"); + HILOG_ERROR("ParallelTaskDispatcherBase::SyncDispatch execute failed"); return execute; } innerSyncTask->WaitTask(); - APP_LOGI("ParallelTaskDispatcherBase::SyncDispatch end"); + HILOG_INFO("ParallelTaskDispatcherBase::SyncDispatch end"); return ERR_OK; } std::shared_ptr ParallelTaskDispatcherBase::AsyncDispatch(const std::shared_ptr &runnable) { - APP_LOGI("ParallelTaskDispatcherBase::AsyncDispatch start"); + HILOG_INFO("ParallelTaskDispatcherBase::AsyncDispatch start"); if (Check(runnable) != ERR_OK) { - APP_LOGE("ParallelTaskDispatcherBase::AsyncDispatch check failed."); + HILOG_ERROR("ParallelTaskDispatcherBase::AsyncDispatch check failed."); return nullptr; } std::shared_ptr innerTask = std::make_shared(runnable, GetPriority(), shared_from_this()); if (innerTask == nullptr) { - APP_LOGE("ParallelTaskDispatcherBase::AsyncDispatch innerTask is nullptr."); + HILOG_ERROR("ParallelTaskDispatcherBase::AsyncDispatch innerTask is nullptr."); return nullptr; } TracePointBeforePost(innerTask, true, ASYNC_DISPATCHER_TAG); - APP_LOGI("ParallelTaskDispatcherBase::AsyncDispatch into new async task"); + HILOG_INFO("ParallelTaskDispatcherBase::AsyncDispatch into new async task"); ErrCode execute = InterceptedExecute(innerTask); if (execute != ERR_OK) { - APP_LOGE("ParallelTaskDispatcherBase::AsyncDispatch execute failed"); + HILOG_ERROR("ParallelTaskDispatcherBase::AsyncDispatch execute failed"); return nullptr; } - APP_LOGI("ParallelTaskDispatcherBase::AsyncDispatch end"); + HILOG_INFO("ParallelTaskDispatcherBase::AsyncDispatch end"); return innerTask; } std::shared_ptr ParallelTaskDispatcherBase::DelayDispatch( const std::shared_ptr &runnable, long delayMs) { - APP_LOGI("ParallelTaskDispatcherBase::DelayDispatch start"); + HILOG_INFO("ParallelTaskDispatcherBase::DelayDispatch start"); if (Check(runnable) != ERR_OK) { - APP_LOGE("ParallelTaskDispatcherBase::DelayDispatch Check failed"); + HILOG_ERROR("ParallelTaskDispatcherBase::DelayDispatch Check failed"); return nullptr; } if (executor_ == nullptr) { - APP_LOGE("ParallelTaskDispatcherBase::DelayDispatch executor_ is nullptr"); + HILOG_ERROR("ParallelTaskDispatcherBase::DelayDispatch executor_ is nullptr"); return nullptr; } std::shared_ptr innerTask = std::make_shared(runnable, GetPriority(), shared_from_this()); if (innerTask == nullptr) { - APP_LOGE("ParallelTaskDispatcherBase::DelayDispatch innerTask is nullptr"); + HILOG_ERROR("ParallelTaskDispatcherBase::DelayDispatch innerTask is nullptr"); return nullptr; } TracePointBeforePost(innerTask, true, DELAY_DISPATCHER_TAG); @@ -127,42 +127,42 @@ std::shared_ptr ParallelTaskDispatcherBase::DelayDispatch( innerTask); bool executeFlag = executor_->DelayExecute(callback, delayMs); if (!executeFlag) { - APP_LOGE("ParallelTaskDispatcherBase::DelayDispatch execute failed"); + HILOG_ERROR("ParallelTaskDispatcherBase::DelayDispatch execute failed"); return nullptr; } - APP_LOGI("ParallelTaskDispatcherBase::DelayDispatch end"); + HILOG_INFO("ParallelTaskDispatcherBase::DelayDispatch end"); return innerTask; } std::shared_ptr ParallelTaskDispatcherBase::AsyncGroupDispatch( const std::shared_ptr &group, const std::shared_ptr &runnable) { - APP_LOGI("ParallelTaskDispatcherBase::AsyncGroupDispatch start"); + HILOG_INFO("ParallelTaskDispatcherBase::AsyncGroupDispatch start"); if (group == nullptr) { - APP_LOGE("ParallelTaskDispatcherBase::AsyncGroupDispatch group is nullptr"); + HILOG_ERROR("ParallelTaskDispatcherBase::AsyncGroupDispatch group is nullptr"); return nullptr; } if (Check(runnable) != ERR_OK) { - APP_LOGE("ParallelTaskDispatcherBase::AsyncGroupDispatch Check failed"); + HILOG_ERROR("ParallelTaskDispatcherBase::AsyncGroupDispatch Check failed"); return nullptr; } std::shared_ptr groupImpl = CastToGroupImpl(group); if (groupImpl == nullptr) { - APP_LOGE("ParallelTaskDispatcherBase::AsyncGroupDispatch groupImpl is nullptr"); + HILOG_ERROR("ParallelTaskDispatcherBase::AsyncGroupDispatch groupImpl is nullptr"); return nullptr; } groupImpl->Associate(); std::shared_ptr innerTask = std::make_shared(runnable, GetPriority(), shared_from_this()); if (innerTask == nullptr) { - APP_LOGE("ParallelTaskDispatcherBase::AsyncGroupDispatch innerTask is nullptr"); + HILOG_ERROR("ParallelTaskDispatcherBase::AsyncGroupDispatch innerTask is nullptr"); return nullptr; } TracePointBeforePost(innerTask, true, ASYNC_GROUP_DISPATCHER_TAG); std::shared_ptr ptrlistener = std::make_shared(); if (ptrlistener == nullptr) { - APP_LOGE("ParallelTaskDispatcherBase::AsyncGroupDispatch ptrlistener is nullptr"); + HILOG_ERROR("ParallelTaskDispatcherBase::AsyncGroupDispatch ptrlistener is nullptr"); return nullptr; } const std::function onTaskDone = std::bind(&GroupImpl::NotifyTaskDone, groupImpl); @@ -170,10 +170,10 @@ std::shared_ptr ParallelTaskDispatcherBase::AsyncGroupDispatch( innerTask->AddTaskListener(ptrlistener); ErrCode execute = InterceptedExecute(innerTask); if (execute != ERR_OK) { - APP_LOGE("ParallelTaskDispatcherBase::AsyncGroupDispatch execute failed"); + HILOG_ERROR("ParallelTaskDispatcherBase::AsyncGroupDispatch execute failed"); return nullptr; } - APP_LOGI("ParallelTaskDispatcherBase::AsyncGroupDispatch end"); + HILOG_INFO("ParallelTaskDispatcherBase::AsyncGroupDispatch end"); return innerTask; } diff --git a/common/task_dispatcher/src/dispatcher/serial_task_dispatcher.cpp b/common/task_dispatcher/src/dispatcher/serial_task_dispatcher.cpp index dfd27ceb9f..676fd49174 100644 --- a/common/task_dispatcher/src/dispatcher/serial_task_dispatcher.cpp +++ b/common/task_dispatcher/src/dispatcher/serial_task_dispatcher.cpp @@ -14,7 +14,7 @@ */ #include "serial_task_dispatcher.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "appexecfwk_errors.h" namespace OHOS { namespace AppExecFwk { @@ -43,20 +43,20 @@ std::string SerialTaskDispatcher::GetDispatcherName() ErrCode SerialTaskDispatcher::SyncDispatch(const std::shared_ptr &runnable) { - APP_LOGI("SerialTaskDispatcher::SyncDispatch start"); + HILOG_INFO("SerialTaskDispatcher::SyncDispatch start"); if (Check(runnable) != ERR_OK) { - APP_LOGE("SerialTaskDispatcher::SyncDispatch check failed"); + HILOG_ERROR("SerialTaskDispatcher::SyncDispatch check failed"); return ERR_APPEXECFWK_CHECK_FAILED; } std::shared_ptr innerSyncTask = std::make_shared(runnable, GetPriority(), shared_from_this()); if (innerSyncTask == nullptr) { - APP_LOGE("SerialTaskDispatcher::SyncDispatch innerSyncTask is nullptr"); + HILOG_ERROR("SerialTaskDispatcher::SyncDispatch innerSyncTask is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } std::shared_ptr innerTask = std::static_pointer_cast(innerSyncTask); if (innerTask == nullptr) { - APP_LOGE("SerialTaskDispatcher::SyncDispatch innerTask is nullptr"); + HILOG_ERROR("SerialTaskDispatcher::SyncDispatch innerTask is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } TracePointBeforePost(innerTask, false, SYNC_DISPATCHER_TAG); @@ -64,45 +64,45 @@ ErrCode SerialTaskDispatcher::SyncDispatch(const std::shared_ptr &runn innerSyncTask->WaitTask(); TracePointAfterPost(innerTask, false, DISPATCHER_TAG); - APP_LOGI("SerialTaskDispatcher::SyncDispatch end"); + HILOG_INFO("SerialTaskDispatcher::SyncDispatch end"); return ERR_OK; } std::shared_ptr SerialTaskDispatcher::AsyncDispatch(const std::shared_ptr &runnable) { - APP_LOGI("SerialTaskDispatcher::AsyncDispatch start"); + HILOG_INFO("SerialTaskDispatcher::AsyncDispatch start"); if (Check(runnable) != ERR_OK) { - APP_LOGE("SerialTaskDispatcher::AsyncDispatch Check failed"); + HILOG_ERROR("SerialTaskDispatcher::AsyncDispatch Check failed"); return nullptr; } std::shared_ptr innerTask = std::make_shared(runnable, GetPriority(), shared_from_this()); if (innerTask == nullptr) { - APP_LOGE("SerialTaskDispatcher::AsyncDispatch innerTask is nullptr"); + HILOG_ERROR("SerialTaskDispatcher::AsyncDispatch innerTask is nullptr"); return nullptr; } TracePointBeforePost(innerTask, true, ASYNC_DISPATCHER_TAG); - APP_LOGI("SerialTaskDispatcher::AsyncDispatch into new async task"); + HILOG_INFO("SerialTaskDispatcher::AsyncDispatch into new async task"); OnNewTaskIn(innerTask); - APP_LOGI("SerialTaskDispatcher::AsyncDispatch end"); + HILOG_INFO("SerialTaskDispatcher::AsyncDispatch end"); return innerTask; } std::shared_ptr SerialTaskDispatcher::DelayDispatch(const std::shared_ptr &runnable, long delayMs) { - APP_LOGI("SerialTaskDispatcher::DelayDispatch start"); + HILOG_INFO("SerialTaskDispatcher::DelayDispatch start"); if (executor_ == nullptr) { - APP_LOGE("SerialTaskDispatcher::DelayDispatch executor_ is nullptr"); + HILOG_ERROR("SerialTaskDispatcher::DelayDispatch executor_ is nullptr"); return nullptr; } if (Check(runnable) != ERR_OK) { - APP_LOGE("SerialTaskDispatcher::DelayDispatch Check failed"); + HILOG_ERROR("SerialTaskDispatcher::DelayDispatch Check failed"); return nullptr; } std::shared_ptr innerTask = std::make_shared(runnable, GetPriority(), shared_from_this()); if (innerTask == nullptr) { - APP_LOGE("SerialTaskDispatcher::DelayDispatch innerTask is nullptr"); + HILOG_ERROR("SerialTaskDispatcher::DelayDispatch innerTask is nullptr"); return nullptr; } TracePointBeforePost(innerTask, true, DELAY_DISPATCHER_TAG); @@ -110,38 +110,38 @@ std::shared_ptr SerialTaskDispatcher::DelayDispatch(const std::shared std::function callback = std::bind(&SerialTaskDispatcher::OnNewTaskIn, this, innerTask); bool executeFlag = executor_->DelayExecute(callback, delayMs); if (!executeFlag) { - APP_LOGE("SerialTaskDispatcher::DelayDispatch execute failed"); + HILOG_ERROR("SerialTaskDispatcher::DelayDispatch execute failed"); return nullptr; } - APP_LOGI("SerialTaskDispatcher::DelayDispatch end"); + HILOG_INFO("SerialTaskDispatcher::DelayDispatch end"); return innerTask; } ErrCode SerialTaskDispatcher::OnNewTaskIn(std::shared_ptr &task) { - APP_LOGI("SerialTaskDispatcher::OnNewTaskIn start"); + HILOG_INFO("SerialTaskDispatcher::OnNewTaskIn start"); ErrCode code = Prepare(task); if (code != ERR_OK) { - APP_LOGE("SerialTaskDispatcher::OnNewTaskIn Prepare failed"); + HILOG_ERROR("SerialTaskDispatcher::OnNewTaskIn Prepare failed"); return ERR_APPEXECFWK_CHECK_FAILED; } { std::unique_lock lock(mutex_); if (workingTasks_.Offer(task) == false) { - APP_LOGW("SerialTaskDispatcher.onNewTaskIn exceed the maximum capacity of Queue"); + HILOG_WARN("SerialTaskDispatcher.onNewTaskIn exceed the maximum capacity of Queue"); } } Schedule(); - APP_LOGI("SerialTaskDispatcher::OnNewTaskIn end"); + HILOG_INFO("SerialTaskDispatcher::OnNewTaskIn end"); return ERR_OK; } ErrCode SerialTaskDispatcher::Prepare(std::shared_ptr &task) { - APP_LOGI("SerialTaskDispatcher::Prepare start"); + HILOG_INFO("SerialTaskDispatcher::Prepare start"); if (task == nullptr) { - APP_LOGE("SerialTaskDispatcher::Prepare task is nullptr"); + HILOG_ERROR("SerialTaskDispatcher::Prepare task is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } // inline class @@ -166,57 +166,57 @@ ErrCode SerialTaskDispatcher::Prepare(std::shared_ptr &task) // set inline listener std::shared_ptr ptrlistener = std::make_shared(); if (ptrlistener == nullptr) { - APP_LOGE("SerialTaskDispatcher::Prepare MyTaskListener is nullptr"); + HILOG_ERROR("SerialTaskDispatcher::Prepare MyTaskListener is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } const std::function onTaskDone = [&]() { OnTaskDone(); }; ptrlistener->Callback(onTaskDone); task->AddTaskListener(ptrlistener); - APP_LOGI("SerialTaskDispatcher::Prepare end"); + HILOG_INFO("SerialTaskDispatcher::Prepare end"); return ERR_OK; } void SerialTaskDispatcher::OnTaskDone() { - APP_LOGI("SerialTaskDispatcher::OnTaskDone start"); + HILOG_INFO("SerialTaskDispatcher::OnTaskDone start"); bool isExhausted = workingTasks_.Empty(); DoNext(isExhausted); - APP_LOGI("SerialTaskDispatcher::OnTaskDone end"); + HILOG_INFO("SerialTaskDispatcher::OnTaskDone end"); } bool SerialTaskDispatcher::Schedule() { bool init = false; if (!running_.compare_exchange_strong(init, true)) { - APP_LOGW("SerialTaskDispatcher::schedule already running"); + HILOG_WARN("SerialTaskDispatcher::schedule already running"); return false; } - APP_LOGI("SerialTaskDispatcher::Schedule do next"); + HILOG_INFO("SerialTaskDispatcher::Schedule do next"); return DoNext(false); } bool SerialTaskDispatcher::DoNext(bool isExhausted) { - APP_LOGI("SerialTaskDispatcher::DoNext start"); + HILOG_INFO("SerialTaskDispatcher::DoNext start"); std::shared_ptr nextptr = nullptr; { std::unique_lock lock(mutex_); nextptr = workingTasks_.Poll(); if (nextptr == nullptr) { running_.store(false); - APP_LOGW("SerialTaskDispatcher::DoNext no more task"); + HILOG_WARN("SerialTaskDispatcher::DoNext no more task"); return false; } } DoWork(nextptr); - APP_LOGI("SerialTaskDispatcher::DoNext end"); + HILOG_INFO("SerialTaskDispatcher::DoNext end"); return true; } void SerialTaskDispatcher::DoWork(std::shared_ptr &task) { - APP_LOGI("SerialTaskDispatcher::DoWork called."); + HILOG_INFO("SerialTaskDispatcher::DoWork called."); // |task| mustn't be null executor_->Execute(task); } diff --git a/common/task_dispatcher/src/dispatcher/spec_task_dispatcher.cpp b/common/task_dispatcher/src/dispatcher/spec_task_dispatcher.cpp index e6e176164b..63fe1a334d 100644 --- a/common/task_dispatcher/src/dispatcher/spec_task_dispatcher.cpp +++ b/common/task_dispatcher/src/dispatcher/spec_task_dispatcher.cpp @@ -31,74 +31,74 @@ SpecTaskDispatcher::SpecTaskDispatcher( ErrCode SpecTaskDispatcher::SyncDispatch(const std::shared_ptr &runnable) { - APP_LOGI("SpecTaskDispatcher::SyncDispatch start"); + HILOG_INFO("SpecTaskDispatcher::SyncDispatch start"); if (handler_ == nullptr) { - APP_LOGE("SpecTaskDispatcher::SyncDispatch handler is nullptr"); + HILOG_ERROR("SpecTaskDispatcher::SyncDispatch handler is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } if (Check(runnable) != ERR_OK) { - APP_LOGE("SpecTaskDispatcher::SyncDispatch check failed"); + HILOG_ERROR("SpecTaskDispatcher::SyncDispatch check failed"); return ERR_APPEXECFWK_CHECK_FAILED; } std::shared_ptr innerTask = std::make_shared(runnable, GetPriority(), shared_from_this()); if (innerTask == nullptr) { - APP_LOGE("SpecTaskDispatcher::SyncDispatch innerTask is nullptr"); + HILOG_ERROR("SpecTaskDispatcher::SyncDispatch innerTask is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } TracePointBeforePost(innerTask, false, SYNC_DISPATCHER_TAG); - APP_LOGI("SpecTaskDispatcher::SyncDispatch into new sync task"); + HILOG_INFO("SpecTaskDispatcher::SyncDispatch into new sync task"); handler_->DispatchSync(runnable); TracePointAfterPost(innerTask, false, DISPATCHER_TAG); - APP_LOGI("SpecTaskDispatcher::SyncDispatch end"); + HILOG_INFO("SpecTaskDispatcher::SyncDispatch end"); return ERR_OK; } std::shared_ptr SpecTaskDispatcher::AsyncDispatch(const std::shared_ptr &runnable) { - APP_LOGI("SpecTaskDispatcher::AsyncDispatch start"); + HILOG_INFO("SpecTaskDispatcher::AsyncDispatch start"); if (handler_ == nullptr) { - APP_LOGE("SpecTaskDispatcher::AsyncDispatch handler is nullptr"); + HILOG_ERROR("SpecTaskDispatcher::AsyncDispatch handler is nullptr"); return nullptr; } if (Check(runnable) != ERR_OK) { - APP_LOGE("SpecTaskDispatcher::AsyncDispatch check failed"); + HILOG_ERROR("SpecTaskDispatcher::AsyncDispatch check failed"); return nullptr; } std::shared_ptr innerTask = std::make_shared(runnable, GetPriority(), shared_from_this()); if (innerTask == nullptr) { - APP_LOGE("SpecTaskDispatcher::AsyncDispatch innerTask is nullptr"); + HILOG_ERROR("SpecTaskDispatcher::AsyncDispatch innerTask is nullptr"); return nullptr; } TracePointBeforePost(innerTask, true, ASYNC_DISPATCHER_TAG); - APP_LOGI("SpecTaskDispatcher::AsyncDispatch into new async task"); + HILOG_INFO("SpecTaskDispatcher::AsyncDispatch into new async task"); handler_->Dispatch(runnable); - APP_LOGI("SpecTaskDispatcher::AsyncDispatch end"); + HILOG_INFO("SpecTaskDispatcher::AsyncDispatch end"); return innerTask; } std::shared_ptr SpecTaskDispatcher::DelayDispatch(const std::shared_ptr &runnable, long delayMs) { - APP_LOGI("SpecTaskDispatcher::DelayDispatch start"); + HILOG_INFO("SpecTaskDispatcher::DelayDispatch start"); if (handler_ == nullptr) { - APP_LOGE("SpecTaskDispatcher::DelayDispatch handler is nullptr"); + HILOG_ERROR("SpecTaskDispatcher::DelayDispatch handler is nullptr"); return nullptr; } if (Check(runnable) != ERR_OK) { - APP_LOGE("SpecTaskDispatcher::DelayDispatch check failed"); + HILOG_ERROR("SpecTaskDispatcher::DelayDispatch check failed"); return nullptr; } std::shared_ptr innerTask = std::make_shared(runnable, GetPriority(), shared_from_this()); if (innerTask == nullptr) { - APP_LOGE("SpecTaskDispatcher::DelayDispatch innerTask is nullptr"); + HILOG_ERROR("SpecTaskDispatcher::DelayDispatch innerTask is nullptr"); return nullptr; } TracePointBeforePost(innerTask, true, DELAY_DISPATCHER_TAG); handler_->Dispatch(runnable, delayMs); - APP_LOGI("SpecTaskDispatcher::DelayDispatch end"); + HILOG_INFO("SpecTaskDispatcher::DelayDispatch end"); return innerTask; } } // namespace AppExecFwk diff --git a/common/task_dispatcher/src/dispatcher/task_dispatcher_context.cpp b/common/task_dispatcher/src/dispatcher/task_dispatcher_context.cpp index b72fe3bd27..528180e67c 100644 --- a/common/task_dispatcher/src/dispatcher/task_dispatcher_context.cpp +++ b/common/task_dispatcher/src/dispatcher/task_dispatcher_context.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "task_dispatcher_context.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -22,7 +22,7 @@ TaskDispatcherContext::TaskDispatcherContext() globalDispatchers_.resize(PRIORITY_COUNT); config_ = std::make_shared(); if (config_ == nullptr) { - APP_LOGE("TaskDispatcherContext::TaskDispatcherContext config is nullptr"); + HILOG_ERROR("TaskDispatcherContext::TaskDispatcherContext config is nullptr"); executor_ = nullptr; } else { executor_ = std::make_shared(config_); @@ -41,10 +41,10 @@ TaskDispatcherContext::TaskDispatcherContext(const std::shared_ptr TaskDispatcherContext::~TaskDispatcherContext() { if (executor_) { - APP_LOGI("TaskDispatcherContext::~TaskDispatcherContext() terminate"); + HILOG_INFO("TaskDispatcherContext::~TaskDispatcherContext() terminate"); executor_->Terminate(false); } - APP_LOGI("TaskDispatcherContext::~TaskDispatcherContext end"); + HILOG_INFO("TaskDispatcherContext::~TaskDispatcherContext end"); } std::shared_ptr TaskDispatcherContext::GetWorkerPoolConfig() const @@ -54,67 +54,67 @@ std::shared_ptr TaskDispatcherContext::GetWorkerPoolConfig() c std::map TaskDispatcherContext::GetWorkerThreadsInfo() const { - APP_LOGI("TaskDispatcherContext::GetWorkerThreadsInfo called"); + HILOG_INFO("TaskDispatcherContext::GetWorkerThreadsInfo called"); if (executor_ != nullptr) { return executor_->GetWorkerThreadsInfo(); } std::map map; - APP_LOGE("TaskDispatcherContext::GetWorkerThreadsInfo executor is nullptr"); + HILOG_ERROR("TaskDispatcherContext::GetWorkerThreadsInfo executor is nullptr"); return map; } std::map, std::string> TaskDispatcherContext::GetSerialDispatchers() const { - APP_LOGI("TaskDispatcherContext::GetSerialDispatchers called"); + HILOG_INFO("TaskDispatcherContext::GetSerialDispatchers called"); return serialDispatchers_; } int TaskDispatcherContext::GetWaitingTasksCount() const { - APP_LOGI("TaskDispatcherContext::GetWaitingTasksCount called"); + HILOG_INFO("TaskDispatcherContext::GetWaitingTasksCount called"); if (executor_ != nullptr) { return executor_->GetPendingTasksSize(); } - APP_LOGE("TaskDispatcherContext::GetWaitingTasksCount executor is nullptr"); + HILOG_ERROR("TaskDispatcherContext::GetWaitingTasksCount executor is nullptr"); return 0; } long TaskDispatcherContext::GetTaskCounter() const { - APP_LOGI("TaskDispatcherContext::GetTaskCounter called"); + HILOG_INFO("TaskDispatcherContext::GetTaskCounter called"); if (executor_ != nullptr) { return executor_->GetTaskCounter(); } - APP_LOGE("TaskDispatcherContext::GetTaskCounter executor is nullptr"); + HILOG_ERROR("TaskDispatcherContext::GetTaskCounter executor is nullptr"); return 0; } std::shared_ptr TaskDispatcherContext::CreateSerialDispatcher( const std::string &name, TaskPriority priority) { - APP_LOGI("TaskDispatcherContext::CreateSerialDispatcher start"); + HILOG_INFO("TaskDispatcherContext::CreateSerialDispatcher start"); if (executor_ == nullptr) { - APP_LOGE("TaskDispatcherContext::CreateSerialDispatcher executor is nullptr"); + HILOG_ERROR("TaskDispatcherContext::CreateSerialDispatcher executor is nullptr"); return nullptr; } std::shared_ptr serialDispatcher = std::make_shared(name, priority, executor_); serialDispatchers_.insert(std::pair, std::string>(serialDispatcher, name)); - APP_LOGI("TaskDispatcherContext::CreateSerialDispatcher end"); + HILOG_INFO("TaskDispatcherContext::CreateSerialDispatcher end"); return serialDispatcher; } std::shared_ptr TaskDispatcherContext::CreateParallelDispatcher( const std::string &name, TaskPriority priority) { - APP_LOGI("TaskDispatcherContext::CreateParallelDispatcher start"); + HILOG_INFO("TaskDispatcherContext::CreateParallelDispatcher start"); if (executor_ == nullptr) { - APP_LOGE("TaskDispatcherContext::CreateParallelDispatcher executor is nullptr"); + HILOG_ERROR("TaskDispatcherContext::CreateParallelDispatcher executor is nullptr"); return nullptr; } std::shared_ptr parallelTaskDispatcher = std::make_shared(name, priority, executor_); - APP_LOGI("TaskDispatcherContext::CreateParallelDispatcher end"); + HILOG_INFO("TaskDispatcherContext::CreateParallelDispatcher end"); return parallelTaskDispatcher; } @@ -130,42 +130,42 @@ int TaskDispatcherContext::MapPriorityIndex(TaskPriority priority) const default: return DEFAULT_PRIORITY_INDEX; } - APP_LOGE("TaskDispatcherContext.mapPriorityIndex unhandled priority=%{public}d", priority); + HILOG_ERROR("TaskDispatcherContext.mapPriorityIndex unhandled priority=%{public}d", priority); return DEFAULT_PRIORITY_INDEX; } std::shared_ptr TaskDispatcherContext::GetGlobalTaskDispatcher(TaskPriority priority) { - APP_LOGI("TaskDispatcherContext::GetGlobalTaskDispatcher start"); + HILOG_INFO("TaskDispatcherContext::GetGlobalTaskDispatcher start"); std::unique_lock lock(mtx_); int index = MapPriorityIndex(priority); std::shared_ptr dispatcher = globalDispatchers_[index]; if (dispatcher == nullptr) { - APP_LOGI("TaskDispatcherContext::GetGlobalTaskDispatcher dispatcher is nullptr "); + HILOG_INFO("TaskDispatcherContext::GetGlobalTaskDispatcher dispatcher is nullptr "); if (executor_ == nullptr) { - APP_LOGE("TaskDispatcherContext::GetGlobalTaskDispatcher executor_ is nullptr "); + HILOG_ERROR("TaskDispatcherContext::GetGlobalTaskDispatcher executor_ is nullptr "); return nullptr; } dispatcher = std::make_shared(priority, executor_); if (globalDispatchers_[index] == nullptr) { - APP_LOGI("TaskDispatcherContext::GetGlobalTaskDispatcher dispatcher compareAndSet "); + HILOG_INFO("TaskDispatcherContext::GetGlobalTaskDispatcher dispatcher compareAndSet "); globalDispatchers_.insert((globalDispatchers_.begin() + index), dispatcher); } } - APP_LOGI("TaskDispatcherContext::GetGlobalTaskDispatcher end"); + HILOG_INFO("TaskDispatcherContext::GetGlobalTaskDispatcher end"); return dispatcher; } ErrCode TaskDispatcherContext::Shutdown(bool force) { - APP_LOGI("TaskDispatcherContext::Shutdown start"); + HILOG_INFO("TaskDispatcherContext::Shutdown start"); if (executor_ == nullptr) { - APP_LOGE("TaskDispatcherContext::Shutdown executor_ is nullptr"); + HILOG_ERROR("TaskDispatcherContext::Shutdown executor_ is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } executor_->Terminate(force); - APP_LOGI("TaskDispatcherContext::Shutdown end"); + HILOG_INFO("TaskDispatcherContext::Shutdown end"); return ERR_OK; } } // namespace AppExecFwk diff --git a/common/task_dispatcher/src/task/barrier_handler.cpp b/common/task_dispatcher/src/task/barrier_handler.cpp index 7c773dafad..971b042e40 100644 --- a/common/task_dispatcher/src/task/barrier_handler.cpp +++ b/common/task_dispatcher/src/task/barrier_handler.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "barrier_handler.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -24,9 +24,9 @@ BarrierHandler::BarrierHandler(const std::shared_ptr &executor) ErrCode BarrierHandler::AddBarrier(std::shared_ptr &barrierTask) { - APP_LOGI("BarrierHandler::AddBarrier start"); + HILOG_INFO("BarrierHandler::AddBarrier start"); if (ListenToTask(barrierTask) != ERR_OK) { - APP_LOGE("BarrierHandler::AddBarrier listenToTask failed"); + HILOG_ERROR("BarrierHandler::AddBarrier listenToTask failed"); return ERR_APPEXECFWK_CHECK_FAILED; }; @@ -36,66 +36,66 @@ ErrCode BarrierHandler::AddBarrier(std::shared_ptr &barrierTask) std::shared_ptr pair = barrierQueue_.size() == 0 ? nullptr : barrierQueue_.back(); if ((pair == nullptr) || ((!HasTask(pair->tasks_)) && (pair->barrier_ == nullptr))) { execNow = true; - APP_LOGI("BarrierHandler::AddBarrier need execute now"); + HILOG_INFO("BarrierHandler::AddBarrier need execute now"); } if ((pair == nullptr) || (pair->barrier_ != nullptr)) { std::set> tmp; std::shared_ptr barrierPair = std::make_shared(tmp, barrierTask); if (barrierPair == nullptr) { - APP_LOGE("BarrierHandler::AddBarrier barrierPair is nullptr"); + HILOG_ERROR("BarrierHandler::AddBarrier barrierPair is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } barrierQueue_.push_back(barrierPair); - APP_LOGI("BarrierHandler::AddBarrier barrierQueue push barrierPair"); + HILOG_INFO("BarrierHandler::AddBarrier barrierQueue push barrierPair"); } else { pair->barrier_ = barrierTask; } } if (execNow) { - APP_LOGI("BarrierHandler::AddBarrier execute task"); + HILOG_INFO("BarrierHandler::AddBarrier execute task"); executor_->Execute(barrierTask); } - APP_LOGI("BarrierHandler::AddBarrier end"); + HILOG_INFO("BarrierHandler::AddBarrier end"); return ERR_OK; } ErrCode BarrierHandler::Intercept(std::shared_ptr &task) { - APP_LOGI("BarrierHandler::Intercept start"); + HILOG_INFO("BarrierHandler::Intercept start"); if (ListenToTask(task) != ERR_OK) { - APP_LOGE("BarrierHandler::Intercept listenToTask failed"); + HILOG_ERROR("BarrierHandler::Intercept listenToTask failed"); return ERR_APPEXECFWK_CHECK_FAILED; }; // afterBarrier means is intercepted. bool intercepted = AddTaskAfterBarrier(task); if (intercepted) { - APP_LOGI("BarrierHandler::Intercept intercepted a task."); + HILOG_INFO("BarrierHandler::Intercept intercepted a task."); } ErrCode result = intercepted ? ERR_APPEXECFWK_INTERCEPT_TASK_EXECUTE_SUCCESS : ERR_APPEXECFWK_CHECK_FAILED; - APP_LOGI("BarrierHandler::Intercept end, result:%{public}d", result); + HILOG_INFO("BarrierHandler::Intercept end, result:%{public}d", result); return result; } ErrCode BarrierHandler::ListenToTask(std::shared_ptr &task) { - APP_LOGI("BarrierHandler::ListenToTask start"); + HILOG_INFO("BarrierHandler::ListenToTask start"); std::shared_ptr ptrlistener = std::make_shared(); if (ptrlistener == nullptr) { - APP_LOGE("BarrierHandler::listenToTask make shared MyTaskListener is nullptr"); + HILOG_ERROR("BarrierHandler::listenToTask make shared MyTaskListener is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } const std::function onTaskDone = std::bind(&BarrierHandler::OnTaskDone, this, task); ptrlistener->Callback(onTaskDone); task->AddTaskListener(ptrlistener); - APP_LOGI("BarrierHandler::ListenToTask end"); + HILOG_INFO("BarrierHandler::ListenToTask end"); return ERR_OK; } void BarrierHandler::OnTaskDone(std::shared_ptr &task) { - APP_LOGI("BarrierHandler::OnTaskDone start"); + HILOG_INFO("BarrierHandler::OnTaskDone start"); // remove from head of queue. // Under the premise that task cannot be reused. bool removed = false; @@ -106,11 +106,11 @@ void BarrierHandler::OnTaskDone(std::shared_ptr &task) if (HasTask(barrierPair->tasks_)) { removed = barrierPair->tasks_.erase(task) == 0 ? false : true; if (barrierPair->tasks_.empty() && (barrierPair->barrier_ != nullptr)) { - APP_LOGI("Barrier.onTaskDone execute barrier task after task done."); + HILOG_INFO("Barrier.onTaskDone execute barrier task after task done."); executor_->Execute(barrierPair->barrier_); } } else if (task == (barrierPair->barrier_)) { - APP_LOGI("Barrier.onTaskDone remove a barrier."); + HILOG_INFO("Barrier.onTaskDone remove a barrier."); barrierPair->barrier_ = nullptr; removed = true; // Driven to next barrier. @@ -125,10 +125,10 @@ void BarrierHandler::OnTaskDone(std::shared_ptr &task) executor_->Execute(*it); } } else if (nextPair->barrier_ != nullptr) { - APP_LOGI("Barrier.onTaskDone execute barrier task after barrier done."); + HILOG_INFO("Barrier.onTaskDone execute barrier task after barrier done."); executor_->Execute(nextPair->barrier_); } else { - APP_LOGW("Barrier.onTaskDone: Detected an empty node."); + HILOG_WARN("Barrier.onTaskDone: Detected an empty node."); } } } @@ -136,20 +136,20 @@ void BarrierHandler::OnTaskDone(std::shared_ptr &task) } if (!removed) { - APP_LOGI("Barrier.onTaskDone: Task remove failed."); + HILOG_INFO("Barrier.onTaskDone: Task remove failed."); } - APP_LOGI("BarrierHandler::OnTaskDone end"); + HILOG_INFO("BarrierHandler::OnTaskDone end"); } bool BarrierHandler::AddTaskAfterBarrier(std::shared_ptr &task) { - APP_LOGI("BarrierHandler::AddTaskAfterBarrier start"); + HILOG_INFO("BarrierHandler::AddTaskAfterBarrier start"); std::unique_lock lock(barrierLock_); std::shared_ptr pair = barrierQueue_.size() == 0 ? nullptr : barrierQueue_.back(); if ((pair == nullptr) || (pair->barrier_ != nullptr)) { std::shared_ptr tmp = std::make_shared(CreateTaskSet(task), nullptr); if (tmp == nullptr) { - APP_LOGE("BarrierHandler::addTaskAfterBarrier make shared BarrierPair is nullptr"); + HILOG_ERROR("BarrierHandler::addTaskAfterBarrier make shared BarrierPair is nullptr"); return false; } @@ -159,7 +159,7 @@ bool BarrierHandler::AddTaskAfterBarrier(std::shared_ptr &task) } else { pair->tasks_.insert(task); } - APP_LOGI("BarrierHandler::AddTaskAfterBarrier end"); + HILOG_INFO("BarrierHandler::AddTaskAfterBarrier end"); return (barrierQueue_.size() > 1); } diff --git a/common/task_dispatcher/src/task/sync_task.cpp b/common/task_dispatcher/src/task/sync_task.cpp index a551df0e43..e2c12b62e4 100644 --- a/common/task_dispatcher/src/task/sync_task.cpp +++ b/common/task_dispatcher/src/task/sync_task.cpp @@ -37,26 +37,26 @@ void SyncTask::Run() { std::unique_lock lock(mutex_); auto threadId = std::this_thread::get_id(); - APP_LOGI("SyncTask::Run begin thread=%{public}zu", CalculateHashCode(threadId)); + HILOG_INFO("SyncTask::Run begin thread=%{public}zu", CalculateHashCode(threadId)); Task::Run(); executed_.store(true); // |waitTask| may have been multi invoked. condition_variable_.notify_all(); - APP_LOGI("SyncTask::Run end thread=%{public}zu", CalculateHashCode(threadId)); + HILOG_INFO("SyncTask::Run end thread=%{public}zu", CalculateHashCode(threadId)); } void SyncTask::WaitTask() { auto threadId = std::this_thread::get_id(); - APP_LOGI("SyncTask::WaitTask begin thread=%{public}zu", CalculateHashCode(threadId)); + HILOG_INFO("SyncTask::WaitTask begin thread=%{public}zu", CalculateHashCode(threadId)); std::unique_lock lock(mutex_); while (executed_ == false) { condition_variable_.wait(lock); } - APP_LOGI("SyncTask::WaitTask end thread=%{public}zu", CalculateHashCode(threadId)); + HILOG_INFO("SyncTask::WaitTask end thread=%{public}zu", CalculateHashCode(threadId)); } } // namespace AppExecFwk diff --git a/common/task_dispatcher/src/task/task.cpp b/common/task_dispatcher/src/task/task.cpp index e283f535a8..d14616124d 100644 --- a/common/task_dispatcher/src/task/task.cpp +++ b/common/task_dispatcher/src/task/task.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "task.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { /** @@ -30,7 +30,7 @@ Task::Task(const std::shared_ptr &runnable, const TaskPriority priorit priority_ = priority; baseTaskDispatcher_ = baseTaskDispatcher; std::atomic_init(&state_, 0U); - APP_LOGI("Task::Task init listener count=%{public}zu", taskListeners_.Size()); + HILOG_INFO("Task::Task init listener count=%{public}zu", taskListeners_.Size()); } Task::~Task() {} @@ -42,17 +42,17 @@ Task::~Task() */ void Task::Run() { - APP_LOGI("Task::Run task run called start"); + HILOG_INFO("Task::Run task run called start"); if (runnable_ == nullptr) { - APP_LOGI("Task::Run called runnable_ is null"); + HILOG_INFO("Task::Run called runnable_ is null"); return; } // Task cannot be reused. if (EnterExecute()) { - APP_LOGI("Task::Run runnable_ Run called start"); + HILOG_INFO("Task::Run runnable_ Run called start"); (*runnable_.get())(); } - APP_LOGI("Task::Run runnable_ Run called end"); + HILOG_INFO("Task::Run runnable_ Run called end"); } /** @@ -94,11 +94,11 @@ long Task::GetSequence() const bool Task::Revoke() { if (runnable_ == nullptr) { - APP_LOGE("Task.Revoke called runnable_ is null"); + HILOG_ERROR("Task.Revoke called runnable_ is null"); return false; } RevokeResult result = SetRevoked(); - APP_LOGI("Task.Revoke result: %{public}u", result); + HILOG_INFO("Task.Revoke result: %{public}u", result); if (result == SUCCESS) { OnTaskCanceled(); } @@ -112,7 +112,7 @@ bool Task::Revoke() */ void Task::AddTaskListener(const std::shared_ptr &listener) { - APP_LOGI("Task.AddTaskListener listener called start"); + HILOG_INFO("Task.AddTaskListener listener called start"); taskListeners_.Offer(listener); } @@ -136,7 +136,7 @@ void Task::BeforeTaskExecute() void Task::AfterTaskExecute() { if ((state_ & EXECUTED) == EXECUTED) { - APP_LOGI("Task.AfterTaskExecute taskStage called AFTER_EXECUTE"); + HILOG_INFO("Task.AfterTaskExecute taskStage called AFTER_EXECUTE"); ConcurrentQueueStatusUpdate(TaskStage::AFTER_EXECUTE); } } @@ -148,7 +148,7 @@ void Task::AfterTaskExecute() */ void Task::OnTaskCanceled() { - APP_LOGI("Task.OnTaskCanceled taskStage called REVOKED"); + HILOG_INFO("Task.OnTaskCanceled taskStage called REVOKED"); ConcurrentQueueStatusUpdate(TaskStage::REVOKED); } @@ -165,11 +165,11 @@ bool Task::EnterExecute() if ((state_ & stateNotIn) == 0) { // Not executed or revoked if (state_.compare_exchange_strong(value, EXECUTED)) { - APP_LOGI("Task.EnterExecute return success"); + HILOG_INFO("Task.EnterExecute return success"); return true; } } else { - APP_LOGE("Task.EnterExecute return fail, state=%{public}d, stateNotIn=%{public}d", value, stateNotIn); + HILOG_ERROR("Task.EnterExecute return fail, state=%{public}d, stateNotIn=%{public}d", value, stateNotIn); return false; } } @@ -180,16 +180,16 @@ Task::RevokeResult Task::SetRevoked() while (true) { unsigned int value = state_.load(); if ((value & REVOKED) == REVOKED) { - APP_LOGW("Task.SetRevoked return ALREADY_REVOKED"); + HILOG_WARN("Task.SetRevoked return ALREADY_REVOKED"); return ALREADY_REVOKED; } if ((value & EXECUTED) == 0) { if (state_.compare_exchange_strong(value, REVOKED)) { - APP_LOGI("Task.SetRevoked return SUCCESS"); + HILOG_INFO("Task.SetRevoked return SUCCESS"); return SUCCESS; } } else { - APP_LOGE("Task.SetRevoked return FAIL"); + HILOG_ERROR("Task.SetRevoked return FAIL"); return FAIL; } } @@ -197,7 +197,7 @@ Task::RevokeResult Task::SetRevoked() void Task::ConcurrentQueueStatusUpdate(const TaskStage::TASKSTAGE taskstage) { - APP_LOGI("Task.ConcurrentQueueStatusUpdate taskListeners_ called start"); + HILOG_INFO("Task.ConcurrentQueueStatusUpdate taskListeners_ called start"); for (auto iter = taskListeners_.Begin(); iter != taskListeners_.End(); iter++) { (*iter)->OnChanged(taskstage); } diff --git a/common/task_dispatcher/src/threading/default_thread_factory.cpp b/common/task_dispatcher/src/threading/default_thread_factory.cpp index aeee13514b..0e8eedaa47 100644 --- a/common/task_dispatcher/src/threading/default_thread_factory.cpp +++ b/common/task_dispatcher/src/threading/default_thread_factory.cpp @@ -27,9 +27,9 @@ std::shared_ptr DefaultThreadFactory::Create() int value = std::atomic_fetch_add(&index_, 1); std::string name = std::string("PoolThread-") + std::to_string(value); pThread->thread_name_ = name; - APP_LOGI("DefaultThreadFactory::Create thread name is %{public}s", name.c_str()); + HILOG_INFO("DefaultThreadFactory::Create thread name is %{public}s", name.c_str()); } else { - APP_LOGE("DefaultThreadFactory::Create error, thread is nullptr"); + HILOG_ERROR("DefaultThreadFactory::Create error, thread is nullptr"); } return pThread; diff --git a/common/task_dispatcher/src/threading/task_executor.cpp b/common/task_dispatcher/src/threading/task_executor.cpp index dcfb83f88c..408615696e 100644 --- a/common/task_dispatcher/src/threading/task_executor.cpp +++ b/common/task_dispatcher/src/threading/task_executor.cpp @@ -14,7 +14,7 @@ */ #include "task_executor.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -30,15 +30,15 @@ TaskExecutor::TaskExecutor(const std::shared_ptr &config) : Wo TaskExecutor::~TaskExecutor() { if ((consumer_) && consumer_->joinable()) { - APP_LOGI("TaskExecutor::~TaskExecutor consumer is running"); + HILOG_INFO("TaskExecutor::~TaskExecutor consumer is running"); consumer_->join(); } - APP_LOGI("TaskExecutor::~TaskExecutor"); + HILOG_INFO("TaskExecutor::~TaskExecutor"); } void TaskExecutor::Execute(const std::shared_ptr &task) { - APP_LOGI("TaskExecutor::Execute begin"); + HILOG_INFO("TaskExecutor::Execute begin"); task->SetSequence(GetAndIncrement(sequence)); std::shared_ptr executor = shared_from_this(); @@ -47,21 +47,21 @@ void TaskExecutor::Execute(const std::shared_ptr &task) std::shared_ptr priorityTaskWrapper = std::make_shared(task->GetPriority(), task); if (pendingTasks_->Offer(priorityTaskWrapper) == false) { - APP_LOGW("TaskExecutor::Execute rejected a task"); + HILOG_WARN("TaskExecutor::Execute rejected a task"); } } - APP_LOGI("TaskExecutor::Execute end"); + HILOG_INFO("TaskExecutor::Execute end"); } ErrCode TaskExecutor::DoWorks(const std::shared_ptr &worker) { - APP_LOGI("TaskExecutor::DoWorks begin"); + HILOG_INFO("TaskExecutor::DoWorks begin"); if (worker == nullptr) { - APP_LOGE("TaskExecutor::DoWorks worker is nullptr"); + HILOG_ERROR("TaskExecutor::DoWorks worker is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } if (worker->GetThread() == nullptr) { - APP_LOGE("TaskExecutor::DoWorks worker GetThread is nullptr"); + HILOG_ERROR("TaskExecutor::DoWorks worker GetThread is nullptr"); return ERR_APPEXECFWK_CHECK_FAILED; } @@ -69,7 +69,7 @@ ErrCode TaskExecutor::DoWorks(const std::shared_ptr &worker) bool isInterrupted = false; bool done = false; while (((task != nullptr && done == false) || ((task = GetTask(worker)) != nullptr))) { - APP_LOGI("TaskExecutor::DoWorks loop tasks."); + HILOG_INFO("TaskExecutor::DoWorks loop tasks."); BeforeRun(task); @@ -84,7 +84,7 @@ ErrCode TaskExecutor::DoWorks(const std::shared_ptr &worker) done = true; } OnWorkerExit(worker, isInterrupted); - APP_LOGI("TaskExecutor::DoWorks end"); + HILOG_INFO("TaskExecutor::DoWorks end"); return ERR_OK; } std::shared_ptr TaskExecutor::GetTask(const std::shared_ptr &workerThread) @@ -95,33 +95,33 @@ std::shared_ptr TaskExecutor::GetTask(const std::shared_ptr for (;;) { if (terminated_.load() && pendingTasks_->Empty()) { - APP_LOGI("TaskExecutor::GetTask end: loop thread %{public}s is terminated", + HILOG_INFO("TaskExecutor::GetTask end: loop thread %{public}s is terminated", workerThread->GetThreadName().c_str()); DecrementThread(); return nullRunnable; } int workerCount = GetWorkCount(); - APP_LOGI("TaskExecutor::GetTask workerCount:%{public}d, GetCoreThreadCount: %{public}d", + HILOG_INFO("TaskExecutor::GetTask workerCount:%{public}d, GetCoreThreadCount: %{public}d", workerCount, GetCoreThreadCount()); bool needCheckTimeout = (workerCount > GetCoreThreadCount()); if (isTimeout && needCheckTimeout && pendingTasks_->Empty()) { - APP_LOGI("TaskExecutor::GetTask isTimeout is true"); + HILOG_INFO("TaskExecutor::GetTask isTimeout is true"); if (CompareAndDecNum(workerCount)) { - APP_LOGI("TaskExecutor::GetTask end: loop thread %{public}s is timeout", + HILOG_INFO("TaskExecutor::GetTask end: loop thread %{public}s is timeout", workerThread->GetThreadName().c_str()); return nullRunnable; } continue; } - APP_LOGI("TaskExecutor::GetTask need timeout=%{public}d", needCheckTimeout); + HILOG_INFO("TaskExecutor::GetTask need timeout=%{public}d", needCheckTimeout); std::shared_ptr next = needCheckTimeout ? pendingTasks_->Poll(GetKeepAliveTime()) : pendingTasks_->Take(); if (next != nullptr && next->task_ != nullptr) { - APP_LOGI("TaskExecutor::GetTask end: loop thread %{public}s get next task", + HILOG_INFO("TaskExecutor::GetTask end: loop thread %{public}s get next task", workerThread->GetThreadName().c_str()); return next->task_; } @@ -131,10 +131,10 @@ std::shared_ptr TaskExecutor::GetTask(const std::shared_ptr void TaskExecutor::Terminate(bool force) { - APP_LOGI("TaskExecutor::Terminate begin"); + HILOG_INFO("TaskExecutor::Terminate begin"); TerminateConsumer(); ClosePool(force); - APP_LOGI("TaskExecutor::Terminate end"); + HILOG_INFO("TaskExecutor::Terminate end"); } void TaskExecutor::AfterRun(const std::shared_ptr &task) @@ -151,16 +151,16 @@ bool TaskExecutor::DelayExecute(const Runnable &task, long delayMs) { if (delayMs <= 0) { task(); - APP_LOGI("TaskExecutor::DelayExecute end and delayMs less than 0"); + HILOG_INFO("TaskExecutor::DelayExecute end and delayMs less than 0"); return true; } if (terminated_.load()) { - APP_LOGI("TaskExecutor::DelayExecute end and terminate"); + HILOG_INFO("TaskExecutor::DelayExecute end and terminate"); return false; } std::shared_ptr delayTaskWrapper = std::make_shared(delayMs, task); if (delayTaskWrapper == nullptr) { - APP_LOGI("TaskExecutor::DelayExecute end and delayTaskWrapper is nullptr"); + HILOG_INFO("TaskExecutor::DelayExecute end and delayTaskWrapper is nullptr"); return false; } delayTasks_->Offer(delayTaskWrapper); @@ -190,10 +190,10 @@ bool TaskExecutor::EnsureConsumeStarted() if (consumer_ == nullptr) { consumer_ = std::make_shared(&TaskExecutor::Consume, this); if (consumer_ == nullptr) { - APP_LOGE("TaskExecutor::EnsureConsumeStarted consumer_ is nullptr"); + HILOG_ERROR("TaskExecutor::EnsureConsumeStarted consumer_ is nullptr"); return false; } - APP_LOGI("TaskExecutor::EnsureConsumeStarted start a delay task consumer"); + HILOG_INFO("TaskExecutor::EnsureConsumeStarted start a delay task consumer"); } } } @@ -204,16 +204,16 @@ void TaskExecutor::Consume() { for (;;) { if (terminated_.load() && delayTasks_->Empty()) { - APP_LOGI("TaskExecutor::Consume delay task is empty"); + HILOG_INFO("TaskExecutor::Consume delay task is empty"); break; } std::shared_ptr delayTaskWrapper = delayTasks_->Take(); if (delayTaskWrapper == nullptr || delayTaskWrapper->runnable_ == nullptr) { - APP_LOGE("TaskExecutor::Consume delayTaskWrapper is nullptr"); + HILOG_ERROR("TaskExecutor::Consume delayTaskWrapper is nullptr"); return; } (delayTaskWrapper->runnable_)(); - APP_LOGI("TaskExecutor::Consume after run"); + HILOG_INFO("TaskExecutor::Consume after run"); } } diff --git a/common/task_dispatcher/src/threading/work_thread.cpp b/common/task_dispatcher/src/threading/work_thread.cpp index 8efbd1fa57..dc049bd946 100644 --- a/common/task_dispatcher/src/threading/work_thread.cpp +++ b/common/task_dispatcher/src/threading/work_thread.cpp @@ -30,10 +30,10 @@ WorkerThread::WorkerThread(const std::shared_ptr &delegate, const std: void WorkerThread::Join() { if ((thread_) && (thread_->thread_) && thread_->thread_->joinable()) { - APP_LOGI("WorkerThread::Join joinable thread"); + HILOG_INFO("WorkerThread::Join joinable thread"); thread_->thread_->join(); } - APP_LOGI("WorkerThread::Join end"); + HILOG_INFO("WorkerThread::Join end"); } void WorkerThread::CreateThread() @@ -48,7 +48,7 @@ void WorkerThread::CreateThread() // start a thread to run task function. thread_->thread_ = std::make_shared(task); - APP_LOGI("WorkerThread::CreateThread start thread. "); + HILOG_INFO("WorkerThread::CreateThread start thread. "); } void WorkerThread::IncTaskCount() diff --git a/common/task_dispatcher/src/threading/worker_pool.cpp b/common/task_dispatcher/src/threading/worker_pool.cpp index 255b8a6ece..7a9672fc29 100644 --- a/common/task_dispatcher/src/threading/worker_pool.cpp +++ b/common/task_dispatcher/src/threading/worker_pool.cpp @@ -44,13 +44,13 @@ WorkerPool::~WorkerPool() { control_ = 0; - APP_LOGI("WorkerPool::~WorkerPool"); + HILOG_INFO("WorkerPool::~WorkerPool"); } bool WorkerPool::Init(const std::shared_ptr &config) { if (CheckConfigParams(config) == false) { - APP_LOGE("WorkerPool::checkConfigParams parameters are illegal"); + HILOG_ERROR("WorkerPool::checkConfigParams parameters are illegal"); return false; } @@ -65,7 +65,7 @@ bool WorkerPool::Init(const std::shared_ptr &config) bool WorkerPool::CheckConfigParams(const std::shared_ptr &config) { if (config == nullptr) { - APP_LOGE("WorkerPool::CheckConfigParams config is nullptr"); + HILOG_ERROR("WorkerPool::CheckConfigParams config is nullptr"); return false; } @@ -73,18 +73,18 @@ bool WorkerPool::CheckConfigParams(const std::shared_ptr &conf int coreThreadCount = config->GetCoreThreadCount(); if (!CheckThreadCount(maxThreadCount, coreThreadCount)) { - APP_LOGE("WorkerPool::CheckConfigParams parameters are illegal, maxThreadCount %{public}d is less than " + HILOG_ERROR("WorkerPool::CheckConfigParams parameters are illegal, maxThreadCount %{public}d is less than " "coreThreadCount %{public}d", maxThreadCount, coreThreadCount); return false; } if (!CheckMaxThreadCount(maxThreadCount)) { - APP_LOGE("WorkerPool::CheckConfigParams maxThreadCount %{public}d is illegal", maxThreadCount); + HILOG_ERROR("WorkerPool::CheckConfigParams maxThreadCount %{public}d is illegal", maxThreadCount); return false; } if (!CheckCoreThreadCount(coreThreadCount)) { - APP_LOGE("WorkerPool::CheckConfigParams coreThreadCount %{public}d is illegal", coreThreadCount); + HILOG_ERROR("WorkerPool::CheckConfigParams coreThreadCount %{public}d is illegal", coreThreadCount); return false; } return true; @@ -141,20 +141,20 @@ std::map WorkerPool::GetWorkerThreadsInfo(void) void WorkerPool::ClosePool(bool interrupt) { - APP_LOGI("WorkerPool::ClosePool begin interrupt=%{public}d", interrupt); + HILOG_INFO("WorkerPool::ClosePool begin interrupt=%{public}d", interrupt); std::unique_lock mLock(poolLock_); AdvanceStateTo(CLOSING); InterruptWorkers(); - APP_LOGI("WorkerPool::ClosePool end"); + HILOG_INFO("WorkerPool::ClosePool end"); } void WorkerPool::InterruptWorkers(void) { - APP_LOGI("WorkerPool::InterruptWorkers begin"); + HILOG_INFO("WorkerPool::InterruptWorkers begin"); if (guardThread_ == nullptr) { - APP_LOGE("WorkerPool::InterruptWorkers guardThread is nullptr"); + HILOG_ERROR("WorkerPool::InterruptWorkers guardThread is nullptr"); return; } poolLock_.unlock(); @@ -169,21 +169,21 @@ void WorkerPool::InterruptWorkers(void) std::unique_lock lock(exitPoolLock_); exitGuard_.wait(lock); if (guardThread_->joinable()) { - APP_LOGI("WorkerPool::InterruptWorkers guardThread_ joinable"); + HILOG_INFO("WorkerPool::InterruptWorkers guardThread_ joinable"); guardThread_->join(); // Prevent manual call again guardThread_ = nullptr; } } - APP_LOGI("WorkerPool::InterruptWorkers end"); + HILOG_INFO("WorkerPool::InterruptWorkers end"); } void WorkerPool::CreateGuardThread() { - APP_LOGI("WorkerPool::CreateGuardThread START"); + HILOG_INFO("WorkerPool::CreateGuardThread START"); if (guardThread_ != nullptr) { - APP_LOGW("WorkerPool::CreateGuardThread guardThread_ is not nullptr"); + HILOG_WARN("WorkerPool::CreateGuardThread guardThread_ is not nullptr"); return; } auto guardTask = [&]() { @@ -201,11 +201,11 @@ void WorkerPool::CreateGuardThread() } if (stop_.load() && exitPool_.empty() && pool_.empty()) { exitGuard_.notify_all(); - APP_LOGI("WorkerPool::CreateGuardThread break while"); + HILOG_INFO("WorkerPool::CreateGuardThread break while"); break; } } - APP_LOGI("WorkerPool::CreateGuardThread STOP"); + HILOG_INFO("WorkerPool::CreateGuardThread STOP"); }; guardThread_ = std::make_shared(guardTask); @@ -215,19 +215,19 @@ bool WorkerPool::AddWorker(const std::shared_ptr &delegate, const std: { bool added = false; if (!initFlag_.load()) { - APP_LOGE("WorkerPool::AddWorker workPool init failed"); + HILOG_ERROR("WorkerPool::AddWorker workPool init failed"); return added; } if (factory_ == nullptr) { - APP_LOGE("WorkerPool::AddWorker factory_ is nullptr"); + HILOG_ERROR("WorkerPool::AddWorker factory_ is nullptr"); return added; } if (task == nullptr) { - APP_LOGE("WorkerPool::AddWorker task is nullptr"); + HILOG_ERROR("WorkerPool::AddWorker task is nullptr"); return added; } if (delegate == nullptr) { - APP_LOGE("WorkerPool::AddWorker delegate is nullptr"); + HILOG_ERROR("WorkerPool::AddWorker delegate is nullptr"); return added; } std::unique_lock mLock(poolLock_); @@ -237,12 +237,12 @@ bool WorkerPool::AddWorker(const std::shared_ptr &delegate, const std: unsigned int value = control_.load(); int num = GetWorkingThreadNum(value); if (num >= thread_limit_) { - APP_LOGI("WorkerPool::AddWorker thread count exceed limits, num=%{public}d, limits=%{public}d", num, + HILOG_INFO("WorkerPool::AddWorker thread count exceed limits, num=%{public}d, limits=%{public}d", num, thread_limit_); break; } if (!IsRunning(value)) { - APP_LOGI("WorkerPool::AddWorker thread pool is not running. value=%{public}d, closing=%{public}d, " + HILOG_INFO("WorkerPool::AddWorker thread pool is not running. value=%{public}d, closing=%{public}d, " "count_bits=%{public}d", value, CLOSING, @@ -253,22 +253,22 @@ bool WorkerPool::AddWorker(const std::shared_ptr &delegate, const std: if (CompareAndIncThreadNum(num)) { newThread = std::make_shared(delegate, task, factory_); if (newThread == nullptr) { - APP_LOGE("WorkerPool::AddWorker create thread fail"); + HILOG_ERROR("WorkerPool::AddWorker create thread fail"); break; } newThread->CreateThread(); - APP_LOGI("WorkerPool::AddWorker create new thread"); + HILOG_INFO("WorkerPool::AddWorker create new thread"); pool_.emplace_back(newThread); - APP_LOGI("WorkerPool::AddWorker pool_ add thread ,POOL SIZE: %{public}zu", pool_.size()); + HILOG_INFO("WorkerPool::AddWorker pool_ add thread ,POOL SIZE: %{public}zu", pool_.size()); added = true; break; } - APP_LOGW("WorkerPool::AddWorker set thread state error. retry. "); + HILOG_WARN("WorkerPool::AddWorker set thread state error. retry. "); } return added; } @@ -276,16 +276,16 @@ bool WorkerPool::AddWorker(const std::shared_ptr &delegate, const std: void WorkerPool::OnWorkerExit(const std::shared_ptr &worker, bool isInterrupted) { std::unique_lock mLock(poolLock_); - APP_LOGI("WorkerPool::OnWorkerExit start, pool size: %{public}zu", pool_.size()); + HILOG_INFO("WorkerPool::OnWorkerExit start, pool size: %{public}zu", pool_.size()); for (auto it = pool_.begin(); it != pool_.end(); it++) { if ((*it).get() == worker.get()) { - APP_LOGI("WorkerPool::OnWorkerExit erase current, size=%{public}zu, threads=%{public}d", + HILOG_INFO("WorkerPool::OnWorkerExit erase current, size=%{public}zu, threads=%{public}d", pool_.size(), GetWorkingThreadNum(control_.load())); { std::unique_lock lock(exitPoolLock_); exitPool_.emplace_back(worker); - APP_LOGI("WorkerPool::OnWorkerExit exit notify all"); + HILOG_INFO("WorkerPool::OnWorkerExit exit notify all"); exit_.notify_all(); } pool_.erase(it); @@ -293,7 +293,7 @@ void WorkerPool::OnWorkerExit(const std::shared_ptr &worker, bool break; } } - APP_LOGI("WorkerPool::OnWorkerExit end"); + HILOG_INFO("WorkerPool::OnWorkerExit end"); } void WorkerPool::AfterRun(const std::shared_ptr &task) @@ -319,16 +319,16 @@ int WorkerPool::GetStateFromControl(unsigned int ctl) void WorkerPool::AdvanceStateTo(unsigned int target) { - APP_LOGI("WorkerPool::AdvanceStateTo begin"); + HILOG_INFO("WorkerPool::AdvanceStateTo begin"); for (;;) { unsigned int current = control_.load(); if ((current >= target) || CompareAndSet(control_, current, CombineToControl(target, GetWorkingThreadNum(current)))) { - APP_LOGI("WorkerPool::AdvanceStateTo break"); + HILOG_INFO("WorkerPool::AdvanceStateTo break"); break; } } - APP_LOGI("WorkerPool::AdvanceStateTo end"); + HILOG_INFO("WorkerPool::AdvanceStateTo end"); } int WorkerPool::CombineToControl(unsigned int state, unsigned int count) @@ -345,12 +345,12 @@ bool WorkerPool::CompareAndIncThreadNum(int expect) void WorkerPool::DecrementThread(void) { - APP_LOGI("WorkerPool::DecrementThread begin"); + HILOG_INFO("WorkerPool::DecrementThread begin"); int curr = control_.load(); while (!CompareAndDecThreadNum(curr)) { curr = control_.load(); } - APP_LOGI("WorkerPool::DecrementThread end"); + HILOG_INFO("WorkerPool::DecrementThread end"); } bool WorkerPool::CompareAndDecThreadNum(int expect) diff --git a/common/task_dispatcher/test/BUILD.gn b/common/task_dispatcher/test/BUILD.gn index d867ca4185..1c43d56c4b 100644 --- a/common/task_dispatcher/test/BUILD.gn +++ b/common/task_dispatcher/test/BUILD.gn @@ -43,6 +43,7 @@ config("dispatcher_test_config") { defines = [] include_dirs = [ + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", diff --git a/common/task_dispatcher/test/unittest/serial_task_dispatcher_test/serial_task_dispatcher_test.cpp b/common/task_dispatcher/test/unittest/serial_task_dispatcher_test/serial_task_dispatcher_test.cpp index 3afe79fe10..66d345b610 100644 --- a/common/task_dispatcher/test/unittest/serial_task_dispatcher_test/serial_task_dispatcher_test.cpp +++ b/common/task_dispatcher/test/unittest/serial_task_dispatcher_test/serial_task_dispatcher_test.cpp @@ -17,7 +17,7 @@ #define private public #include "serial_task_dispatcher.h" #undef private -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "appexecfwk_errors.h" #include "default_worker_pool_config.h" #include "task.h" diff --git a/common/task_dispatcher/test/unittest/spec_task_dispatcher_test/spec_task_dispatcher_test.cpp b/common/task_dispatcher/test/unittest/spec_task_dispatcher_test/spec_task_dispatcher_test.cpp index f55d58413f..ae7b7fad11 100644 --- a/common/task_dispatcher/test/unittest/spec_task_dispatcher_test/spec_task_dispatcher_test.cpp +++ b/common/task_dispatcher/test/unittest/spec_task_dispatcher_test/spec_task_dispatcher_test.cpp @@ -116,7 +116,7 @@ HWTEST(SpecTaskDispatcherTest, SyncDispatch_0100, Function | MediumTest | Level1 std::this_thread::sleep_for(time); int index = count.fetch_add(1); EXPECT_TRUE(index == 0); - APP_LOGD("task %{public}d end, elapsed %{public}d ms", index, sleep); + HILOG_DEBUG("task %{public}d end, elapsed %{public}d ms", index, sleep); })); EXPECT_TRUE(count.load() == 1); @@ -126,7 +126,7 @@ HWTEST(SpecTaskDispatcherTest, SyncDispatch_0100, Function | MediumTest | Level1 std::this_thread::sleep_for(time); int index = count.fetch_add(1); EXPECT_TRUE(index == 1); - APP_LOGD("task %{public}d end, elapsed %{public}d ms", index, sleep); + HILOG_DEBUG("task %{public}d end, elapsed %{public}d ms", index, sleep); })); EXPECT_TRUE(count.load() == 2); @@ -136,7 +136,7 @@ HWTEST(SpecTaskDispatcherTest, SyncDispatch_0100, Function | MediumTest | Level1 std::this_thread::sleep_for(time); int index = count.fetch_add(1); EXPECT_TRUE(index == 2); - APP_LOGD("task %{public}d end, elapsed %{public}d ms", index, sleep); + HILOG_DEBUG("task %{public}d end, elapsed %{public}d ms", index, sleep); })); EXPECT_TRUE(count.load() == 3); @@ -184,7 +184,7 @@ HWTEST(SpecTaskDispatcherTest, AsyncDispatch_0100, Function | MediumTest | Level std::this_thread::sleep_for(time); int index = count.fetch_add(1); EXPECT_TRUE(index == 0); - APP_LOGD("task %{public}d end, elapsed %{public}d ms", index, sleep); + HILOG_DEBUG("task %{public}d end, elapsed %{public}d ms", index, sleep); })); EXPECT_TRUE(count.load() == 0); @@ -194,7 +194,7 @@ HWTEST(SpecTaskDispatcherTest, AsyncDispatch_0100, Function | MediumTest | Level std::this_thread::sleep_for(time); int index = count.fetch_add(1); EXPECT_TRUE(index == 1); - APP_LOGD("task %{public}d end, elapsed %{public}d ms", index, sleep); + HILOG_DEBUG("task %{public}d end, elapsed %{public}d ms", index, sleep); })); EXPECT_TRUE(count.load() == 0); @@ -204,7 +204,7 @@ HWTEST(SpecTaskDispatcherTest, AsyncDispatch_0100, Function | MediumTest | Level std::this_thread::sleep_for(time); int index = count.fetch_add(1); EXPECT_TRUE(index == 2); - APP_LOGD("task %{public}d end, elapsed %{public}d ms", index, sleep); + HILOG_DEBUG("task %{public}d end, elapsed %{public}d ms", index, sleep); })); EXPECT_TRUE(count.load() == 0); @@ -279,7 +279,7 @@ HWTEST(SpecTaskDispatcherTest, DelayDispatch_0100, Function | MediumTest | Level // execute second int index = count.fetch_add(1); EXPECT_TRUE(index == 2); - APP_LOGD("task %{public}d end, elapsed %{public}d ms", index, sleep); + HILOG_DEBUG("task %{public}d end, elapsed %{public}d ms", index, sleep); }), sleep1); EXPECT_TRUE(count.load() == 0); @@ -289,7 +289,7 @@ HWTEST(SpecTaskDispatcherTest, DelayDispatch_0100, Function | MediumTest | Level // execute first int index = count.fetch_add(1); EXPECT_TRUE(index == 0 || index == 1); - APP_LOGD("task %{public}d end, elapsed %{public}d ms", index, sleep); + HILOG_DEBUG("task %{public}d end, elapsed %{public}d ms", index, sleep); }), sleep2); EXPECT_TRUE(count.load() == 0); @@ -299,7 +299,7 @@ HWTEST(SpecTaskDispatcherTest, DelayDispatch_0100, Function | MediumTest | Level // execute first int index = count.fetch_add(1); EXPECT_TRUE(index == 0 || index == 1); - APP_LOGD("task %{public}d end, elapsed %{public}d ms", index, sleep); + HILOG_DEBUG("task %{public}d end, elapsed %{public}d ms", index, sleep); }), sleep3); EXPECT_TRUE(count.load() == 0); diff --git a/common/task_dispatcher/test/unittest/sync_task_test/sync_task_test.cpp b/common/task_dispatcher/test/unittest/sync_task_test/sync_task_test.cpp index c030434d3f..79eea7b18f 100644 --- a/common/task_dispatcher/test/unittest/sync_task_test/sync_task_test.cpp +++ b/common/task_dispatcher/test/unittest/sync_task_test/sync_task_test.cpp @@ -17,7 +17,7 @@ #define private public #include "sync_task.h" #undef private -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "default_worker_pool_config.h" #include "task.h" #include "task_priority.h" @@ -55,7 +55,7 @@ HWTEST(SyncTaskTest, SyncTask_ConstructorTest_001, TestSize.Level0) long wait = 200; auto time = std::chrono::milliseconds(wait); std::this_thread::sleep_for(time); - APP_LOGD("task %{public}d end", 0); + HILOG_DEBUG("task %{public}d end", 0); }); auto priorityLow = TaskPriority::LOW; auto priorityHigh = TaskPriority::HIGH; @@ -90,7 +90,7 @@ HWTEST(SyncTaskTest, SyncTask_RunTest_001, TestSize.Level0) auto time = std::chrono::milliseconds(wait); std::this_thread::sleep_for(time); count++; - APP_LOGD("task %{public}d end", count.load()); + HILOG_DEBUG("task %{public}d end", count.load()); }); auto priority = TaskPriority::DEFAULT; { @@ -125,7 +125,7 @@ HWTEST(SyncTaskTest, SyncTask_WaitTest_001, TestSize.Level0) auto time = std::chrono::milliseconds(wait); std::this_thread::sleep_for(time); count++; - APP_LOGD("task %{public}d end", count.load()); + HILOG_DEBUG("task %{public}d end", count.load()); }); auto priority = TaskPriority::LOW; { diff --git a/common/task_dispatcher/test/unittest/work_thread_test/work_thread_test.cpp b/common/task_dispatcher/test/unittest/work_thread_test/work_thread_test.cpp index 3e991b6a15..9b8e9c3fbb 100644 --- a/common/task_dispatcher/test/unittest/work_thread_test/work_thread_test.cpp +++ b/common/task_dispatcher/test/unittest/work_thread_test/work_thread_test.cpp @@ -17,7 +17,7 @@ #define private public #include "work_thread.h" #undef private -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "default_thread_factory.h" #include "default_worker_pool_config.h" #include "task_priority.h" diff --git a/common/test/moduletest/task_dispatcher/BUILD.gn b/common/test/moduletest/task_dispatcher/BUILD.gn index 67aa379561..eed2757f39 100644 --- a/common/test/moduletest/task_dispatcher/BUILD.gn +++ b/common/test/moduletest/task_dispatcher/BUILD.gn @@ -20,6 +20,7 @@ config("dispatcher_mt_test_config") { defines = [] include_dirs = [ + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", diff --git a/common/test/moduletest/task_dispatcher/global_task_dispatcher_module_test/global_task_dispatcher_module_test.cpp b/common/test/moduletest/task_dispatcher/global_task_dispatcher_module_test/global_task_dispatcher_module_test.cpp index 6b5304222f..9cbc3c3285 100644 --- a/common/test/moduletest/task_dispatcher/global_task_dispatcher_module_test/global_task_dispatcher_module_test.cpp +++ b/common/test/moduletest/task_dispatcher/global_task_dispatcher_module_test/global_task_dispatcher_module_test.cpp @@ -16,7 +16,7 @@ // redefine private and protected since testcase need to invoke and test private function #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "base_task_dispatcher.h" #include "task_dispatcher.h" #include "task_dispatcher_context.h" diff --git a/common/test/moduletest/task_dispatcher/parallel_task_dispatcher_module_test/parallel_task_dispatcher_module_test.cpp b/common/test/moduletest/task_dispatcher/parallel_task_dispatcher_module_test/parallel_task_dispatcher_module_test.cpp index 2724e7393b..63a2cac60a 100644 --- a/common/test/moduletest/task_dispatcher/parallel_task_dispatcher_module_test/parallel_task_dispatcher_module_test.cpp +++ b/common/test/moduletest/task_dispatcher/parallel_task_dispatcher_module_test/parallel_task_dispatcher_module_test.cpp @@ -16,7 +16,7 @@ // redefine private and protected since testcase need to invoke and test private function #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "base_task_dispatcher.h" #include "task_dispatcher.h" #include "task_dispatcher_context.h" diff --git a/common/test/moduletest/task_dispatcher/serial_task_dispatcher_module_test/serial_task_dispatcher_module_test.cpp b/common/test/moduletest/task_dispatcher/serial_task_dispatcher_module_test/serial_task_dispatcher_module_test.cpp index ee540863f7..603077fff5 100644 --- a/common/test/moduletest/task_dispatcher/serial_task_dispatcher_module_test/serial_task_dispatcher_module_test.cpp +++ b/common/test/moduletest/task_dispatcher/serial_task_dispatcher_module_test/serial_task_dispatcher_module_test.cpp @@ -23,7 +23,7 @@ #undef private #undef protected #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" using namespace testing::ext; using namespace OHOS::AppExecFwk; diff --git a/common/test/moduletest/task_dispatcher/spec_task_dispatcher_module_test/spec_task_dispatcher_module_test.cpp b/common/test/moduletest/task_dispatcher/spec_task_dispatcher_module_test/spec_task_dispatcher_module_test.cpp index d251f276dd..528c9af9cf 100644 --- a/common/test/moduletest/task_dispatcher/spec_task_dispatcher_module_test/spec_task_dispatcher_module_test.cpp +++ b/common/test/moduletest/task_dispatcher/spec_task_dispatcher_module_test/spec_task_dispatcher_module_test.cpp @@ -15,8 +15,8 @@ // redefine private and protected since testcase need to invoke and test private function #include -#include "app_log_wrapper.h" #include "base_task_dispatcher.h" +#include "hilog_wrapper.h" #include "task_dispatcher_context.h" #include "task_dispatcher.h" #include "spec_task_dispatcher.h" diff --git a/frameworks/kits/ability/ability_runtime/BUILD.gn b/frameworks/kits/ability/ability_runtime/BUILD.gn index df3fc506d8..c6a0a6492c 100755 --- a/frameworks/kits/ability/ability_runtime/BUILD.gn +++ b/frameworks/kits/ability/ability_runtime/BUILD.gn @@ -13,7 +13,6 @@ import("//build/ohos.gni") SO_DIR = "//foundation/aafwk/standard/frameworks/kits/ability/ability_runtime" -INNERKITS_DIR = "//foundation/aafwk/standard/interfaces/innerkits" APPKIT_DIR = "//foundation/aafwk/standard/frameworks/kits" config("ability_context_public_config") { @@ -43,22 +42,20 @@ ohos_shared_library("ability_context_native") { "${SO_DIR}/src/local_call_record.cpp", ] - deps = [ - "${APPKIT_DIR}/appkit:app_context", - "${INNERKITS_DIR}/ability_manager:ability_manager", - "${INNERKITS_DIR}/want:want", - "//base/hiviewdfx/faultloggerd/interfaces/innerkits/dump_catcher:lib_dfx_dump_catcher", - "//foundation/ace/napi:ace_napi", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base", - ] + deps = [ "${APPKIT_DIR}/appkit:app_context" ] external_deps = [ + "ability_base:want", + "ability_runtime:ability_manager", "ability_runtime:app_manager", "ability_runtime:runtime", + "bundle_framework:appexecfwk_base", "bytrace_standard:bytrace_core", + "faultloggerd:lib_dfx_dump_catcher", "hichecker_native:libhichecker", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "napi:ace_napi", "utils_base:utils", ] diff --git a/frameworks/kits/ability/native/BUILD.gn b/frameworks/kits/ability/native/BUILD.gn index b902138db0..6b780f2ebb 100644 --- a/frameworks/kits/ability/native/BUILD.gn +++ b/frameworks/kits/ability/native/BUILD.gn @@ -19,34 +19,24 @@ config("ability_config") { visibility = [ ":*" ] include_dirs = [ "${INNERKITS_PATH}/base/include", - "//utils/native/base/include", "${SUBSYSTEM_DIR}/include", "//foundation/aafwk/standard/frameworks/kits/appkit/native/app/include", "//foundation/aafwk/standard/interfaces/innerkits/app_manager/include/appmgr", "//foundation/aafwk/standard/interfaces/innerkits/uri/include", - "${INNERKITS_PATH}/want/include/ohos/aafwk/content", - "${INNERKITS_PATH}/ability_manager/include", "//foundation/aafwk/standard/services/abilitymgr/include", - "//foundation/appexecfwk/standard/common/log/include", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/include/bundlemgr", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base/include/", "//foundation/aafwk/standard/interfaces/innerkits/form_manager/include", "//foundation/aafwk/standard/frameworks/kits/appkit/native/ability_runtime/app", "//foundation/aafwk/standard/frameworks/kits/appkit/native/app/include", "//foundation/aafwk/standard/frameworks/kits/fmskit/native/include", "//foundation/aafwk/standard/frameworks/kits/app/native/app/include", "//foundation/aafwk/standard/services/common/include", - "//base/global/resmgr_standard/interfaces/innerkits/include", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/featureAbility", - "//foundation/ace/napi/interfaces/kits", "//third_party/node/src", - "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", "//foundation/aafwk/standard/frameworks/kits/ability/native/include/continuation/remote_register_service", "//foundation/aafwk/standard/frameworks/kits/ability/native/include/continuation/distributed", "//foundation/aafwk/standard/frameworks/kits/ability/native/include/distributed_ability_runtime", "//foundation/aafwk/standard/interfaces/innerkits/ability_manager/include/continuation", "//foundation/aafwk/standard/frameworks/kits/ability/native/include/continuation/kits", - "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk/main/cpp/include", "//foundation/aafwk/standard/common/task_dispatcher/include/dispatcher", "//foundation/aafwk/standard/common/task_dispatcher/include/task", "//foundation/aafwk/standard/common/task_dispatcher/include/threading", @@ -61,6 +51,8 @@ config("ability_config") { defines = [ "APP_LOG_TAG = \"Ability\"", "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"Ability\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } @@ -87,6 +79,7 @@ config("ability_public_config") { "//foundation/aafwk/standard/interfaces/innerkits/form_manager/include", "//foundation/windowmanager/interfaces/innerkits/wm", "//foundation/windowmanager/interfaces/kits/napi/window_runtime/window_stage_napi", + "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base/include/", "//third_party/jsoncpp/include", "//third_party/json/include", ] @@ -104,15 +97,14 @@ ohos_shared_library("static_subscriber_ipc") { "${SUBSYSTEM_DIR}/src/static_subscriber_stub.cpp", ] - deps = [ - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//utils/native/base:utils", - ] + deps = [] external_deps = [ "ability_base:want", "ces_standard:cesfwk_innerkits", "ipc:ipc_core", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] subsystem_name = "aafwk" @@ -241,34 +233,30 @@ ohos_shared_library("abilitykit_native") { deps = [ ":static_subscriber_ipc", - "${INNERKITS_PATH}/base:base", - "${INNERKITS_PATH}/want:want", - "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk:libpermissionsdk_standard", - "//foundation/aafwk/standard/common/task_dispatcher:task_dispatcher", - "//foundation/aafwk/standard/frameworks/kits/ability/ability_runtime:ability_context_native", "//foundation/aafwk/standard/frameworks/kits/appkit:app_context", "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_delegator", - "//foundation/aafwk/standard/frameworks/kits/wantagent:wantagent_innerkits", - "//foundation/aafwk/standard/interfaces/innerkits/ability_manager:ability_manager", - "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", "//foundation/aafwk/standard/interfaces/innerkits/dataobs_manager:dataobs_manager", - "//foundation/ace/napi:ace_napi", "//foundation/appexecfwk/standard/common:libappexecfwk_common", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//foundation/multimodalinput/input/frameworks/proxy:libmmi-common", - "//foundation/resourceschedule/background_task_mgr/interfaces/innerkits:bgtaskmgr_innerkits", + + # "//foundation/multimodalinput/input/frameworks/proxy:libmmi-common", "//third_party/icu/icu4c:shared_icuuc", ] external_deps = [ + "ability_base:base", "ability_base:configuration", + "ability_base:want", "ability_base:zuri", "ability_runtime:ability_context_native", + "ability_runtime:ability_manager", "ability_runtime:app_manager", "ability_runtime:napi_base_context", "ability_runtime:runtime", + "ability_runtime:task_dispatcher", + "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", + "background_task_mgr:bgtaskmgr_innerkits", + "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "bytrace_standard:bytrace_core", "ces_standard:cesfwk_innerkits", @@ -278,9 +266,13 @@ ohos_shared_library("abilitykit_native") { "ipc:ipc_core", "ipc_js:rpc", "multimodalinput_base:libmmi-client", + "napi:ace_napi", "native_appdatamgr:native_appdatafwk", "native_appdatamgr:native_dataability", "native_appdatamgr:native_rdb", + "permission_standard:libpermissionsdk_standard", + "resmgr_standard:global_resmgr", + "samgr_standard:samgr_proxy", "utils_base:utils", ] @@ -311,14 +303,13 @@ ohos_shared_library("dummy_classes") { configs = [ ":ability_config" ] public_configs = [ ":ability_public_config" ] - deps = [ - "//foundation/appexecfwk/standard/common:libappexecfwk_common", - "//utils/native/base:utils", - ] + deps = [ "//foundation/appexecfwk/standard/common:libappexecfwk_common" ] external_deps = [ + "ability_base:want", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "utils_base:utils", ] subsystem_name = "aafwk" @@ -337,12 +328,13 @@ ohos_shared_library("service_extension_module") { deps = [ ":abilitykit_native", "//foundation/appexecfwk/standard/common:libappexecfwk_common", - "//utils/native/base:utils", ] external_deps = [ + "ability_base:want", "ability_runtime:runtime", "hiviewdfx_hilog_native:libhilog", + "utils_base:utils", ] subsystem_name = "aafwk" @@ -361,12 +353,13 @@ ohos_shared_library("datashare_ext_ability_module") { deps = [ ":abilitykit_native", "//foundation/appexecfwk/standard/common:libappexecfwk_common", - "//utils/native/base:utils", ] external_deps = [ + "ability_base:want", "ability_runtime:runtime", "hiviewdfx_hilog_native:libhilog", + "utils_base:utils", ] subsystem_name = "aafwk" diff --git a/frameworks/kits/ability/native/src/ability.cpp b/frameworks/kits/ability/native/src/ability.cpp index 746ddf9d9f..d1ad46d125 100755 --- a/frameworks/kits/ability/native/src/ability.cpp +++ b/frameworks/kits/ability/native/src/ability.cpp @@ -23,7 +23,6 @@ #include "ability_post_event_timeout.h" #include "ability_runtime/js_ability.h" #include "abs_shared_result_set.h" -#include "app_log_wrapper.h" #include "background_task_mgr_helper.h" #include "bytrace.h" #include "configuration_convertor.h" @@ -42,6 +41,7 @@ #include "form_host_client.h" #include "form_mgr.h" #include "form_provider_client.h" +#include "hilog_wrapper.h" #include "if_system_ability_manager.h" #include "ipc_skeleton.h" #include "iservice_registry.h" @@ -101,7 +101,7 @@ Ability* Ability::Create(const std::unique_ptr& runtime void Ability::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); abilityInfo_ = abilityInfo; handler_ = handler; AbilityContext::token_ = token; @@ -111,9 +111,9 @@ void Ability::Init(const std::shared_ptr &abilityInfo, const std::s if (!abilityInfo_->isStageBasedModel) { abilityWindow_ = std::make_shared(); if (abilityWindow_ != nullptr) { - APP_LOGI("%{public}s begin abilityWindow_->Init", __func__); + HILOG_INFO("%{public}s begin abilityWindow_->Init", __func__); abilityWindow_->Init(handler_, shared_from_this()); - APP_LOGI("%{public}s end abilityWindow_->Init", __func__); + HILOG_INFO("%{public}s end abilityWindow_->Init", __func__); } } continuationManager_ = std::make_shared(); @@ -127,7 +127,7 @@ void Ability::Init(const std::shared_ptr &abilityInfo, const std::s sptr Primary = sptr( new (std::nothrow) ReverseContinuationSchedulerPrimary(continuationHandler, handler_)); if (Primary == nullptr) { - APP_LOGE("Ability::Init failed,Primary create failed"); + HILOG_ERROR("Ability::Init failed,Primary create failed"); } else { continuationHandler_->SetPrimaryStub(Primary); continuationHandler_->SetAbilityInfo(abilityInfo_); @@ -135,7 +135,7 @@ void Ability::Init(const std::shared_ptr &abilityInfo, const std::s } // register displayid change callback - APP_LOGI("Ability::Init call RegisterDisplayListener"); + HILOG_INFO("Ability::Init call RegisterDisplayListener"); OHOS::sptr thisAbility(this); Rosen::DisplayManager::GetInstance().RegisterDisplayListener(thisAbility); } @@ -144,14 +144,14 @@ void Ability::Init(const std::shared_ptr &abilityInfo, const std::s if (abilityLifecycleExecutor_ != nullptr) { abilityLifecycleExecutor_->DispatchLifecycleState(AbilityLifecycleExecutor::LifecycleState::INITIAL); } else { - APP_LOGE("%{public}s abilityLifecycleExecutor_ make failed.", __func__); + HILOG_ERROR("%{public}s abilityLifecycleExecutor_ make failed.", __func__); } application_ = application; if (abilityContext_ != nullptr) { abilityContext_->RegisterAbilityCallback(weak_from_this()); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } void Ability::AttachAbilityContext(const std::shared_ptr &abilityContext) @@ -197,9 +197,9 @@ bool Ability::PrintDrawnCompleted() void Ability::OnStart(const Want &want) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (abilityInfo_ == nullptr) { - APP_LOGE("Ability::OnStart failed abilityInfo_ is nullptr."); + HILOG_ERROR("Ability::OnStart failed abilityInfo_ is nullptr."); return; } @@ -232,7 +232,7 @@ void Ability::OnStart(const Want &want) int defualtDisplayId = Rosen::WindowScene::DEFAULT_DISPLAY_ID; int displayId = want.GetIntParam(Want::PARAM_RESV_DISPLAY_ID, defualtDisplayId); - APP_LOGI("Ability::OnStart bundleName:%{public}s, abilityName:%{public}s, windowType:%{public}d, " + HILOG_INFO("Ability::OnStart bundleName:%{public}s, abilityName:%{public}s, windowType:%{public}d, " "displayId:%{public}d", abilityInfo_->bundleName.c_str(), abilityInfo_->name.c_str(), @@ -242,25 +242,25 @@ void Ability::OnStart(const Want &want) InitWindow(winType, displayId, option); if (abilityWindow_ != nullptr) { - APP_LOGI("%{public}s begin abilityWindow_->OnPostAbilityStart.", __func__); + HILOG_INFO("%{public}s begin abilityWindow_->OnPostAbilityStart.", __func__); abilityWindow_->OnPostAbilityStart(); auto window = abilityWindow_->GetWindow(); if (window) { auto windowId = window->GetWindowId(); - APP_LOGI("Ability::OnStart: add windowId = %{public}d", windowId); + HILOG_INFO("Ability::OnStart: add windowId = %{public}d", windowId); OHOS::AAFwk::AbilityManagerClient::GetInstance()->AddWindowInfo(AbilityContext::GetToken(), windowId); if (winType == Rosen::WindowType::WINDOW_TYPE_APP_MAIN_WINDOW) { - APP_LOGI("Call RegisterDisplayMoveListener, windowId: %{public}d", windowId); + HILOG_INFO("Call RegisterDisplayMoveListener, windowId: %{public}d", windowId); OHOS::sptr displayMoveListener(this); window->RegisterDisplayMoveListener(displayMoveListener); } } - APP_LOGI("%{public}s end abilityWindow_->OnPostAbilityStart.", __func__); + HILOG_INFO("%{public}s end abilityWindow_->OnPostAbilityStart.", __func__); } // Update resMgr, Configuration - APP_LOGI("%{public}s get display by displayId %{public}d.", __func__, displayId); + HILOG_INFO("%{public}s get display by displayId %{public}d.", __func__, displayId); auto display = Rosen::DisplayManager::GetInstance().GetDisplayById(displayId); if (display) { float density = display->GetVirtualPixelRatio(); @@ -277,7 +277,7 @@ void Ability::OnStart(const Want &want) std::unique_ptr resConfig(Global::Resource::CreateResConfig()); if (resConfig == nullptr) { - APP_LOGE("%{public}s error, resConfig is nullptr.", __func__); + HILOG_ERROR("%{public}s error, resConfig is nullptr.", __func__); return; } resConfig->SetScreenDensity(ConvertDensity(density)); @@ -285,14 +285,14 @@ void Ability::OnStart(const Want &want) auto resourceManager = GetResourceManager(); if (resourceManager != nullptr) { resourceManager->UpdateResConfig(*resConfig); - APP_LOGI("%{public}s Notify ResourceManager.", __func__); + HILOG_INFO("%{public}s Notify ResourceManager.", __func__); } } } SetWant(want); if (abilityLifecycleExecutor_ == nullptr) { - APP_LOGE("Ability::OnStart error. abilityLifecycleExecutor_ == nullptr."); + HILOG_ERROR("Ability::OnStart error. abilityLifecycleExecutor_ == nullptr."); return; } if (!abilityInfo_->isStageBasedModel) { @@ -302,11 +302,11 @@ void Ability::OnStart(const Want &want) } if (lifecycle_ == nullptr) { - APP_LOGE("Ability::OnStart error. lifecycle_ == nullptr."); + HILOG_ERROR("Ability::OnStart error. lifecycle_ == nullptr."); return; } lifecycle_->DispatchLifecycle(LifeCycle::Event::ON_START, want); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -318,19 +318,19 @@ void Ability::OnStart(const Want &want) void Ability::OnStop() { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (abilityLifecycleExecutor_ == nullptr) { - APP_LOGE("Ability::OnStop error. abilityLifecycleExecutor_ == nullptr."); + HILOG_ERROR("Ability::OnStop error. abilityLifecycleExecutor_ == nullptr."); return; } abilityLifecycleExecutor_->DispatchLifecycleState(AbilityLifecycleExecutor::LifecycleState::INITIAL); if (lifecycle_ == nullptr) { - APP_LOGE("Ability::OnStop error. lifecycle_ == nullptr."); + HILOG_ERROR("Ability::OnStop error. lifecycle_ == nullptr."); return; } lifecycle_->DispatchLifecycle(LifeCycle::Event::ON_STOP); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -338,7 +338,7 @@ void Ability::OnStop() */ void Ability::Destroy() { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); // Release the scene. if (scene_ != nullptr) { scene_->GoDestroy(); @@ -350,7 +350,7 @@ void Ability::Destroy() if (abilityWindow_ != nullptr && abilityInfo_->type == AppExecFwk::AbilityType::PAGE) { abilityWindow_->OnPostAbilityStop(); // Ability will been released when window destroy. } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -364,25 +364,25 @@ void Ability::Destroy() void Ability::OnActive() { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (abilityWindow_ != nullptr) { - APP_LOGI("%{public}s begin abilityWindow_->OnPostAbilityActive.", __func__); + HILOG_INFO("%{public}s begin abilityWindow_->OnPostAbilityActive.", __func__); abilityWindow_->OnPostAbilityActive(); - APP_LOGI("%{public}s end abilityWindow_->OnPostAbilityActive.", __func__); + HILOG_INFO("%{public}s end abilityWindow_->OnPostAbilityActive.", __func__); } bWindowFocus_ = true; if (abilityLifecycleExecutor_ == nullptr) { - APP_LOGE("Ability::OnActive error. abilityLifecycleExecutor_ == nullptr."); + HILOG_ERROR("Ability::OnActive error. abilityLifecycleExecutor_ == nullptr."); return; } abilityLifecycleExecutor_->DispatchLifecycleState(AbilityLifecycleExecutor::LifecycleState::ACTIVE); if (lifecycle_ == nullptr) { - APP_LOGE("Ability::OnActive error. lifecycle_ == nullptr."); + HILOG_ERROR("Ability::OnActive error. lifecycle_ == nullptr."); return; } lifecycle_->DispatchLifecycle(LifeCycle::Event::ON_ACTIVE); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -394,25 +394,25 @@ void Ability::OnActive() void Ability::OnInactive() { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (abilityWindow_ != nullptr && abilityInfo_->type == AppExecFwk::AbilityType::PAGE) { - APP_LOGI("%{public}s begin abilityWindow_->OnPostAbilityInactive.", __func__); + HILOG_INFO("%{public}s begin abilityWindow_->OnPostAbilityInactive.", __func__); abilityWindow_->OnPostAbilityInactive(); - APP_LOGI("%{public}s end abilityWindow_->OnPostAbilityInactive.", __func__); + HILOG_INFO("%{public}s end abilityWindow_->OnPostAbilityInactive.", __func__); } bWindowFocus_ = false; if (abilityLifecycleExecutor_ == nullptr) { - APP_LOGE("Ability::OnInactive error. abilityLifecycleExecutor_ == nullptr."); + HILOG_ERROR("Ability::OnInactive error. abilityLifecycleExecutor_ == nullptr."); return; } abilityLifecycleExecutor_->DispatchLifecycleState(AbilityLifecycleExecutor::LifecycleState::INACTIVE); if (lifecycle_ == nullptr) { - APP_LOGE("Ability::OnInactive error. lifecycle_ == nullptr."); + HILOG_ERROR("Ability::OnInactive error. lifecycle_ == nullptr."); return; } lifecycle_->DispatchLifecycle(LifeCycle::Event::ON_INACTIVE); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -423,7 +423,7 @@ void Ability::OnInactive() */ void Ability::OnSceneCreated() { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); } /** @@ -434,7 +434,7 @@ void Ability::OnSceneCreated() */ void Ability::OnSceneRestored() { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); } /** @@ -445,7 +445,7 @@ void Ability::OnSceneRestored() */ void Ability::onSceneDestroyed() { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); } /** @@ -458,25 +458,25 @@ void Ability::onSceneDestroyed() void Ability::OnForeground(const Want &want) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); DoOnForeground(want); DispatchLifecycleOnForeground(want); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } bool Ability::IsRestoredInContinuation() const { if (abilityContext_ == nullptr) { - APP_LOGE("abilityContext_ is null"); + HILOG_ERROR("abilityContext_ is null"); return false; } if (launchParam_.launchReason == LaunchReason::LAUNCHREASON_CONTINUATION && abilityInfo_->launchMode == LaunchMode::STANDARD && abilityContext_->GetContentStorage() != nullptr) { - APP_LOGI("Is Restored In Continuation"); + HILOG_INFO("Is Restored In Continuation"); return true; } - APP_LOGI("not Restored In Continuation"); + HILOG_INFO("not Restored In Continuation"); return false; } @@ -485,16 +485,16 @@ void Ability::WaitingDistributedObjectSyncComplete(const Want& want) int sessionId = want.GetIntParam(DMS_SESSION_ID, DEFAULT_DMS_SESSION_ID); std::string originDeviceId = want.GetStringParam(DMS_ORIGIN_DEVICE_ID); - APP_LOGI("continuation WaitingDistributedObjectSyncComplete begin"); + HILOG_INFO("continuation WaitingDistributedObjectSyncComplete begin"); auto timeout = [self = shared_from_this(), sessionId, originDeviceId]() { - APP_LOGI("DistributedObject sync timeout"); + HILOG_INFO("DistributedObject sync timeout"); self->continuationManager_->NotifyCompleteContinuation( originDeviceId, sessionId, false, nullptr); }; // std::shared_ptr handler = handler_; auto callback = [self = shared_from_this(), sessionId, originDeviceId]() { - APP_LOGI("DistributedObject sync complete"); + HILOG_INFO("DistributedObject sync complete"); if (self->handler_ != nullptr) { self->handler_->RemoveTask("Waiting_Sync_Timeout"); } @@ -503,31 +503,31 @@ void Ability::WaitingDistributedObjectSyncComplete(const Want& want) }; std::string &bundleName = abilityInfo_->bundleName; - APP_LOGI("continuation TriggerRestore begin"); + HILOG_INFO("continuation TriggerRestore begin"); ObjectStore::DistributedObjectStore::GetInstance(bundleName)->TriggerRestore(callback); - APP_LOGI("continuation TriggerRestore end"); + HILOG_INFO("continuation TriggerRestore end"); if (handler_ != nullptr) { - APP_LOGI("continuation set timeout begin"); + HILOG_INFO("continuation set timeout begin"); handler_->PostTask(timeout, "Waiting_Sync_Timeout", DISTRIBUTED_OBJECT_TIMEOUT); - APP_LOGI("continuation set timeout end"); + HILOG_INFO("continuation set timeout end"); } } void Ability::NotityContinuationResult(const Want& want, bool success) { - APP_LOGI("NotityContinuationResult begin"); + HILOG_INFO("NotityContinuationResult begin"); std::weak_ptr ReplicaHandler = continuationHandler_; reverseContinuationSchedulerReplica_ = sptr( new (std::nothrow) ReverseContinuationSchedulerReplica(handler_, ReplicaHandler)); if (reverseContinuationSchedulerReplica_ == nullptr) { - APP_LOGE("Ability::NotityContinuationComplete failed, create reverseContinuationSchedulerReplica failed"); + HILOG_ERROR("Ability::NotityContinuationComplete failed, create reverseContinuationSchedulerReplica failed"); return; } int sessionId = want.GetIntParam(DMS_SESSION_ID, DEFAULT_DMS_SESSION_ID); std::string originDeviceId = want.GetStringParam(DMS_ORIGIN_DEVICE_ID); - APP_LOGI("Ability::NotityContinuationComplete DeviceId: %{public}s", originDeviceId.c_str()); + HILOG_INFO("Ability::NotityContinuationComplete DeviceId: %{public}s", originDeviceId.c_str()); continuationManager_->NotifyCompleteContinuation( originDeviceId, sessionId, success, reverseContinuationSchedulerReplica_); } @@ -542,29 +542,29 @@ void Ability::NotityContinuationResult(const Want& want, bool success) void Ability::OnBackground() { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (abilityInfo_->type == AppExecFwk::AbilityType::PAGE) { - APP_LOGI("%{public}s begin OnPostAbilityBackground.", __func__); + HILOG_INFO("%{public}s begin OnPostAbilityBackground.", __func__); if (abilityInfo_->isStageBasedModel) { if (scene_ == nullptr) { - APP_LOGE("Ability::OnBackground error. scene_ == nullptr."); + HILOG_ERROR("Ability::OnBackground error. scene_ == nullptr."); return; } - APP_LOGI("GoBackground sceneFlag:%{public}d.", sceneFlag_); + HILOG_INFO("GoBackground sceneFlag:%{public}d.", sceneFlag_); scene_->GoBackground(sceneFlag_); } else { if (abilityWindow_ == nullptr) { - APP_LOGE("Ability::OnBackground error. abilityWindow_ == nullptr."); + HILOG_ERROR("Ability::OnBackground error. abilityWindow_ == nullptr."); return; } - APP_LOGI("OnPostAbilityBackground sceneFlag:%{public}d.", sceneFlag_); + HILOG_INFO("OnPostAbilityBackground sceneFlag:%{public}d.", sceneFlag_); abilityWindow_->OnPostAbilityBackground(sceneFlag_); } - APP_LOGI("%{public}s end OnPostAbilityBackground.", __func__); + HILOG_INFO("%{public}s end OnPostAbilityBackground.", __func__); } if (abilityLifecycleExecutor_ == nullptr) { - APP_LOGE("Ability::OnBackground error. abilityLifecycleExecutor_ == nullptr."); + HILOG_ERROR("Ability::OnBackground error. abilityLifecycleExecutor_ == nullptr."); return; } @@ -575,11 +575,11 @@ void Ability::OnBackground() } if (lifecycle_ == nullptr) { - APP_LOGE("Ability::OnBackground error. lifecycle_ == nullptr."); + HILOG_ERROR("Ability::OnBackground error. lifecycle_ == nullptr."); return; } lifecycle_->DispatchLifecycle(LifeCycle::Event::ON_BACKGROUND); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -593,19 +593,19 @@ void Ability::OnBackground() sptr Ability::OnConnect(const Want &want) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (abilityLifecycleExecutor_ == nullptr) { - APP_LOGE("Ability::OnConnect error. abilityLifecycleExecutor_ == nullptr."); + HILOG_ERROR("Ability::OnConnect error. abilityLifecycleExecutor_ == nullptr."); return nullptr; } abilityLifecycleExecutor_->DispatchLifecycleState(AbilityLifecycleExecutor::LifecycleState::ACTIVE); if (lifecycle_ == nullptr) { - APP_LOGE("Ability::OnConnect error. lifecycle_ == nullptr."); + HILOG_ERROR("Ability::OnConnect error. lifecycle_ == nullptr."); return nullptr; } lifecycle_->DispatchLifecycle(LifeCycle::Event::ON_ACTIVE); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return nullptr; } @@ -630,18 +630,18 @@ void Ability::OnDisconnect(const Want &want) */ ErrCode Ability::StartAbilityForResult(const Want &want, int requestCode) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (abilityInfo_ == nullptr) { - APP_LOGE("Ability::StartAbilityForResult abilityInfo_ == nullptr"); + HILOG_ERROR("Ability::StartAbilityForResult abilityInfo_ == nullptr"); return ERR_NULL_OBJECT; } - APP_LOGI("Ability::StartAbilityForResult called type = %{public}d", abilityInfo_->type); + HILOG_INFO("Ability::StartAbilityForResult called type = %{public}d", abilityInfo_->type); if (abilityInfo_->type != AppExecFwk::AbilityType::PAGE) { - APP_LOGE("Ability::StartAbility ability type: %{public}d", abilityInfo_->type); + HILOG_ERROR("Ability::StartAbility ability type: %{public}d", abilityInfo_->type); return ERR_INVALID_VALUE; } ErrCode err = AbilityContext::StartAbility(want, requestCode); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return err; } @@ -660,18 +660,18 @@ ErrCode Ability::StartAbilityForResult(const Want &want, int requestCode) */ ErrCode Ability::StartAbilityForResult(const Want &want, int requestCode, AbilityStartSetting abilityStartSetting) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (abilityInfo_ == nullptr) { - APP_LOGE("Ability::StartAbilityForResult abilityInfo_ == nullptr"); + HILOG_ERROR("Ability::StartAbilityForResult abilityInfo_ == nullptr"); return ERR_NULL_OBJECT; } - APP_LOGI("Ability::StartAbilityForResult called type = %{public}d", abilityInfo_->type); + HILOG_INFO("Ability::StartAbilityForResult called type = %{public}d", abilityInfo_->type); if (abilityInfo_->type != AppExecFwk::AbilityType::PAGE) { - APP_LOGE("Ability::StartAbility ability type: %{public}d", abilityInfo_->type); + HILOG_ERROR("Ability::StartAbility ability type: %{public}d", abilityInfo_->type); return ERR_INVALID_VALUE; } ErrCode err = AbilityContext::StartAbility(want, requestCode, abilityStartSetting); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return err; } @@ -689,18 +689,18 @@ ErrCode Ability::StartAbilityForResult(const Want &want, int requestCode, Abilit */ ErrCode Ability::StartAbility(const Want &want, AbilityStartSetting abilityStartSetting) { - APP_LOGI("%{public}s beign.", __func__); + HILOG_INFO("%{public}s beign.", __func__); if (abilityInfo_ == nullptr) { - APP_LOGE("Ability::StartAbility abilityInfo_ == nullptr"); + HILOG_ERROR("Ability::StartAbility abilityInfo_ == nullptr"); return ERR_NULL_OBJECT; } - APP_LOGI("Ability::StartAbility called type = %{public}d", abilityInfo_->type); + HILOG_INFO("Ability::StartAbility called type = %{public}d", abilityInfo_->type); if (abilityInfo_->type != AppExecFwk::AbilityType::PAGE && abilityInfo_->type != AppExecFwk::AbilityType::SERVICE) { - APP_LOGE("Ability::StartAbility ability type: %{public}d", abilityInfo_->type); + HILOG_ERROR("Ability::StartAbility ability type: %{public}d", abilityInfo_->type); return ERR_INVALID_VALUE; } ErrCode err = AbilityContext::StartAbility(want, -1, abilityStartSetting); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return err; } @@ -717,7 +717,7 @@ ErrCode Ability::StartAbility(const Want &want, AbilityStartSetting abilityStart */ void Ability::OnKeyDown(const std::shared_ptr& keyEvent) { - APP_LOGI("Ability::OnKeyDown called"); + HILOG_INFO("Ability::OnKeyDown called"); } /** @@ -733,10 +733,10 @@ void Ability::OnKeyDown(const std::shared_ptr& keyEvent) */ void Ability::OnKeyUp(const std::shared_ptr& keyEvent) { - APP_LOGI("Ability::OnKeyUp called"); + HILOG_INFO("Ability::OnKeyUp called"); auto code = keyEvent->GetKeyCode(); if (code == MMI::KeyEvent::KEYCODE_BACK) { - APP_LOGI("Ability::OnKey Back key pressed."); + HILOG_INFO("Ability::OnKey Back key pressed."); OnBackPressed(); } } @@ -751,7 +751,7 @@ void Ability::OnKeyUp(const std::shared_ptr& keyEvent) */ void Ability::OnPointerEvent(std::shared_ptr& pointerEvent) { - APP_LOGI("Ability::OnTouchEvent called"); + HILOG_INFO("Ability::OnTouchEvent called"); } /** @@ -801,11 +801,11 @@ void Ability::SetUIContent(int layoutRes, std::shared_ptr &context, int void Ability::InitWindow(Rosen::WindowType winType, int32_t displayId, sptr option) { if (abilityWindow_ == nullptr) { - APP_LOGE("Ability::InitWindow abilityWindow_ is nullptr"); + HILOG_ERROR("Ability::InitWindow abilityWindow_ is nullptr"); return; } bool useNewMission = AbilityImpl::IsUseNewMission(); - APP_LOGI("%{public}s beign abilityWindow_->InitWindow.", __func__); + HILOG_INFO("%{public}s beign abilityWindow_->InitWindow.", __func__); if (useNewMission) { abilityWindow_->InitWindow(winType, abilityContext_, sceneListener_, displayId, option); } else { @@ -813,7 +813,7 @@ void Ability::InitWindow(Rosen::WindowType winType, int32_t displayId, sptr listener = nullptr; abilityWindow_->InitWindow(winType, context, listener, displayId, option); } - APP_LOGI("%{public}s end abilityWindow_->InitWindow.", __func__); + HILOG_INFO("%{public}s end abilityWindow_->InitWindow.", __func__); } /** @@ -826,7 +826,7 @@ const sptr Ability::GetWindow() if (abilityWindow_ != nullptr) { return abilityWindow_->GetWindow(); } else { - APP_LOGI("%{public}s abilityWindow_ is nullptr.", __func__); + HILOG_INFO("%{public}s abilityWindow_ is nullptr.", __func__); return nullptr; } } @@ -859,7 +859,7 @@ int Ability::GetVolumeTypeAdjustedByKey() bool Ability::HasWindowFocus() { if (abilityInfo_ == nullptr) { - APP_LOGI("Ability::HasWindowFocus abilityInfo_ == nullptr"); + HILOG_INFO("Ability::HasWindowFocus abilityInfo_ == nullptr"); return false; } @@ -961,12 +961,12 @@ int Ability::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) */ void Ability::OnConfigurationUpdated(const Configuration &configuration) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); } void Ability::OnConfigurationUpdatedNotify(const Configuration &changeConfiguration) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); std::string language; std::string colormode; @@ -974,23 +974,23 @@ void Ability::OnConfigurationUpdatedNotify(const Configuration &changeConfigurat auto displayId = std::atoi(setting_->GetProperty(AbilityStartSetting::WINDOW_DISPLAY_ID_KEY).c_str()); language = changeConfiguration.GetItem(displayId, GlobalConfigurationKey::SYSTEM_LANGUAGE); colormode = changeConfiguration.GetItem(displayId, GlobalConfigurationKey::SYSTEM_COLORMODE); - APP_LOGI("displayId: [%{public}d], language: [%{public}s], colormode: [%{public}s]", + HILOG_INFO("displayId: [%{public}d], language: [%{public}s], colormode: [%{public}s]", displayId, language.c_str(), colormode.c_str()); } else { language = changeConfiguration.GetItem(GlobalConfigurationKey::SYSTEM_LANGUAGE); colormode = changeConfiguration.GetItem(GlobalConfigurationKey::SYSTEM_COLORMODE); - APP_LOGI("language: [%{public}s], colormode: [%{public}s]", language.c_str(), colormode.c_str()); + HILOG_INFO("language: [%{public}s], colormode: [%{public}s]", language.c_str(), colormode.c_str()); } // Notify ResourceManager std::unique_ptr resConfig(Global::Resource::CreateResConfig()); if (resConfig != nullptr) { - APP_LOGI("make resource mgr data"); + HILOG_INFO("make resource mgr data"); if (!language.empty()) { UErrorCode status = U_ZERO_ERROR; icu::Locale locale = icu::Locale::forLanguageTag(language, status); - APP_LOGI("get Locale::forLanguageTag return[%{public}d].", static_cast(status)); + HILOG_INFO("get Locale::forLanguageTag return[%{public}d].", static_cast(status)); if (status == U_ZERO_ERROR) { resConfig->SetLocaleInfo(locale); } @@ -1001,7 +1001,7 @@ void Ability::OnConfigurationUpdatedNotify(const Configuration &changeConfigurat auto resourceManager = GetResourceManager(); if (resourceManager != nullptr) { resourceManager->UpdateResConfig(*resConfig); - APP_LOGI("%{public}s Notify ResourceManager.", __func__); + HILOG_INFO("%{public}s Notify ResourceManager.", __func__); } } @@ -1009,7 +1009,7 @@ void Ability::OnConfigurationUpdatedNotify(const Configuration &changeConfigurat if (scene_ != nullptr && !language.empty()) { auto diffConfiguration = std::make_shared(changeConfiguration); scene_->UpdateConfiguration(diffConfiguration); - APP_LOGE("%{public}s scene_ -> UpdateConfiguration success.", __func__); + HILOG_ERROR("%{public}s scene_ -> UpdateConfiguration success.", __func__); } if (abilityContext_ != nullptr && application_ != nullptr) { @@ -1017,7 +1017,7 @@ void Ability::OnConfigurationUpdatedNotify(const Configuration &changeConfigurat } // Notify Ability Subclass OnConfigurationUpdated(changeConfiguration); - APP_LOGI("%{public}s Notify Ability Subclass.", __func__); + HILOG_INFO("%{public}s Notify Ability Subclass.", __func__); } /** @@ -1069,12 +1069,12 @@ int Ability::Update( */ std::shared_ptr Ability::GetApplication() { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (application_ == nullptr) { - APP_LOGE("Ability::GetApplication error. application_ == nullptr."); + HILOG_ERROR("Ability::GetApplication error. application_ == nullptr."); return nullptr; } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return application_; } @@ -1086,7 +1086,7 @@ std::shared_ptr Ability::GetApplication() std::string Ability::GetAbilityName() { if (abilityInfo_ == nullptr) { - APP_LOGE("Ability::GetAbilityName abilityInfo_ is nullptr"); + HILOG_ERROR("Ability::GetAbilityName abilityInfo_ is nullptr"); return ""; } @@ -1128,17 +1128,17 @@ void Ability::OnAbilityResult(int requestCode, int resultCode, const Want &want) */ void Ability::OnBackPressed() { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (abilityInfo_ == nullptr) { - APP_LOGE("Ability::OnBackPressed abilityInfo_ is nullptr"); + HILOG_ERROR("Ability::OnBackPressed abilityInfo_ is nullptr"); return; } if (abilityInfo_->isLauncherAbility == false) { - APP_LOGI("Ability::OnBackPressed the ability is not Launcher"); + HILOG_INFO("Ability::OnBackPressed the ability is not Launcher"); TerminateAbility(); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -1149,7 +1149,7 @@ void Ability::OnBackPressed() */ void Ability::OnNewWant(const Want &want) { - APP_LOGI("Ability::OnNewWant called"); + HILOG_INFO("Ability::OnNewWant called"); } /** @@ -1164,7 +1164,7 @@ void Ability::OnNewWant(const Want &want) */ void Ability::OnRestoreAbilityState(const PacMap &inState) { - APP_LOGI("Ability::OnRestoreAbilityState called"); + HILOG_INFO("Ability::OnRestoreAbilityState called"); } /** @@ -1179,7 +1179,7 @@ void Ability::OnRestoreAbilityState(const PacMap &inState) */ void Ability::OnSaveAbilityState(PacMap &outState) { - APP_LOGI("Ability::OnSaveAbilityState called"); + HILOG_INFO("Ability::OnSaveAbilityState called"); } /** @@ -1225,17 +1225,17 @@ std::shared_ptr Ability::GetWant() */ void Ability::SetResult(int resultCode, const Want &resultData) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (abilityInfo_ == nullptr) { - APP_LOGE("Ability::SetResult abilityInfo_ == nullptr"); + HILOG_ERROR("Ability::SetResult abilityInfo_ == nullptr"); return; } - APP_LOGI("Ability::SetResult called type = %{public}d", abilityInfo_->type); + HILOG_INFO("Ability::SetResult called type = %{public}d", abilityInfo_->type); if (abilityInfo_->type == AppExecFwk::AbilityType::PAGE) { AbilityContext::resultWant_ = resultData; AbilityContext::resultCode_ = resultCode; } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -1262,19 +1262,20 @@ void Ability::SetVolumeTypeAdjustedByKey(int volumeType) void Ability::OnCommand(const AAFwk::Want &want, bool restart, int startId) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("%{public}s begin restart=%{public}s,startId=%{public}d.", __func__, restart ? "true" : "false", startId); + HILOG_INFO( + "%{public}s begin restart=%{public}s,startId=%{public}d.", __func__, restart ? "true" : "false", startId); if (abilityLifecycleExecutor_ == nullptr) { - APP_LOGE("Ability::OnCommand error. abilityLifecycleExecutor_ == nullptr."); + HILOG_ERROR("Ability::OnCommand error. abilityLifecycleExecutor_ == nullptr."); return; } abilityLifecycleExecutor_->DispatchLifecycleState(AbilityLifecycleExecutor::LifecycleState::ACTIVE); if (lifecycle_ == nullptr) { - APP_LOGE("Ability::OnCommand error. lifecycle_ == nullptr."); + HILOG_ERROR("Ability::OnCommand error. lifecycle_ == nullptr."); return; } lifecycle_->DispatchLifecycle(LifeCycle::Event::ON_ACTIVE); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -1284,53 +1285,53 @@ void Ability::OnCommand(const AAFwk::Want &want, bool restart, int startId) */ void Ability::Dump(const std::string &extra) { - APP_LOGI("Ability::Dump called"); + HILOG_INFO("Ability::Dump called"); // abilityInfo - APP_LOGI("==============AbilityInfo=============="); + HILOG_INFO("==============AbilityInfo=============="); if (abilityInfo_ != nullptr) { - APP_LOGI("abilityInfo: package: %{public}s", abilityInfo_->package.c_str()); - APP_LOGI("abilityInfo: name: %{public}s", abilityInfo_->name.c_str()); - APP_LOGI("abilityInfo: label: %{public}s", abilityInfo_->label.c_str()); - APP_LOGI("abilityInfo: description: %{public}s", abilityInfo_->description.c_str()); - APP_LOGI("abilityInfo: iconPath: %{public}s", abilityInfo_->iconPath.c_str()); - APP_LOGI("abilityInfo: visible: %{public}d", abilityInfo_->visible); - APP_LOGI("abilityInfo: kind: %{public}s", abilityInfo_->kind.c_str()); - APP_LOGI("abilityInfo: type: %{public}d", abilityInfo_->type); - APP_LOGI("abilityInfo: orientation: %{public}d", abilityInfo_->orientation); - APP_LOGI("abilityInfo: launchMode: %{public}d", abilityInfo_->launchMode); + HILOG_INFO("abilityInfo: package: %{public}s", abilityInfo_->package.c_str()); + HILOG_INFO("abilityInfo: name: %{public}s", abilityInfo_->name.c_str()); + HILOG_INFO("abilityInfo: label: %{public}s", abilityInfo_->label.c_str()); + HILOG_INFO("abilityInfo: description: %{public}s", abilityInfo_->description.c_str()); + HILOG_INFO("abilityInfo: iconPath: %{public}s", abilityInfo_->iconPath.c_str()); + HILOG_INFO("abilityInfo: visible: %{public}d", abilityInfo_->visible); + HILOG_INFO("abilityInfo: kind: %{public}s", abilityInfo_->kind.c_str()); + HILOG_INFO("abilityInfo: type: %{public}d", abilityInfo_->type); + HILOG_INFO("abilityInfo: orientation: %{public}d", abilityInfo_->orientation); + HILOG_INFO("abilityInfo: launchMode: %{public}d", abilityInfo_->launchMode); for (auto permission : abilityInfo_->permissions) { - APP_LOGI("abilityInfo: permission: %{public}s", permission.c_str()); + HILOG_INFO("abilityInfo: permission: %{public}s", permission.c_str()); } - APP_LOGI("abilityInfo: bundleName: %{public}s", abilityInfo_->bundleName.c_str()); - APP_LOGI("abilityInfo: applicationName: %{public}s", abilityInfo_->applicationName.c_str()); + HILOG_INFO("abilityInfo: bundleName: %{public}s", abilityInfo_->bundleName.c_str()); + HILOG_INFO("abilityInfo: applicationName: %{public}s", abilityInfo_->applicationName.c_str()); } else { - APP_LOGI("abilityInfo is nullptr"); + HILOG_INFO("abilityInfo is nullptr"); } // lifecycle_Event - APP_LOGI("==============lifecycle_Event=============="); + HILOG_INFO("==============lifecycle_Event=============="); if (lifecycle_ != nullptr) { - APP_LOGI("lifecycle_Event: launchMode: %{public}d", lifecycle_->GetLifecycleState()); + HILOG_INFO("lifecycle_Event: launchMode: %{public}d", lifecycle_->GetLifecycleState()); } else { - APP_LOGI("lifecycle is nullptr"); + HILOG_INFO("lifecycle is nullptr"); } // lifecycle_State - APP_LOGI("==============lifecycle_State=============="); + HILOG_INFO("==============lifecycle_State=============="); if (abilityLifecycleExecutor_ != nullptr) { - APP_LOGI("lifecycle_State: launchMode: %{public}d", abilityLifecycleExecutor_->GetState()); + HILOG_INFO("lifecycle_State: launchMode: %{public}d", abilityLifecycleExecutor_->GetState()); } else { - APP_LOGI("abilityLifecycleExecutor is nullptr"); + HILOG_INFO("abilityLifecycleExecutor is nullptr"); } // applicationInfo - APP_LOGI("==============applicationInfo=============="); + HILOG_INFO("==============applicationInfo=============="); std::shared_ptr ApplicationInfoPtr = GetApplicationInfo(); if (ApplicationInfoPtr != nullptr) { - APP_LOGI("applicationInfo: name: %{public}s", ApplicationInfoPtr->name.c_str()); - APP_LOGI("applicationInfo: bundleName: %{public}s", ApplicationInfoPtr->bundleName.c_str()); + HILOG_INFO("applicationInfo: name: %{public}s", ApplicationInfoPtr->name.c_str()); + HILOG_INFO("applicationInfo: bundleName: %{public}s", ApplicationInfoPtr->bundleName.c_str()); } else { - APP_LOGI("ApplicationInfoPtr is nullptr"); + HILOG_INFO("ApplicationInfoPtr is nullptr"); } } @@ -1471,14 +1472,14 @@ bool Ability::Reload(const Uri &uri, const PacMap &extras) */ int Ability::BatchInsert(const Uri &uri, const std::vector &values) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); int amount = 0; for (auto it = values.begin(); it != values.end(); it++) { if (Insert(uri, *it) >= 0) { amount++; } } - APP_LOGI("%{public}s end, amount=%{public}d", __func__, amount); + HILOG_INFO("%{public}s end, amount=%{public}d", __func__, amount); return amount; } @@ -1495,7 +1496,7 @@ int Ability::BatchInsert(const Uri &uri, const std::vectorContinueAbility(true, deviceId); @@ -1521,7 +1522,7 @@ std::string Ability::GetOriginalDeviceId() ContinuationState Ability::GetContinuationState() { if (!VerifySupportForContinuation()) { - APP_LOGE("Ability::GetContinuationState failed. VerifySupportForContinuation faled"); + HILOG_ERROR("Ability::GetContinuationState failed. VerifySupportForContinuation faled"); return ContinuationState::LOCAL_RUNNING; } return continuationManager_->GetContinuationState(); @@ -1559,7 +1560,7 @@ Uri Ability::DenormalizeUri(const Uri &uri) */ std::shared_ptr Ability::GetLifecycle() { - APP_LOGI("Ability::GetLifecycle called"); + HILOG_INFO("Ability::GetLifecycle called"); return lifecycle_; } @@ -1570,10 +1571,10 @@ std::shared_ptr Ability::GetLifecycle() */ AbilityLifecycleExecutor::LifecycleState Ability::GetState() { - APP_LOGI("Ability::GetState called"); + HILOG_INFO("Ability::GetState called"); if (abilityLifecycleExecutor_ == nullptr) { - APP_LOGE("Ability::GetState error. abilityLifecycleExecutor_ == nullptr."); + HILOG_ERROR("Ability::GetState error. abilityLifecycleExecutor_ == nullptr."); return AbilityLifecycleExecutor::LifecycleState::UNINITIALIZED; } @@ -1591,7 +1592,7 @@ AbilityLifecycleExecutor::LifecycleState Ability::GetState() */ ErrCode Ability::StartAbility(const Want &want) { - APP_LOGI("%{public}s begin Ability::StartAbility", __func__); + HILOG_INFO("%{public}s begin Ability::StartAbility", __func__); return AbilityContext::StartAbility(want, -1); } @@ -1604,7 +1605,7 @@ ErrCode Ability::StartAbility(const Want &want) */ ErrCode Ability::TerminateAbility() { - APP_LOGI("%{public}s begin Ability::TerminateAbility", __func__); + HILOG_INFO("%{public}s begin Ability::TerminateAbility", __func__); return AbilityContext::TerminateAbility(); } @@ -1718,9 +1719,9 @@ bool Ability::StopAbility(const AAFwk::Want &want) */ void Ability::PostTask(std::function task, long delayTime) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); TaskHandlerClient::GetInstance()->PostTask(task, delayTime); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -1780,12 +1781,12 @@ std::string Ability::GetContentInfo() void Ability::ContinueAbilityWithStack(const std::string &deviceId) { if (deviceId.empty()) { - APP_LOGE("ContinueAbilityWithStack(deviceId) failed. deviceId is empty"); + HILOG_ERROR("ContinueAbilityWithStack(deviceId) failed. deviceId is empty"); return; } if (!VerifySupportForContinuation()) { - APP_LOGE("ContinueAbilityWithStack(deviceId) failed. VerifySupportForContinuation failed"); + HILOG_ERROR("ContinueAbilityWithStack(deviceId) failed. VerifySupportForContinuation failed"); return; } continuationManager_->ContinueAbilityWithStack(deviceId); @@ -1802,12 +1803,12 @@ void Ability::ContinueAbilityWithStack(const std::string &deviceId) void Ability::ContinueAbility(const std::string &deviceId) { if (deviceId.empty()) { - APP_LOGE("Ability::ContinueAbility(deviceId) failed. deviceId is empty"); + HILOG_ERROR("Ability::ContinueAbility(deviceId) failed. deviceId is empty"); return; } if (!VerifySupportForContinuation()) { - APP_LOGE("Ability::ContinueAbility(deviceId) failed. VerifySupportForContinuation failed"); + HILOG_ERROR("Ability::ContinueAbility(deviceId) failed. VerifySupportForContinuation failed"); return; } continuationManager_->ContinueAbility(false, deviceId); @@ -1853,7 +1854,7 @@ bool Ability::OnRestoreData(WantParams &restoreData) */ void Ability::OnCompleteContinuation(int result) { - APP_LOGI("Ability::OnCompleteContinuation change continuation state to initial"); + HILOG_INFO("Ability::OnCompleteContinuation change continuation state to initial"); continuationManager_->ChangeProcessStateToInit(); } @@ -1868,7 +1869,7 @@ void Ability::OnRemoteTerminated() void Ability::DispatchLifecycleOnForeground(const Want &want) { if (abilityLifecycleExecutor_ == nullptr) { - APP_LOGE("Ability::OnForeground error. abilityLifecycleExecutor_ == nullptr."); + HILOG_ERROR("Ability::OnForeground error. abilityLifecycleExecutor_ == nullptr."); return; } if (abilityInfo_->isStageBasedModel) { @@ -1877,7 +1878,7 @@ void Ability::DispatchLifecycleOnForeground(const Want &want) abilityLifecycleExecutor_->DispatchLifecycleState(AbilityLifecycleExecutor::LifecycleState::INACTIVE); } if (lifecycle_ == nullptr) { - APP_LOGE("Ability::OnForeground error. lifecycle_ == nullptr."); + HILOG_ERROR("Ability::OnForeground error. lifecycle_ == nullptr."); return; } lifecycle_->DispatchLifecycle(LifeCycle::Event::ON_FOREGROUND, want); @@ -1886,7 +1887,7 @@ void Ability::DispatchLifecycleOnForeground(const Want &want) bool Ability::VerifySupportForContinuation() { if (continuationManager_ == nullptr) { - APP_LOGE("Ability::VerifySupportForContinuation failed. continuationManager_ is nullptr"); + HILOG_ERROR("Ability::VerifySupportForContinuation failed. continuationManager_ is nullptr"); return false; } return true; @@ -1895,7 +1896,7 @@ bool Ability::VerifySupportForContinuation() void Ability::HandleCreateAsContinuation(const Want &want) { if (!IsFlagExists(Want::FLAG_ABILITY_CONTINUATION, want.GetFlags())) { - APP_LOGI("Ability::HandleCreateAsContinuation return. This not continuated ability"); + HILOG_INFO("Ability::HandleCreateAsContinuation return. This not continuated ability"); return; } @@ -1903,7 +1904,7 @@ void Ability::HandleCreateAsContinuation(const Want &want) bool reversible = false; reversible = IsFlagExists(Want::FLAG_ABILITY_CONTINUATION_REVERSIBLE, want.GetFlags()); if (!VerifySupportForContinuation()) { - APP_LOGE("Ability::HandleCreateAsContinuation failed. VerifySupportForContinuation failed"); + HILOG_ERROR("Ability::HandleCreateAsContinuation failed. VerifySupportForContinuation failed"); return; } bool success = continuationManager_->RestoreData( @@ -1916,14 +1917,15 @@ void Ability::HandleCreateAsContinuation(const Want &want) new (std::nothrow) ReverseContinuationSchedulerReplica(handler_, ReplicaHandler)); if (reverseContinuationSchedulerReplica_ == nullptr) { - APP_LOGE("Ability::HandleCreateAsContinuation failed, create reverseContinuationSchedulerReplica failed"); + HILOG_ERROR( + "Ability::HandleCreateAsContinuation failed, create reverseContinuationSchedulerReplica failed"); return; } } int sessionId = want.GetIntParam(DMS_SESSION_ID, DEFAULT_DMS_SESSION_ID); std::string originDeviceId = want.GetStringParam(DMS_ORIGIN_DEVICE_ID); - APP_LOGE("Ability::HandleCreateAsContinuationoriginDeviceId: %{public}s", originDeviceId.c_str()); + HILOG_ERROR("Ability::HandleCreateAsContinuationoriginDeviceId: %{public}s", originDeviceId.c_str()); continuationManager_->NotifyCompleteContinuation( originDeviceId, sessionId, success, reverseContinuationSchedulerReplica_); } @@ -1965,14 +1967,14 @@ Uri Ability::OnSetCaller() */ void Ability::TerminateAndRemoveMission() { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); auto state = GetState(); if (state > AbilityLifecycleExecutor::LifecycleState::INITIAL) { - APP_LOGI("Ability::TerminateAndRemoveMission the GetState retval is %d", state); + HILOG_INFO("Ability::TerminateAndRemoveMission the GetState retval is %d", state); return; } AbilityContext::TerminateAndRemoveMission(); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -2007,7 +2009,7 @@ std::shared_ptr Ability::CreatePostEventTimeouter(std:: */ ErrCode Ability::ReleaseForm(const int64_t formId) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); // release form by formId and do not release cache return ReleaseForm(formId, false); } @@ -2035,7 +2037,7 @@ ErrCode Ability::ReleaseForm(const int64_t formId) */ ErrCode Ability::ReleaseForm(const int64_t formId, const bool isReleaseCache) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); // release form with formId and specifies whether to release the cache return DeleteForm(formId, isReleaseCache ? RELEASE_CACHED_FORM : RELEASE_FORM); } @@ -2061,7 +2063,7 @@ ErrCode Ability::ReleaseForm(const int64_t formId, const bool isReleaseCache) */ ErrCode Ability::DeleteForm(const int64_t formId) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); // delete form with formId return DeleteForm(formId, DELETE_FORM); } @@ -2099,23 +2101,23 @@ int Ability::StopBackgroundRunning() */ ErrCode Ability::CastTempForm(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); if (formId <= 0) { - APP_LOGE("%{public}s error, passing in form id can't be negative.", __func__); + HILOG_ERROR("%{public}s error, passing in form id can't be negative.", __func__); return ERR_APPEXECFWK_FORM_INVALID_FORM_ID; } - APP_LOGI("%{public}s, castTempForm begin of temp form %{public}" PRId64, __func__, formId); + HILOG_INFO("%{public}s, castTempForm begin of temp form %{public}" PRId64, __func__, formId); ErrCode result = FormMgr::GetInstance().CastTempForm(formId, FormHostClient::GetInstance()); if (result != ERR_OK) { - APP_LOGE("%{public}s error, some internal server occurs, error code is %{public}d.", __func__, result); + HILOG_ERROR("%{public}s error, some internal server occurs, error code is %{public}d.", __func__, result); return result; } userReqParams_[formId].SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, false); - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return result; } @@ -2133,35 +2135,35 @@ ErrCode Ability::CastTempForm(const int64_t formId) */ bool Ability::AcquireForm(const int64_t formId, const Want &want, const std::shared_ptr callback) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; - APP_LOGI("%{public}s begin, current time: %{public}ld", __func__, currentTime); + HILOG_INFO("%{public}s begin, current time: %{public}ld", __func__, currentTime); // check fms recover status if (FormMgr::GetRecoverStatus() == Constants::IN_RECOVERING) { - APP_LOGE("%{public}s error, form is in recover status, can't do action on form.", __func__); + HILOG_ERROR("%{public}s error, form is in recover status, can't do action on form.", __func__); return false; } // check form id - APP_LOGD("%{public}s, param of formId %{public}" PRId64 ".", __func__, formId); + HILOG_DEBUG("%{public}s, param of formId %{public}" PRId64 ".", __func__, formId); if (formId < 0) { - APP_LOGE("%{public}s error, form id should not be negative.", __func__); + HILOG_ERROR("%{public}s error, form id should not be negative.", __func__); return false; } // check param of want if (!CheckWantValid(formId, want)) { - APP_LOGE("%{public}s error, failed to check param of want.", __func__); + HILOG_ERROR("%{public}s error, failed to check param of want.", __func__); return false; }; ElementName elementName = want.GetElement(); std::string bundleName = elementName.GetBundleName(); std::string abilityName = elementName.GetAbilityName(); - APP_LOGI("%{public}s, begin to acquire form, bundleName is %{public}s, abilityName is %{public}s, formId is " + HILOG_INFO("%{public}s, begin to acquire form, bundleName is %{public}s, abilityName is %{public}s, formId is " "%{public}" PRId64 ".", __func__, bundleName.c_str(), @@ -2171,23 +2173,23 @@ bool Ability::AcquireForm(const int64_t formId, const Want &want, const std::sha // hostClient init sptr formHostClient = FormHostClient::GetInstance(); if (formHostClient == nullptr) { - APP_LOGE("%{public}s error, formHostClient == nullptr.", __func__); + HILOG_ERROR("%{public}s error, formHostClient == nullptr.", __func__); return false; } // acquire form request to fms FormJsInfo formJsInfo; if (FormMgr::GetInstance().AddForm(formId, want, formHostClient, formJsInfo) != ERR_OK) { - APP_LOGE("%{public}s error, acquire form for fms failed.", __func__); + HILOG_ERROR("%{public}s error, acquire form for fms failed.", __func__); return false; } - APP_LOGI("%{public}s, end to acquire form, the formId returned from the fms is %{public}" PRId64 ".", + HILOG_INFO("%{public}s, end to acquire form, the formId returned from the fms is %{public}" PRId64 ".", __func__, formJsInfo.formId); // check for form presence in hostForms if (formHostClient->ContainsForm(formJsInfo.formId)) { - APP_LOGE("%{public}s error, form has already acquired, do not support acquire twice.", __func__); + HILOG_ERROR("%{public}s error, form has already acquired, do not support acquire twice.", __func__); return false; } @@ -2211,29 +2213,29 @@ bool Ability::AcquireForm(const int64_t formId, const Want &want, const std::sha */ ErrCode Ability::UpdateForm(const int64_t formId, const FormProviderData &formProviderData) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); // check fms recover status if (FormMgr::GetRecoverStatus() == Constants::IN_RECOVERING) { - APP_LOGE("%{public}s error, form is in recover status, can't do action on form.", __func__); + HILOG_ERROR("%{public}s error, form is in recover status, can't do action on form.", __func__); return ERR_APPEXECFWK_FORM_SERVER_STATUS_ERR; } // check formId if (formId <= 0) { - APP_LOGE("%{public}s error, the passed in formId can't be negative or zero.", __func__); + HILOG_ERROR("%{public}s error, the passed in formId can't be negative or zero.", __func__); return ERR_APPEXECFWK_FORM_INVALID_FORM_ID; } // check formProviderData if (formProviderData.GetDataString().empty()) { - APP_LOGE("%{public}s error, the formProviderData is null.", __func__); + HILOG_ERROR("%{public}s error, the formProviderData is null.", __func__); return ERR_APPEXECFWK_FORM_PROVIDER_DATA_EMPTY; } // update form request to fms ErrCode result = FormMgr::GetInstance().UpdateForm(formId, abilityInfo_->bundleName, formProviderData); if (result != ERR_OK) { - APP_LOGE("%{public}s error, update form for fms failed.", __func__); + HILOG_ERROR("%{public}s error, update form for fms failed.", __func__); } return result; } @@ -2249,7 +2251,7 @@ ErrCode Ability::UpdateForm(const int64_t formId, const FormProviderData &formPr */ ErrCode Ability::NotifyVisibleForms(const std::vector &formIds) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); return NotifyWhetherVisibleForms(formIds, Constants::FORM_VISIBLE); } @@ -2264,7 +2266,7 @@ ErrCode Ability::NotifyVisibleForms(const std::vector &formIds) */ ErrCode Ability::NotifyInvisibleForms(const std::vector &formIds) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); return NotifyWhetherVisibleForms(formIds, Constants::FORM_INVISIBLE); } @@ -2279,20 +2281,20 @@ ErrCode Ability::NotifyInvisibleForms(const std::vector &formIds) */ ErrCode Ability::SetFormNextRefreshTime(const int64_t formId, const int64_t nextTime) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (nextTime < MIN_NEXT_TIME) { - APP_LOGE("next time litte than 300 seconds."); + HILOG_ERROR("next time litte than 300 seconds."); return ERR_APPEXECFWK_FORM_INVALID_REFRESH_TIME; } if (FormMgr::GetInstance().GetRecoverStatus() == Constants::IN_RECOVERING) { - APP_LOGE("%{public}s, formManager is in recovering", __func__); + HILOG_ERROR("%{public}s, formManager is in recovering", __func__); return ERR_APPEXECFWK_FORM_SERVER_STATUS_ERR; } ErrCode result = FormMgr::GetInstance().SetNextRefreshTime(formId, nextTime); if (result != ERR_OK) { - APP_LOGE("%{public}s, internal error:[%{public}d]", __func__, result); + HILOG_ERROR("%{public}s, internal error:[%{public}d]", __func__, result); } return result; @@ -2310,7 +2312,7 @@ ErrCode Ability::SetFormNextRefreshTime(const int64_t formId, const int64_t next */ ErrCode Ability::RequestForm(const int64_t formId) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); Want want; return RequestForm(formId, want); } @@ -2322,7 +2324,7 @@ ErrCode Ability::RequestForm(const int64_t formId) */ void Ability::ProcessFormUpdate(const FormJsInfo &formJsInfo) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); // post the async task of handleFormMessage int32_t msgCode = OHOS_FORM_UPDATE_FORM; PostTask([this, msgCode, formJsInfo]() { HandleFormMessage(msgCode, formJsInfo); }, 0L); @@ -2334,10 +2336,10 @@ void Ability::ProcessFormUpdate(const FormJsInfo &formJsInfo) */ void Ability::ProcessFormUninstall(const int64_t formId) { - APP_LOGI("%{public}s start.", __func__); + HILOG_INFO("%{public}s start.", __func__); // check formId if (formId <= 0) { - APP_LOGE("%{public}s error, the passed in formId can't be negative or zero.", __func__); + HILOG_ERROR("%{public}s error, the passed in formId can't be negative or zero.", __func__); return; } @@ -2349,20 +2351,20 @@ void Ability::ProcessFormUninstall(const int64_t formId) // call the callback function when you need to be notified if (appCallbackIterator == appCallbacks_.end()) { - APP_LOGE("%{public}s failed, callback not find, formId: %{public}" PRId64 ".", __func__, formId); + HILOG_ERROR("%{public}s failed, callback not find, formId: %{public}" PRId64 ".", __func__, formId); return; } formCallback = appCallbackIterator->second; CleanFormResource(formId); } if (formCallback == nullptr) { - APP_LOGE("%{public}s failed, callback is nullptr.", __func__); + HILOG_ERROR("%{public}s failed, callback is nullptr.", __func__); return; } formCallback->OnFormUninstall(formId); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -2382,7 +2384,7 @@ void Ability::ProcessFormUninstall(const int64_t formId) */ FormProviderInfo Ability::OnCreate(const Want &want) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); FormProviderInfo formProviderInfo; return formProviderInfo; } @@ -2444,19 +2446,19 @@ void Ability::OnTriggerEvent(const int64_t formId, const std::string &message) */ ErrCode Ability::DeleteForm(const int64_t formId, const int32_t deleteType) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); // check fms recover status if (FormMgr::GetRecoverStatus() == Constants::IN_RECOVERING) { - APP_LOGE("%{public}s error, form is in recover status, can't do action on form.", __func__); + HILOG_ERROR("%{public}s error, form is in recover status, can't do action on form.", __func__); return ERR_APPEXECFWK_FORM_SERVER_STATUS_ERR; } // check formId if (formId <= 0) { - APP_LOGE("%{public}s error, the passed in formId can't be negative or zero.", __func__); + HILOG_ERROR("%{public}s error, the passed in formId can't be negative or zero.", __func__); return ERR_APPEXECFWK_FORM_INVALID_FORM_ID; } - APP_LOGI("%{public}s, delete form begin, formId is %{public}" PRId64 " and deleteType is %{public}d.", + HILOG_INFO("%{public}s, delete form begin, formId is %{public}" PRId64 " and deleteType is %{public}d.", __func__, formId, deleteType); @@ -2483,7 +2485,7 @@ ErrCode Ability::DeleteForm(const int64_t formId, const int32_t deleteType) formId, formHostClient, (deleteType == RELEASE_CACHED_FORM) ? true : false); } if (result != ERR_OK) { - APP_LOGE("%{public}s error, some internal server occurs, error code is %{public}d.", __func__, result); + HILOG_ERROR("%{public}s error, some internal server occurs, error code is %{public}d.", __func__, result); return result; } { @@ -2503,7 +2505,7 @@ ErrCode Ability::DeleteForm(const int64_t formId, const int32_t deleteType) */ void Ability::CleanFormResource(const int64_t formId) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); // compatible with int form id int64_t cleanId {-1L}; for (auto param : userReqParams_) { @@ -2518,7 +2520,7 @@ void Ability::CleanFormResource(const int64_t formId) return; } - APP_LOGD("%{public}s. clean id is %{public}" PRId64 ".", __func__, cleanId); + HILOG_DEBUG("%{public}s. clean id is %{public}" PRId64 ".", __func__, cleanId); // remove wantParam, callback and lostedByReconnectTempForms appCallbacks_.erase(cleanId); userReqParams_.erase(cleanId); @@ -2536,7 +2538,7 @@ void Ability::CleanFormResource(const int64_t formId) std::shared_ptr thisAbility = this->shared_from_this(); FormMgr::GetInstance().UnRegisterDeathCallback(thisAbility); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -2550,7 +2552,7 @@ void Ability::CleanFormResource(const int64_t formId) void Ability::HandleAcquireResult( const Want &want, const FormJsInfo &formJsInfo, const std::shared_ptr callback) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); { // form lock std::lock_guard lock(formLock); @@ -2569,7 +2571,7 @@ void Ability::HandleAcquireResult( struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; - APP_LOGI("%{public}s, AcquireForm end, current time: %{public}ld", __func__, currentTime); + HILOG_INFO("%{public}s, AcquireForm end, current time: %{public}ld", __func__, currentTime); // handle acquire message of the obtained form instance callback->OnAcquired(FormCallback::OHOS_FORM_ACQUIRE_SUCCESS, formJsInfo); @@ -2583,7 +2585,7 @@ void Ability::HandleAcquireResult( */ void Ability::HandleFormMessage(const int32_t msgCode, const FormJsInfo &formJsInfo) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::shared_ptr formCallback = nullptr; { std::lock_guard lock(formLock); @@ -2593,17 +2595,18 @@ void Ability::HandleFormMessage(const int32_t msgCode, const FormJsInfo &formJsI // call the callback function when you need to be notified if (appCallbackIterator == appCallbacks_.end()) { - APP_LOGE("%{public}s failed, callback not find, formId: %{public}" PRId64 ".", __func__, formJsInfo.formId); + HILOG_ERROR( + "%{public}s failed, callback not find, formId: %{public}" PRId64 ".", __func__, formJsInfo.formId); return; } formCallback = appCallbackIterator->second; } if (formCallback == nullptr) { - APP_LOGE("%{public}s failed, callback is nullptr.", __func__); + HILOG_ERROR("%{public}s failed, callback is nullptr.", __func__); return; } - APP_LOGI("%{public}s, call user implement of form %{public}" PRId64 ".", __func__, formJsInfo.formId); + HILOG_INFO("%{public}s, call user implement of form %{public}" PRId64 ".", __func__, formJsInfo.formId); if (msgCode == OHOS_FORM_ACQUIRE_FORM) { formCallback->OnAcquired(FormCallback::OHOS_FORM_ACQUIRE_SUCCESS, formJsInfo); @@ -2622,21 +2625,21 @@ void Ability::HandleFormMessage(const int32_t msgCode, const FormJsInfo &formJsI */ ErrCode Ability::NotifyWhetherVisibleForms(const std::vector &formIds, int32_t eventType) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (formIds.empty() || formIds.size() > Constants::MAX_VISIBLE_NOTIFY_LIST) { - APP_LOGE("%{public}s, formIds is empty or exceed 32.", __func__); + HILOG_ERROR("%{public}s, formIds is empty or exceed 32.", __func__); return ERR_APPEXECFWK_FORM_INVALID_FORM_ID; } if (FormMgr::GetRecoverStatus() == Constants::IN_RECOVERING) { - APP_LOGE("%{public}s error, form is in recover status, can't do action on form.", __func__); + HILOG_ERROR("%{public}s error, form is in recover status, can't do action on form.", __func__); return ERR_APPEXECFWK_FORM_SERVER_STATUS_ERR; } ErrCode resultCode = FormMgr::GetInstance().NotifyWhetherVisibleForms(formIds, FormHostClient::GetInstance(), eventType); if (resultCode != ERR_OK) { - APP_LOGE("%{public}s error, internal error occurs, error code:%{public}d.", __func__, resultCode); + HILOG_ERROR("%{public}s error, internal error occurs, error code:%{public}d.", __func__, resultCode); } return resultCode; } @@ -2651,7 +2654,7 @@ ErrCode Ability::NotifyWhetherVisibleForms(const std::vector &formIds, */ bool Ability::CheckWantValid(const int64_t formId, const Want &want) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); // get want parameters int32_t formDimension = want.GetIntParam(Constants::PARAM_FORM_DIMENSION_KEY, 1); std::string moduleName = want.GetStringParam(Constants::PARAM_MODULE_NAME_KEY); @@ -2662,27 +2665,27 @@ bool Ability::CheckWantValid(const int64_t formId, const Want &want) bool tempFormFlg = want.GetBoolParam(Constants::PARAM_FORM_TEMPORARY_KEY, false); - APP_LOGD("%{public}s, param of formDimension %{public}d in want.", __func__, formDimension); - APP_LOGD("%{public}s, param of moduleName %{public}s in want.", __func__, moduleName.c_str()); - APP_LOGD("%{public}s, param of bundleName %{public}s in want.", __func__, bundleName.c_str()); - APP_LOGD("%{public}s, param of abilityName %{public}s in want.", __func__, abilityName.c_str()); - APP_LOGD("%{public}s, param of tempFormFlg %{public}d in want.", __func__, tempFormFlg); + HILOG_DEBUG("%{public}s, param of formDimension %{public}d in want.", __func__, formDimension); + HILOG_DEBUG("%{public}s, param of moduleName %{public}s in want.", __func__, moduleName.c_str()); + HILOG_DEBUG("%{public}s, param of bundleName %{public}s in want.", __func__, bundleName.c_str()); + HILOG_DEBUG("%{public}s, param of abilityName %{public}s in want.", __func__, abilityName.c_str()); + HILOG_DEBUG("%{public}s, param of tempFormFlg %{public}d in want.", __func__, tempFormFlg); // check want parameters if (bundleName.empty() || abilityName.empty() || moduleName.empty()) { - APP_LOGE("%{public}s error, bundleName or abilityName or moduleName is not set in want.", __func__); + HILOG_ERROR("%{public}s error, bundleName or abilityName or moduleName is not set in want.", __func__); return false; } if (FormHostClient::GetInstance()->ContainsForm(formId)) { - APP_LOGE("%{public}s error, form has already acquired, do not support acquire twice.", __func__); + HILOG_ERROR("%{public}s error, form has already acquired, do not support acquire twice.", __func__); return false; } if (formDimension <= 0) { - APP_LOGE("%{public}s error, dimension should not be zero or negative in want.", __func__); + HILOG_ERROR("%{public}s error, dimension should not be zero or negative in want.", __func__); return false; } if (tempFormFlg && formId != 0) { - APP_LOGE("%{public}s error, can not select form id when acquire temporary form.", __func__); + HILOG_ERROR("%{public}s error, can not select form id when acquire temporary form.", __func__); return false; } @@ -2697,7 +2700,7 @@ bool Ability::CheckWantValid(const int64_t formId, const Want &want) */ ErrCode Ability::EnableUpdateForm(const std::vector &formIds) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); return LifecycleUpdate(formIds, ENABLE_FORM_UPDATE); } @@ -2708,21 +2711,21 @@ ErrCode Ability::EnableUpdateForm(const std::vector &formIds) */ ErrCode Ability::DisableUpdateForm(const std::vector &formIds) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); return LifecycleUpdate(formIds, DISABLE_FORM_UPDATE); } ErrCode Ability::LifecycleUpdate(std::vector formIds, int32_t updateType) { if (FormMgr::GetRecoverStatus() == Constants::IN_RECOVERING) { - APP_LOGE("%{public}s error, form is in recover status, can't do action on form.", __func__); + HILOG_ERROR("%{public}s error, form is in recover status, can't do action on form.", __func__); return ERR_APPEXECFWK_FORM_SERVER_STATUS_ERR; } // hostClient init sptr formHostClient = FormHostClient::GetInstance(); if (formHostClient == nullptr) { - APP_LOGE("%{public}s error, formHostClient == nullptr.", __func__); + HILOG_ERROR("%{public}s error, formHostClient == nullptr.", __func__); return ERR_APPEXECFWK_FORM_GET_HOST_FAILED; } @@ -2743,22 +2746,23 @@ ErrCode Ability::LifecycleUpdate(std::vector formIds, int32_t updateTyp */ ErrCode Ability::RequestForm(const int64_t formId, const Want &want) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (formId <= 0) { - APP_LOGE("%{public}s error, The passed formid is invalid. Its value must be larger than 0.", __func__); + HILOG_ERROR("%{public}s error, The passed formid is invalid. Its value must be larger than 0.", __func__); return ERR_APPEXECFWK_FORM_INVALID_FORM_ID; } if (FormMgr::GetRecoverStatus() == Constants::IN_RECOVERING) { - APP_LOGE("%{public}s error, form is in recover status, can't do action on form.", __func__); + HILOG_ERROR("%{public}s error, form is in recover status, can't do action on form.", __func__); return ERR_APPEXECFWK_FORM_SERVER_STATUS_ERR; } // requestForm request to fms ErrCode resultCode = FormMgr::GetInstance().RequestForm(formId, FormHostClient::GetInstance(), want); if (resultCode != ERR_OK) { - APP_LOGE("%{public}s error, failed to notify the form service that the form user's lifecycle is updated, error " - "code is %{public}d.", + HILOG_ERROR( + "%{public}s error, failed to notify the form service that the form user's lifecycle is updated, error " + "code is %{public}d.", __func__, resultCode); } @@ -2771,7 +2775,7 @@ ErrCode Ability::RequestForm(const int64_t formId, const Want &want) */ void Ability::OnDeathReceived() { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int64_t formId; std::map &userReqParams = userReqParams_; std::vector &lostedTempForms = lostedByReconnectTempForms_; @@ -2790,7 +2794,7 @@ void Ability::OnDeathReceived() bool result = ReAcquireForm(formId, want); if (!result) { - APP_LOGI("%{public}s error, reacquire form failed, formId:%{public}" PRId64 ".", __func__, formId); + HILOG_INFO("%{public}s error, reacquire form failed, formId:%{public}" PRId64 ".", __func__, formId); std::shared_ptr formCallback = nullptr; { std::lock_guard lock(formLock); @@ -2799,7 +2803,7 @@ void Ability::OnDeathReceived() appCallbacks_.find(formId); if (appCallbackIterator == appCallbacks_.end()) { - APP_LOGW("%{public}s error, lack of form callback for form, formId:%{public}" PRId64 ".", + HILOG_WARN("%{public}s error, lack of form callback for form, formId:%{public}" PRId64 ".", __func__, formId); continue; @@ -2807,7 +2811,7 @@ void Ability::OnDeathReceived() formCallback = appCallbackIterator->second; } if (formCallback == nullptr) { - APP_LOGW("%{public}s failed, callback is nullptr.", __func__); + HILOG_WARN("%{public}s failed, callback is nullptr.", __func__); continue; } @@ -2827,12 +2831,12 @@ void Ability::OnDeathReceived() */ bool Ability::ReAcquireForm(const int64_t formId, const Want &want) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); // get the form host client sptr formHostClient = FormHostClient::GetInstance(); if (formHostClient == nullptr) { - APP_LOGE("%{public}s error, formHostClient is nullptr, formId:%{public}" PRId64 ".", __func__, formId); + HILOG_ERROR("%{public}s error, formHostClient is nullptr, formId:%{public}" PRId64 ".", __func__, formId); return false; } @@ -2840,7 +2844,7 @@ bool Ability::ReAcquireForm(const int64_t formId, const Want &want) FormJsInfo formJsInfo; if (FormMgr::GetInstance().AddForm(formId, want, formHostClient, formJsInfo) != ERR_OK || formJsInfo.formId <= 0 || formJsInfo.formId != formId) { - APP_LOGE("%{public}s error, fms reacquire form failed, formId:%{public}" PRId64 ".", __func__, formId); + HILOG_ERROR("%{public}s error, fms reacquire form failed, formId:%{public}" PRId64 ".", __func__, formId); return false; } @@ -2857,13 +2861,13 @@ bool Ability::ReAcquireForm(const int64_t formId, const Want &want) */ bool Ability::CheckFMSReady() { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); sptr systemAbilityManager = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); auto remoteObject = systemAbilityManager->GetSystemAbility(FORM_MGR_SERVICE_ID); if (remoteObject == nullptr) { - APP_LOGI("%{public}s, form manager service is not ready.", __func__); + HILOG_INFO("%{public}s, form manager service is not ready.", __func__); return false; } @@ -2878,10 +2882,10 @@ bool Ability::CheckFMSReady() */ ErrCode Ability::GetAllFormsInfo(std::vector &formInfos) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (FormMgr::GetRecoverStatus() == Constants::IN_RECOVERING) { - APP_LOGE("%{public}s error, form is in recover status, can't do action on form.", __func__); + HILOG_ERROR("%{public}s error, form is in recover status, can't do action on form.", __func__); return ERR_APPEXECFWK_FORM_SERVER_STATUS_ERR; } @@ -2898,14 +2902,14 @@ ErrCode Ability::GetAllFormsInfo(std::vector &formInfos) */ ErrCode Ability::GetFormsInfoByApp(std::string &bundleName, std::vector &formInfos) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (bundleName.empty()) { - APP_LOGW("Failed to Get forms info, because empty bundle name"); + HILOG_WARN("Failed to Get forms info, because empty bundle name"); return ERR_APPEXECFWK_FORM_INVALID_BUNDLENAME; } if (FormMgr::GetRecoverStatus() == Constants::IN_RECOVERING) { - APP_LOGE("%{public}s error, form is in recover status, can't do action on form.", __func__); + HILOG_ERROR("%{public}s error, form is in recover status, can't do action on form.", __func__); return ERR_APPEXECFWK_FORM_SERVER_STATUS_ERR; } @@ -2924,19 +2928,19 @@ ErrCode Ability::GetFormsInfoByApp(std::string &bundleName, std::vector &formInfos) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (bundleName.empty()) { - APP_LOGW("Failed to Get forms info, because empty bundleName"); + HILOG_WARN("Failed to Get forms info, because empty bundleName"); return ERR_APPEXECFWK_FORM_INVALID_BUNDLENAME; } if (moduleName.empty()) { - APP_LOGW("Failed to Get forms info, because empty moduleName"); + HILOG_WARN("Failed to Get forms info, because empty moduleName"); return ERR_APPEXECFWK_FORM_INVALID_MODULENAME; } if (FormMgr::GetRecoverStatus() == Constants::IN_RECOVERING) { - APP_LOGE("%{public}s error, form is in recover status, can't do action on form.", __func__); + HILOG_ERROR("%{public}s error, form is in recover status, can't do action on form.", __func__); return ERR_APPEXECFWK_FORM_SERVER_STATUS_ERR; } @@ -2960,19 +2964,19 @@ std::string Ability::GetErrorMsg(const ErrCode errorCode) */ sptr Ability::GetBundleMgr() { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (iBundleMgr_ == nullptr) { sptr systemAbilityManager = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); auto remoteObject = systemAbilityManager->GetSystemAbility(BUNDLE_MGR_SERVICE_SYS_ABILITY_ID); if (remoteObject == nullptr) { - APP_LOGE("%{public}s error, failed to get bundle manager service.", __func__); + HILOG_ERROR("%{public}s error, failed to get bundle manager service.", __func__); return nullptr; } iBundleMgr_ = iface_cast(remoteObject); if (iBundleMgr_ == nullptr) { - APP_LOGE("%{public}s error, failed to get bundle manager service", __func__); + HILOG_ERROR("%{public}s error, failed to get bundle manager service", __func__); return nullptr; } } @@ -2986,7 +2990,7 @@ sptr Ability::GetBundleMgr() */ void Ability::SetBundleManager(const sptr &bundleManager) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); iBundleMgr_ = bundleManager; } @@ -2997,17 +3001,17 @@ void Ability::SetBundleManager(const sptr &bundleManager) */ sptr Ability::GetFormRemoteObject() { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); if (providerRemoteObject_ == nullptr) { sptr providerClient = new (std::nothrow) FormProviderClient(); std::shared_ptr thisAbility = this->shared_from_this(); if (thisAbility == nullptr) { - APP_LOGE("%{public}s failed, thisAbility is nullptr", __func__); + HILOG_ERROR("%{public}s failed, thisAbility is nullptr", __func__); } providerClient->SetOwner(thisAbility); providerRemoteObject_ = providerClient->AsObject(); } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return providerRemoteObject_; } @@ -3017,7 +3021,7 @@ sptr Ability::GetFormRemoteObject() */ void Ability::SetStartAbilitySetting(std::shared_ptr setting) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); setting_ = setting; } @@ -3028,7 +3032,7 @@ void Ability::SetStartAbilitySetting(std::shared_ptr settin */ void Ability::SetLaunchParam(const AAFwk::LaunchParam &launchParam) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); launchParam_ = launchParam; } @@ -3045,45 +3049,45 @@ void Ability::SetSceneListener(const sptr &listener) std::vector> Ability::ExecuteBatch( const std::vector> &operations) { - APP_LOGI("Ability::ExecuteBatch start"); + HILOG_INFO("Ability::ExecuteBatch start"); std::vector> results; if (abilityInfo_ == nullptr) { - APP_LOGE("Ability::ExecuteBatch abilityInfo is nullptr"); + HILOG_ERROR("Ability::ExecuteBatch abilityInfo is nullptr"); return results; } if (abilityInfo_->type != AppExecFwk::AbilityType::DATA) { - APP_LOGE("Ability::ExecuteBatch data ability type failed, current type: %{public}d", abilityInfo_->type); + HILOG_ERROR("Ability::ExecuteBatch data ability type failed, current type: %{public}d", abilityInfo_->type); return results; } size_t len = operations.size(); - APP_LOGI("Ability::ExecuteBatch operation is nullptr, len %{public}zu", len); + HILOG_INFO("Ability::ExecuteBatch operation is nullptr, len %{public}zu", len); for (size_t i = 0; i < len; i++) { std::shared_ptr operation = operations[i]; if (operation == nullptr) { - APP_LOGI("Ability::ExecuteBatch operation is nullptr, create DataAbilityResult"); + HILOG_INFO("Ability::ExecuteBatch operation is nullptr, create DataAbilityResult"); results.push_back(std::make_shared(0)); continue; } ExecuteOperation(operation, results, i); } - APP_LOGI("Ability::ExecuteBatch end, %{public}zu", results.size()); + HILOG_INFO("Ability::ExecuteBatch end, %{public}zu", results.size()); return results; } void Ability::ExecuteOperation(std::shared_ptr &operation, std::vector> &results, int index) { - APP_LOGI("Ability::ExecuteOperation start, index=%{public}d", index); + HILOG_INFO("Ability::ExecuteOperation start, index=%{public}d", index); if (abilityInfo_->type != AppExecFwk::AbilityType::DATA) { - APP_LOGE("Ability::ExecuteOperation data ability type failed, current type: %{public}d", abilityInfo_->type); + HILOG_ERROR("Ability::ExecuteOperation data ability type failed, current type: %{public}d", abilityInfo_->type); return; } if (index < 0) { - APP_LOGE( + HILOG_ERROR( "Ability::ExecuteOperation operation result index should not below zero, current index: %{public}d", index); return; } if (operation == nullptr) { - APP_LOGI("Ability::ExecuteOperation operation is nullptr, create DataAbilityResult"); + HILOG_INFO("Ability::ExecuteOperation operation is nullptr, create DataAbilityResult"); results.push_back(std::make_shared(0)); return; } @@ -3093,42 +3097,42 @@ void Ability::ExecuteOperation(std::shared_ptr &operation, std::shared_ptr predicates = ParsePredictionArgsReference(results, operation, index); if (operation->IsInsertOperation()) { - APP_LOGI("Ability::ExecuteOperation IsInsertOperation"); + HILOG_INFO("Ability::ExecuteOperation IsInsertOperation"); numRows = Insert(*(operation->GetUri().get()), *valuesBucket); } else if (operation->IsDeleteOperation()) { - APP_LOGI("Ability::ExecuteOperation IsDeleteOperation"); + HILOG_INFO("Ability::ExecuteOperation IsDeleteOperation"); numRows = Delete(*(operation->GetUri().get()), *predicates); } else if (operation->IsUpdateOperation()) { - APP_LOGI("Ability::ExecuteOperation IsUpdateOperation"); + HILOG_INFO("Ability::ExecuteOperation IsUpdateOperation"); numRows = Update(*(operation->GetUri().get()), *valuesBucket, *predicates); } else if (operation->IsAssertOperation()) { - APP_LOGI("Ability::ExecuteOperation IsAssertOperation"); + HILOG_INFO("Ability::ExecuteOperation IsAssertOperation"); std::vector columns; std::shared_ptr queryResult = Query(*(operation->GetUri().get()), columns, *predicates); if (queryResult == nullptr) { - APP_LOGE("Ability::ExecuteOperation Query retval is nullptr"); + HILOG_ERROR("Ability::ExecuteOperation Query retval is nullptr"); results.push_back(std::make_shared(0)); return; } if (queryResult->GetRowCount(numRows) != 0) { - APP_LOGE("Ability::ExecuteOperation queryResult->GetRowCount(numRows) != E_OK"); + HILOG_ERROR("Ability::ExecuteOperation queryResult->GetRowCount(numRows) != E_OK"); } if (!CheckAssertQueryResult(queryResult, operation->GetValuesBucket())) { if (queryResult != nullptr) { queryResult->Close(); } - APP_LOGE("Query Result is not equal to expected value."); + HILOG_ERROR("Query Result is not equal to expected value."); } if (queryResult != nullptr) { queryResult->Close(); } } else { - APP_LOGE("Ability::ExecuteOperation Expected bad type %{public}d", operation->GetType()); + HILOG_ERROR("Ability::ExecuteOperation Expected bad type %{public}d", operation->GetType()); } if (operation->GetExpectedCount() != numRows) { - APP_LOGE("Ability::ExecuteOperation Expected %{public}d rows but actual %{public}d", + HILOG_ERROR("Ability::ExecuteOperation Expected %{public}d rows but actual %{public}d", operation->GetExpectedCount(), numRows); } else { @@ -3145,7 +3149,7 @@ std::shared_ptr Ability::ParsePredictionArgsRe int numRefs) { if (operation == nullptr) { - APP_LOGE("Ability::ParsePredictionArgsReference intpur is nullptr"); + HILOG_ERROR("Ability::ParsePredictionArgsReference intpur is nullptr"); return nullptr; } @@ -3158,30 +3162,31 @@ std::shared_ptr Ability::ParsePredictionArgsRe strPredicatesList.clear(); std::shared_ptr predicates = operation->GetDataAbilityPredicates(); if (predicates == nullptr) { - APP_LOGI("Ability::ParsePredictionArgsReference operation->GetDataAbilityPredicates is nullptr"); + HILOG_INFO("Ability::ParsePredictionArgsReference operation->GetDataAbilityPredicates is nullptr"); } else { - APP_LOGI("Ability::ParsePredictionArgsReference operation->GetDataAbilityPredicates isn`t nullptr"); + HILOG_INFO("Ability::ParsePredictionArgsReference operation->GetDataAbilityPredicates isn`t nullptr"); strPredicatesList = predicates->GetWhereArgs(); } if (strPredicatesList.empty()) { - APP_LOGE("Ability::ParsePredictionArgsReference operation->GetDataAbilityPredicates()->GetWhereArgs()" + HILOG_ERROR("Ability::ParsePredictionArgsReference operation->GetDataAbilityPredicates()->GetWhereArgs()" "error strList is empty()"); } for (auto iterMap : predicatesBackReferencesMap) { - APP_LOGI("Ability::ParsePredictionArgsReference predicatesBackReferencesMap first:%{public}d second:%{public}d", + HILOG_INFO( + "Ability::ParsePredictionArgsReference predicatesBackReferencesMap first:%{public}d second:%{public}d", iterMap.first, iterMap.second); int tempCount = ChangeRef2Value(results, numRefs, iterMap.second); if (tempCount < 0) { - APP_LOGE("Ability::ParsePredictionArgsReference tempCount:%{public}d", tempCount); + HILOG_ERROR("Ability::ParsePredictionArgsReference tempCount:%{public}d", tempCount); continue; } std::string strPredicates = std::to_string(tempCount); - APP_LOGI("Ability::ParsePredictionArgsReference strPredicates:%{public}s", strPredicates.c_str()); + HILOG_INFO("Ability::ParsePredictionArgsReference strPredicates:%{public}s", strPredicates.c_str()); strPredicatesList.push_back(strPredicates); - APP_LOGI("Ability::ParsePredictionArgsReference push_back done"); + HILOG_INFO("Ability::ParsePredictionArgsReference push_back done"); } predicates->SetWhereArgs(strPredicatesList); @@ -3195,7 +3200,7 @@ std::shared_ptr Ability::ParseValuesBucketReference( { NativeRdb::ValuesBucket retValueBucket; if (operation == nullptr) { - APP_LOGE("Ability::ParseValuesBucketReference intpur is nullptr"); + HILOG_ERROR("Ability::ParseValuesBucketReference intpur is nullptr"); return nullptr; } @@ -3205,9 +3210,9 @@ std::shared_ptr Ability::ParseValuesBucketReference( retValueBucket.Clear(); if (operation->GetValuesBucket() == nullptr) { - APP_LOGI("Ability::ParseValuesBucketReference operation->GetValuesBucket is nullptr"); + HILOG_INFO("Ability::ParseValuesBucketReference operation->GetValuesBucket is nullptr"); } else { - APP_LOGI("Ability::ParseValuesBucketReference operation->GetValuesBucket is nullptr"); + HILOG_INFO("Ability::ParseValuesBucketReference operation->GetValuesBucket is nullptr"); retValueBucket = *operation->GetValuesBucket(); } @@ -3218,17 +3223,17 @@ std::shared_ptr Ability::ParseValuesBucketReference( std::string key = itermap.first; NativeRdb::ValueObject obj; if (!operation->GetValuesBucketReferences()->GetObject(key, obj)) { - APP_LOGE("Ability::ParseValuesBucketReference operation->GetValuesBucketReferences()->GetObject error"); + HILOG_ERROR("Ability::ParseValuesBucketReference operation->GetValuesBucketReferences()->GetObject error"); continue; } switch (obj.GetType()) { case NativeRdb::ValueObjectType::TYPE_INT: { int val = 0; if (obj.GetInt(val) != 0) { - APP_LOGE("Ability::ParseValuesBucketReference ValueObject->GetInt() error"); + HILOG_ERROR("Ability::ParseValuesBucketReference ValueObject->GetInt() error"); break; } - APP_LOGI("Ability::ParseValuesBucketReference retValueBucket->PutInt(%{public}s, %{public}d)", + HILOG_INFO("Ability::ParseValuesBucketReference retValueBucket->PutInt(%{public}s, %{public}d)", key.c_str(), val); retValueBucket.PutInt(key, val); @@ -3236,10 +3241,10 @@ std::shared_ptr Ability::ParseValuesBucketReference( case NativeRdb::ValueObjectType::TYPE_DOUBLE: { double val = 0.0; if (obj.GetDouble(val) != 0) { - APP_LOGE("Ability::ParseValuesBucketReference ValueObject->GetDouble() error"); + HILOG_ERROR("Ability::ParseValuesBucketReference ValueObject->GetDouble() error"); break; } - APP_LOGI("Ability::ParseValuesBucketReference retValueBucket->PutDouble(%{public}s, %{public}f)", + HILOG_INFO("Ability::ParseValuesBucketReference retValueBucket->PutDouble(%{public}s, %{public}f)", key.c_str(), val); retValueBucket.PutDouble(key, val); @@ -3247,10 +3252,10 @@ std::shared_ptr Ability::ParseValuesBucketReference( case NativeRdb::ValueObjectType::TYPE_STRING: { std::string val = ""; if (obj.GetString(val) != 0) { - APP_LOGE("Ability::ParseValuesBucketReference ValueObject->GetString() error"); + HILOG_ERROR("Ability::ParseValuesBucketReference ValueObject->GetString() error"); break; } - APP_LOGI("Ability::ParseValuesBucketReference retValueBucket->PutString(%{public}s, %{public}s)", + HILOG_INFO("Ability::ParseValuesBucketReference retValueBucket->PutString(%{public}s, %{public}s)", key.c_str(), val.c_str()); retValueBucket.PutString(key, val); @@ -3258,10 +3263,10 @@ std::shared_ptr Ability::ParseValuesBucketReference( case NativeRdb::ValueObjectType::TYPE_BLOB: { std::vector val; if (obj.GetBlob(val) != 0) { - APP_LOGE("Ability::ParseValuesBucketReference ValueObject->GetBlob() error"); + HILOG_ERROR("Ability::ParseValuesBucketReference ValueObject->GetBlob() error"); break; } - APP_LOGI("Ability::ParseValuesBucketReference retValueBucket->PutBlob(%{public}s, %{public}zu)", + HILOG_INFO("Ability::ParseValuesBucketReference retValueBucket->PutBlob(%{public}s, %{public}zu)", key.c_str(), val.size()); retValueBucket.PutBlob(key, val); @@ -3269,16 +3274,16 @@ std::shared_ptr Ability::ParseValuesBucketReference( case NativeRdb::ValueObjectType::TYPE_BOOL: { bool val = false; if (obj.GetBool(val) != 0) { - APP_LOGE("Ability::ParseValuesBucketReference ValueObject->GetBool() error"); + HILOG_ERROR("Ability::ParseValuesBucketReference ValueObject->GetBool() error"); break; } - APP_LOGI("Ability::ParseValuesBucketReference retValueBucket->PutBool(%{public}s, %{public}s)", + HILOG_INFO("Ability::ParseValuesBucketReference retValueBucket->PutBool(%{public}s, %{public}s)", key.c_str(), val ? "true" : "false"); retValueBucket.PutBool(key, val); } break; default: { - APP_LOGI("Ability::ParseValuesBucketReference retValueBucket->PutNull(%{public}s)", key.c_str()); + HILOG_INFO("Ability::ParseValuesBucketReference retValueBucket->PutNull(%{public}s)", key.c_str()); retValueBucket.PutNull(key); } break; } @@ -3294,18 +3299,18 @@ int Ability::ChangeRef2Value(std::vector> &re { int retval = -1; if (index >= numRefs) { - APP_LOGE("Ability::ChangeRef2Value index >= numRefs"); + HILOG_ERROR("Ability::ChangeRef2Value index >= numRefs"); return retval; } if (index >= static_cast(results.size())) { - APP_LOGE("Ability::ChangeRef2Value index:%{public}d >= results.size():%{public}zu", index, results.size()); + HILOG_ERROR("Ability::ChangeRef2Value index:%{public}d >= results.size():%{public}zu", index, results.size()); return retval; } std::shared_ptr refResult = results[index]; if (refResult == nullptr) { - APP_LOGE("Ability::ChangeRef2Value No.%{public}d refResult is null", index); + HILOG_ERROR("Ability::ChangeRef2Value No.%{public}d refResult is null", index); return retval; } @@ -3322,49 +3327,49 @@ bool Ability::CheckAssertQueryResult(std::shared_ptr &&valuesBucket) { if (queryResult == nullptr) { - APP_LOGE("Ability::CheckAssertQueryResult intput queryResult is null"); + HILOG_ERROR("Ability::CheckAssertQueryResult intput queryResult is null"); return true; } if (valuesBucket == nullptr) { - APP_LOGE("Ability::CheckAssertQueryResult intput valuesBucket is null"); + HILOG_ERROR("Ability::CheckAssertQueryResult intput valuesBucket is null"); return true; } std::map valuesMap; valuesBucket->GetAll(valuesMap); if (valuesMap.empty()) { - APP_LOGE("Ability::CheckAssertQueryResult valuesMap is empty"); + HILOG_ERROR("Ability::CheckAssertQueryResult valuesMap is empty"); return true; } int count = 0; if (queryResult->GetRowCount(count) != 0) { - APP_LOGE("Ability::CheckAssertQueryResult GetRowCount is 0"); + HILOG_ERROR("Ability::CheckAssertQueryResult GetRowCount is 0"); return true; } for (auto iterMap : valuesMap) { std::string strObject; if (iterMap.second.GetString(strObject) != 0) { - APP_LOGE("Ability::CheckAssertQueryResult GetString strObject is error"); + HILOG_ERROR("Ability::CheckAssertQueryResult GetString strObject is error"); continue; } if (strObject.empty()) { - APP_LOGE("Ability::CheckAssertQueryResult strObject is empty"); + HILOG_ERROR("Ability::CheckAssertQueryResult strObject is empty"); continue; } for (int i = 0; i < count; ++i) { std::string strName; if (queryResult->GetString(i, strName) != 0) { - APP_LOGE("Ability::CheckAssertQueryResult GetString strName is error"); + HILOG_ERROR("Ability::CheckAssertQueryResult GetString strName is error"); continue; } if (strName.empty()) { - APP_LOGE("Ability::CheckAssertQueryResult strName is empty"); + HILOG_ERROR("Ability::CheckAssertQueryResult strName is empty"); continue; } if (strName.c_str() == strObject.c_str()) { - APP_LOGE("Ability::CheckAssertQueryResult strName same to strObject"); + HILOG_ERROR("Ability::CheckAssertQueryResult strName same to strObject"); continue; } @@ -3377,43 +3382,43 @@ bool Ability::CheckAssertQueryResult(std::shared_ptr Ability::GetWindowOption(const Want &want) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); sptr option = new Rosen::WindowOption(); if (option == nullptr) { - APP_LOGE("Ability::GetWindowOption option is null."); + HILOG_ERROR("Ability::GetWindowOption option is null."); return nullptr; } auto windowMode = want.GetIntParam(Want::PARAM_RESV_WINDOW_MODE, AbilityWindowConfiguration::MULTI_WINDOW_DISPLAY_UNDEFINED); - APP_LOGI("Ability::GetWindowOption window mode is %{public}d.", windowMode); + HILOG_INFO("Ability::GetWindowOption window mode is %{public}d.", windowMode); option->SetWindowMode(static_cast(windowMode)); if (want.GetElement().GetBundleName() == LAUNCHER_BUNDLE_NAME && want.GetElement().GetAbilityName() == LAUNCHER_ABILITY_NAME) { - APP_LOGI("Set window type for launcher"); + HILOG_INFO("Set window type for launcher"); option->SetWindowType(Rosen::WindowType::WINDOW_TYPE_DESKTOP); } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return option; } void Ability::DoOnForeground(const Want& want) { if (abilityWindow_ != nullptr) { - APP_LOGI("%{public}s begin abilityWindow_->OnPostAbilityForeground, sceneFlag:%{public}d.", + HILOG_INFO("%{public}s begin abilityWindow_->OnPostAbilityForeground, sceneFlag:%{public}d.", __func__, sceneFlag_); auto window = abilityWindow_->GetWindow(); if (window != nullptr && want.HasParameter(Want::PARAM_RESV_WINDOW_MODE)) { auto windowMode = want.GetIntParam(Want::PARAM_RESV_WINDOW_MODE, AbilityWindowConfiguration::MULTI_WINDOW_DISPLAY_UNDEFINED); window->SetWindowMode(static_cast(windowMode)); - APP_LOGI("set window mode = %{public}d.", windowMode); + HILOG_INFO("set window mode = %{public}d.", windowMode); } abilityWindow_->OnPostAbilityForeground(sceneFlag_); - APP_LOGI("%{public}s end abilityWindow_->OnPostAbilityForeground.", __func__); + HILOG_INFO("%{public}s end abilityWindow_->OnPostAbilityForeground.", __func__); } else { - APP_LOGI("========================abilityWindow_ != nullptr ======================"); + HILOG_INFO("========================abilityWindow_ != nullptr ======================"); } } @@ -3429,7 +3434,7 @@ sptr Ability::CallRequest() int Ability::GetCurrentWindowMode() { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); auto windowMode = static_cast(Rosen::WindowMode::WINDOW_MODE_UNDEFINED); if (scene_ == nullptr) { return windowMode; @@ -3443,23 +3448,23 @@ int Ability::GetCurrentWindowMode() void Ability::OnCreate(Rosen::DisplayId displayId) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); } void Ability::OnDestroy(Rosen::DisplayId displayId) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); } void Ability::OnChange(Rosen::DisplayId displayId) { - APP_LOGI("%{public}s start, displayId: %{public}" PRIu64"", __func__, + HILOG_INFO("%{public}s start, displayId: %{public}" PRIu64"", __func__, displayId); // Get display auto display = Rosen::DisplayManager::GetInstance().GetDisplayById(displayId); if (!display) { - APP_LOGE("Get display by displayId %{public}" PRIu64" failed.", displayId); + HILOG_ERROR("Get display by displayId %{public}" PRIu64" failed.", displayId); return; } @@ -3475,7 +3480,7 @@ void Ability::OnChange(Rosen::DisplayId displayId) auto resourceManager = GetResourceManager(); if (resourceManager != nullptr) { resourceManager->UpdateResConfig(*resConfig); - APP_LOGI("%{public}s Notify ResourceManager.", __func__); + HILOG_INFO("%{public}s Notify ResourceManager.", __func__); } } @@ -3487,28 +3492,28 @@ void Ability::OnChange(Rosen::DisplayId displayId) std::vector changeKeyV; auto configuration = application_->GetConfiguration(); if (!configuration) { - APP_LOGE("configuration is nullptr."); + HILOG_ERROR("configuration is nullptr."); return; } configuration->CompareDifferent(changeKeyV, newConfig); int size = changeKeyV.size(); - APP_LOGI("changeKeyV size :%{public}d", size); + HILOG_INFO("changeKeyV size :%{public}d", size); if (!changeKeyV.empty()) { configuration->Merge(changeKeyV, newConfig); OnConfigurationUpdated(*configuration); } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } void Ability::OnDisplayMove(Rosen::DisplayId from, Rosen::DisplayId to) { - APP_LOGI("%{public}s called, from displayId %{public}" PRIu64" to %{public}" PRIu64".", __func__, from, to); + HILOG_INFO("%{public}s called, from displayId %{public}" PRIu64" to %{public}" PRIu64".", __func__, from, to); auto display = Rosen::DisplayManager::GetInstance().GetDisplayById(to); if (!display) { - APP_LOGE("Get display by displayId %{public}" PRIu64" failed.", to); + HILOG_ERROR("Get display by displayId %{public}" PRIu64" failed.", to); return; } @@ -3524,13 +3529,13 @@ void Ability::OnDisplayMove(Rosen::DisplayId from, Rosen::DisplayId to) std::vector changeKeyV; auto configuration = application_->GetConfiguration(); if (!configuration) { - APP_LOGE("configuration is nullptr."); + HILOG_ERROR("configuration is nullptr."); return; } configuration->CompareDifferent(changeKeyV, newConfig); int size = changeKeyV.size(); - APP_LOGI("changeKeyV size :%{public}d", size); + HILOG_INFO("changeKeyV size :%{public}d", size); if (!changeKeyV.empty()) { configuration->Merge(changeKeyV, newConfig); OnConfigurationUpdated(*configuration); @@ -3539,7 +3544,7 @@ void Ability::OnDisplayMove(Rosen::DisplayId from, Rosen::DisplayId to) void Ability::RequsetFocus(const Want &want) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (abilityWindow_ == nullptr) { return; } @@ -3548,7 +3553,7 @@ void Ability::RequsetFocus(const Want &want) auto windowMode = want.GetIntParam(Want::PARAM_RESV_WINDOW_MODE, AbilityWindowConfiguration::MULTI_WINDOW_DISPLAY_UNDEFINED); window->SetWindowMode(static_cast(windowMode)); - APP_LOGI("set window mode = %{public}d.", windowMode); + HILOG_INFO("set window mode = %{public}d.", windowMode); } abilityWindow_->OnPostAbilityForeground(sceneFlag_); } diff --git a/frameworks/kits/ability/native/src/ability_context.cpp b/frameworks/kits/ability/native/src/ability_context.cpp index f30357e733..1a1e7b00ec 100644 --- a/frameworks/kits/ability/native/src/ability_context.cpp +++ b/frameworks/kits/ability/native/src/ability_context.cpp @@ -16,8 +16,8 @@ #include "ability_context.h" #include "ability_manager_client.h" -#include "app_log_wrapper.h" #include "bundle_constants.h" +#include "hilog_wrapper.h" #include "iservice_registry.h" #include "resource_manager.h" #include "sys_mgr_client.h" @@ -30,19 +30,19 @@ int AbilityContext::ABILITY_CONTEXT_DEFAULT_REQUEST_CODE(0); ErrCode AbilityContext::StartAbility(const AAFwk::Want &want, int requestCode) { - APP_LOGI("AbilityContext::StartAbility called, requestCode = %{public}d", requestCode); + HILOG_INFO("AbilityContext::StartAbility called, requestCode = %{public}d", requestCode); AppExecFwk::AbilityType type = GetAbilityInfoType(); if (type != AppExecFwk::AbilityType::PAGE && type != AppExecFwk::AbilityType::SERVICE) { - APP_LOGE("AbilityContext::StartAbility AbilityType = %{public}d", type); + HILOG_ERROR("AbilityContext::StartAbility AbilityType = %{public}d", type); return ERR_INVALID_VALUE; } - APP_LOGI("%{public}s. Start calling ams->StartAbility.", __func__); + HILOG_INFO("%{public}s. Start calling ams->StartAbility.", __func__); ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want, token_, requestCode); - APP_LOGI("%{public}s. End calling ams->StartAbility. ret=%{public}d", __func__, err); + HILOG_INFO("%{public}s. End calling ams->StartAbility. ret=%{public}d", __func__, err); if (err != ERR_OK) { - APP_LOGE("AbilityContext::StartAbility is failed %{public}d", err); + HILOG_ERROR("AbilityContext::StartAbility is failed %{public}d", err); } return err; } @@ -51,16 +51,16 @@ ErrCode AbilityContext::StartAbility(const Want &want, int requestCode, const Ab { AppExecFwk::AbilityType type = GetAbilityInfoType(); if (AppExecFwk::AbilityType::PAGE != type && AppExecFwk::AbilityType::SERVICE != type) { - APP_LOGE("AbilityContext::StartAbility AbilityType = %{public}d", type); + HILOG_ERROR("AbilityContext::StartAbility AbilityType = %{public}d", type); return ERR_INVALID_VALUE; } - APP_LOGI("%{public}s. Start calling ams->StartAbility.", __func__); + HILOG_INFO("%{public}s. Start calling ams->StartAbility.", __func__); ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want, abilityStartSetting, token_, requestCode); - APP_LOGI("%{public}s. End calling ams->StartAbility. ret=%{public}d", __func__, err); + HILOG_INFO("%{public}s. End calling ams->StartAbility. ret=%{public}d", __func__, err); if (err != ERR_OK) { - APP_LOGE("AbilityContext::StartAbility is failed %{public}d", err); + HILOG_ERROR("AbilityContext::StartAbility is failed %{public}d", err); } return err; @@ -68,21 +68,21 @@ ErrCode AbilityContext::StartAbility(const Want &want, int requestCode, const Ab ErrCode AbilityContext::TerminateAbility(int requestCode) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->TerminateAbility(token_, requestCode); if (err != ERR_OK) { - APP_LOGE("AbilityContext::TerminateAbility is failed %{public}d", err); + HILOG_ERROR("AbilityContext::TerminateAbility is failed %{public}d", err); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return err; } ErrCode AbilityContext::TerminateAbility() { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); std::shared_ptr info = GetAbilityInfo(); if (info == nullptr) { - APP_LOGE("AbilityContext::TerminateAbility info == nullptr"); + HILOG_ERROR("AbilityContext::TerminateAbility info == nullptr"); return ERR_NULL_OBJECT; } @@ -90,24 +90,24 @@ ErrCode AbilityContext::TerminateAbility() switch (info->type) { case AppExecFwk::AbilityType::PAGE: - APP_LOGI("%{public}s begin ams->TerminateAbility for PAGE.", __func__); + HILOG_INFO("%{public}s begin ams->TerminateAbility for PAGE.", __func__); err = AAFwk::AbilityManagerClient::GetInstance()->TerminateAbility(token_, resultCode_, &resultWant_); - APP_LOGI("%{public}s end ams->TerminateAbility for PAGE, ret=%{public}d", __func__, err); + HILOG_INFO("%{public}s end ams->TerminateAbility for PAGE, ret=%{public}d", __func__, err); break; case AppExecFwk::AbilityType::SERVICE: - APP_LOGI("%{public}s begin ams->TerminateAbility for SERVICE.", __func__); + HILOG_INFO("%{public}s begin ams->TerminateAbility for SERVICE.", __func__); err = AAFwk::AbilityManagerClient::GetInstance()->TerminateAbility(token_, -1, nullptr); - APP_LOGI("%{public}s end ams->TerminateAbility for SERVICE, ret=%{public}d", __func__, err); + HILOG_INFO("%{public}s end ams->TerminateAbility for SERVICE, ret=%{public}d", __func__, err); break; default: - APP_LOGE("AbilityContext::TerminateAbility info type error is %{public}d", info->type); + HILOG_ERROR("AbilityContext::TerminateAbility info type error is %{public}d", info->type); break; } if (err != ERR_OK) { - APP_LOGE("AbilityContext::TerminateAbility is failed %{public}d", err); + HILOG_ERROR("AbilityContext::TerminateAbility is failed %{public}d", err); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return err; } @@ -118,105 +118,105 @@ std::string AbilityContext::GetCallingBundle() std::shared_ptr AbilityContext::GetElementName() { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); std::shared_ptr info = GetAbilityInfo(); if (info == nullptr) { - APP_LOGE("AbilityContext::GetElementName info == nullptr"); + HILOG_ERROR("AbilityContext::GetElementName info == nullptr"); return nullptr; } std::shared_ptr elementName = std::make_shared(); if (elementName == nullptr) { - APP_LOGE("AbilityContext::GetElementName elementName == nullptr"); + HILOG_ERROR("AbilityContext::GetElementName elementName == nullptr"); return nullptr; } elementName->SetAbilityName(info->name); elementName->SetBundleName(info->bundleName); elementName->SetDeviceID(info->deviceId); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return elementName; } std::shared_ptr AbilityContext::GetCallingAbility() { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); std::shared_ptr elementName = std::make_shared(); if (elementName == nullptr) { - APP_LOGE("AbilityContext::GetElementName elementName == nullptr"); + HILOG_ERROR("AbilityContext::GetElementName elementName == nullptr"); return nullptr; } elementName->SetAbilityName(callingAbilityName_); elementName->SetBundleName(callingBundleName_); elementName->SetDeviceID(callingDeviceId_); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return elementName; } bool AbilityContext::ConnectAbility(const Want &want, const sptr &conn) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); AppExecFwk::AbilityType type = GetAbilityInfoType(); std::shared_ptr abilityInfo = GetAbilityInfo(); if (abilityInfo == nullptr) { - APP_LOGE("AbilityContext::ConnectAbility info == nullptr"); + HILOG_ERROR("AbilityContext::ConnectAbility info == nullptr"); return false; } if (AppExecFwk::AbilityType::PAGE != type && AppExecFwk::AbilityType::SERVICE != type) { - APP_LOGE("AbilityContext::ConnectAbility AbilityType = %{public}d", type); + HILOG_ERROR("AbilityContext::ConnectAbility AbilityType = %{public}d", type); return false; } ErrCode ret = AAFwk::AbilityManagerClient::GetInstance()->ConnectAbility(want, conn, token_); - APP_LOGI("%{public}s end ConnectAbility, ret=%{public}d", __func__, ret); + HILOG_INFO("%{public}s end ConnectAbility, ret=%{public}d", __func__, ret); bool value = ((ret == ERR_OK) ? true : false); if (!value) { - APP_LOGE("AbilityContext::ConnectAbility ErrorCode = %{public}d", ret); + HILOG_ERROR("AbilityContext::ConnectAbility ErrorCode = %{public}d", ret); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return value; } ErrCode AbilityContext::DisconnectAbility(const sptr &conn) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); AppExecFwk::AbilityType type = GetAbilityInfoType(); if (AppExecFwk::AbilityType::PAGE != type && AppExecFwk::AbilityType::SERVICE != type) { - APP_LOGE("AbilityContext::DisconnectAbility AbilityType = %{public}d", type); + HILOG_ERROR("AbilityContext::DisconnectAbility AbilityType = %{public}d", type); return ERR_INVALID_VALUE; } ErrCode ret = AAFwk::AbilityManagerClient::GetInstance()->DisconnectAbility(conn); - APP_LOGI("%{public}s end ams->DisconnectAbility, ret=%{public}d", __func__, ret); + HILOG_INFO("%{public}s end ams->DisconnectAbility, ret=%{public}d", __func__, ret); if (ret != ERR_OK) { - APP_LOGE("AbilityContext::DisconnectAbility error"); + HILOG_ERROR("AbilityContext::DisconnectAbility error"); } - APP_LOGD("AbilityContext::DisconnectAbility end"); + HILOG_DEBUG("AbilityContext::DisconnectAbility end"); return ret; } bool AbilityContext::StopAbility(const AAFwk::Want &want) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); AppExecFwk::AbilityType type = GetAbilityInfoType(); if (AppExecFwk::AbilityType::PAGE != type && AppExecFwk::AbilityType::SERVICE != type) { - APP_LOGE("AbilityContext::StopAbility AbilityType = %{public}d", type); + HILOG_ERROR("AbilityContext::StopAbility AbilityType = %{public}d", type); return false; } - APP_LOGI("%{public}s begin ams->StopServiceAbility", __func__); + HILOG_INFO("%{public}s begin ams->StopServiceAbility", __func__); ErrCode err = AAFwk::AbilityManagerClient::GetInstance()->StopServiceAbility(want); - APP_LOGI("%{public}s end ams->StopServiceAbility, ret=%{public}d", __func__, err); + HILOG_INFO("%{public}s end ams->StopServiceAbility, ret=%{public}d", __func__, err); if (err != ERR_OK) { - APP_LOGE("AbilityContext::StopAbility is failed %{public}d", err); + HILOG_ERROR("AbilityContext::StopAbility is failed %{public}d", err); return false; } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return true; } @@ -314,7 +314,7 @@ AppExecFwk::AbilityType AbilityContext::GetAbilityInfoType() { std::shared_ptr info = GetAbilityInfo(); if (info == nullptr) { - APP_LOGE("AbilityContext::GetAbilityInfoType info == nullptr"); + HILOG_ERROR("AbilityContext::GetAbilityInfoType info == nullptr"); return AppExecFwk::AbilityType::UNKNOWN; } @@ -328,102 +328,102 @@ std::shared_ptr AbilityContext::CreateBundleContext(std::string bundleN std::shared_ptr AbilityContext::GetResourceManager() const { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); std::shared_ptr appcontext = GetApplicationContext(); if (appcontext == nullptr) { - APP_LOGE("AbilityContext::GetResourceManager appcontext is nullptr"); + HILOG_ERROR("AbilityContext::GetResourceManager appcontext is nullptr"); return nullptr; } - APP_LOGI("%{public}s begin appcontext->GetResourceManager.", __func__); + HILOG_INFO("%{public}s begin appcontext->GetResourceManager.", __func__); std::shared_ptr resourceManager = appcontext->GetResourceManager(); - APP_LOGI("%{public}s end appcontext->GetResourceManager.", __func__); + HILOG_INFO("%{public}s end appcontext->GetResourceManager.", __func__); if (resourceManager == nullptr) { - APP_LOGE("AbilityContext::GetResourceManager resourceManager is nullptr"); + HILOG_ERROR("AbilityContext::GetResourceManager resourceManager is nullptr"); return nullptr; } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return resourceManager; } int AbilityContext::VerifySelfPermission(const std::string &permission) { - APP_LOGI("%{public}s begin. permission=%{public}s", __func__, permission.c_str()); + HILOG_INFO("%{public}s begin. permission=%{public}s", __func__, permission.c_str()); if (permission.empty()) { - APP_LOGE("VerifySelfPermission permission invalid"); + HILOG_ERROR("VerifySelfPermission permission invalid"); return AppExecFwk::Constants::PERMISSION_NOT_GRANTED; } std::string bundle_name = GetBundleName(); if (bundle_name.empty()) { - APP_LOGE("VerifySelfPermission failed to get bundle name error"); + HILOG_ERROR("VerifySelfPermission failed to get bundle name error"); return AppExecFwk::Constants::PERMISSION_NOT_GRANTED; } sptr ptr = GetBundleManager(); if (ptr == nullptr) { - APP_LOGE("VerifySelfPermission failed to get bundle manager service"); + HILOG_ERROR("VerifySelfPermission failed to get bundle manager service"); return AppExecFwk::Constants::PERMISSION_NOT_GRANTED; } - APP_LOGI("%{public}s start bms->CheckPermission. bundle_name=%{public}s", __func__, bundle_name.c_str()); + HILOG_INFO("%{public}s start bms->CheckPermission. bundle_name=%{public}s", __func__, bundle_name.c_str()); int ret = ptr->CheckPermission(bundle_name, permission); - APP_LOGI("%{public}s end bms->CheckPermission, ret=%{public}d", __func__, ret); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end bms->CheckPermission, ret=%{public}d", __func__, ret); + HILOG_INFO("%{public}s end.", __func__); return ret; } int AbilityContext::VerifyCallingPermission(const std::string &permission) { - APP_LOGI("%{public}s begin. permission=%{public}s", __func__, permission.c_str()); + HILOG_INFO("%{public}s begin. permission=%{public}s", __func__, permission.c_str()); if (permission.empty()) { - APP_LOGE("VerifyCallingPermission permission invalid"); + HILOG_ERROR("VerifyCallingPermission permission invalid"); return AppExecFwk::Constants::PERMISSION_NOT_GRANTED; } std::string bundle_name = GetCallingBundle(); if (bundle_name.empty()) { - APP_LOGE("VerifyCallingPermission failed to get bundle name by uid"); + HILOG_ERROR("VerifyCallingPermission failed to get bundle name by uid"); return AppExecFwk::Constants::PERMISSION_NOT_GRANTED; } sptr ptr = GetBundleManager(); if (ptr == nullptr) { - APP_LOGE("VerifyCallingPermission failed to get bundle manager service"); + HILOG_ERROR("VerifyCallingPermission failed to get bundle manager service"); return AppExecFwk::Constants::PERMISSION_NOT_GRANTED; } - APP_LOGI("%{public}s start bms->CheckPermission. bundle_name=%{public}s", __func__, bundle_name.c_str()); + HILOG_INFO("%{public}s start bms->CheckPermission. bundle_name=%{public}s", __func__, bundle_name.c_str()); int ret = ptr->CheckPermission(bundle_name, permission); - APP_LOGI("%{public}s end bms->CheckPermission, ret=%{public}d", __func__, ret); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end bms->CheckPermission, ret=%{public}d", __func__, ret); + HILOG_INFO("%{public}s end.", __func__); return ret; } bool AbilityContext::CanRequestPermission(const std::string &permission) { - APP_LOGI("%{public}s begin. permission=%{public}s", __func__, permission.c_str()); + HILOG_INFO("%{public}s begin. permission=%{public}s", __func__, permission.c_str()); if (permission.empty()) { - APP_LOGE("CanRequestPermission permission invalid"); + HILOG_ERROR("CanRequestPermission permission invalid"); return true; } std::string bundle_name = GetBundleName(); if (bundle_name.empty()) { - APP_LOGE("CanRequestPermission failed to get bundle name error"); + HILOG_ERROR("CanRequestPermission failed to get bundle name error"); return true; } sptr ptr = GetBundleManager(); if (ptr == nullptr) { - APP_LOGE("CanRequestPermission failed to get bundle manager service"); + HILOG_ERROR("CanRequestPermission failed to get bundle manager service"); return true; } - APP_LOGI("%{public}s start bms->CanRequestPermission. bundle_name=%{public}s", __func__, bundle_name.c_str()); + HILOG_INFO("%{public}s start bms->CanRequestPermission. bundle_name=%{public}s", __func__, bundle_name.c_str()); bool ret = ptr->CanRequestPermission(bundle_name, permission, 0); - APP_LOGI("%{public}s end bms->CanRequestPermission, ret=%{public}s", __func__, ret ? "true" : "false"); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end bms->CanRequestPermission, ret=%{public}s", __func__, ret ? "true" : "false"); + HILOG_INFO("%{public}s end.", __func__); return ret; } @@ -434,32 +434,32 @@ int AbilityContext::VerifyCallingOrSelfPermission(const std::string &permission) int AbilityContext::VerifyPermission(const std::string &permission, int pid, int uid) { - APP_LOGI("%{public}s begin. permission=%{public}s, pid=%{public}d, uid=%{public}d", + HILOG_INFO("%{public}s begin. permission=%{public}s, pid=%{public}d, uid=%{public}d", __func__, permission.c_str(), pid, uid); if (permission.empty()) { - APP_LOGE("VerifyPermission permission invalid"); + HILOG_ERROR("VerifyPermission permission invalid"); return AppExecFwk::Constants::PERMISSION_NOT_GRANTED; } sptr ptr = GetBundleManager(); if (ptr == nullptr) { - APP_LOGE("VerifyPermission failed to get bundle manager service"); + HILOG_ERROR("VerifyPermission failed to get bundle manager service"); return AppExecFwk::Constants::PERMISSION_NOT_GRANTED; } std::string bundle_name; if (!ptr->GetBundleNameForUid(uid, bundle_name)) { - APP_LOGE("VerifyPermission failed to get bundle name by uid"); + HILOG_ERROR("VerifyPermission failed to get bundle name by uid"); return AppExecFwk::Constants::PERMISSION_NOT_GRANTED; } - APP_LOGI("%{public}s start bms->CheckPermission. bundle_name=%{public}s", __func__, bundle_name.c_str()); + HILOG_INFO("%{public}s start bms->CheckPermission. bundle_name=%{public}s", __func__, bundle_name.c_str()); int ret = ptr->CheckPermission(bundle_name, permission); - APP_LOGI("%{public}s end bms->CheckPermission, ret=%{public}d", __func__, ret); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end bms->CheckPermission, ret=%{public}d", __func__, ret); + HILOG_INFO("%{public}s end.", __func__); return ret; } @@ -467,28 +467,28 @@ void AbilityContext::GetPermissionDes(const std::string &permissionName, std::st { sptr ptr = GetBundleManager(); if (ptr == nullptr) { - APP_LOGE("GetPermissionDes failed to get bundle manager service"); + HILOG_ERROR("GetPermissionDes failed to get bundle manager service"); return; } PermissionDef permissionDef; - APP_LOGI("%{public}s start bms->GetPermissionDef. permissionName=%{public}s", __func__, permissionName.c_str()); + HILOG_INFO("%{public}s start bms->GetPermissionDef. permissionName=%{public}s", __func__, permissionName.c_str()); if (ptr->GetPermissionDef(permissionName, permissionDef)) { des = permissionDef.description; } - APP_LOGI("%{public}s end bms->GetPermissionDef.", __func__); + HILOG_INFO("%{public}s end bms->GetPermissionDef.", __func__); } void AbilityContext::RequestPermissionsFromUser(std::vector &permissions, int requestCode) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (permissions.size() == 0) { - APP_LOGE("AbilityContext::RequestPermissionsFromUser permissions is empty"); + HILOG_ERROR("AbilityContext::RequestPermissionsFromUser permissions is empty"); return; } if (requestCode < 0) { - APP_LOGE("AbilityContext::RequestPermissionsFromUser requestCode should be >= 0"); + HILOG_ERROR("AbilityContext::RequestPermissionsFromUser requestCode should be >= 0"); return; } @@ -509,7 +509,7 @@ void AbilityContext::RequestPermissionsFromUser(std::vector &permis want.SetParam(OHOS_REQUEST_CALLER_BUNDLERNAME, GetBundleName()); StartAbility(want, requestCode); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } bool AbilityContext::DeleteFile(const std::string &fileName) @@ -532,9 +532,9 @@ Uri AbilityContext::GetCaller() void AbilityContext::AttachBaseContext(const std::shared_ptr &base) { - APP_LOGI("AbilityContext::AttachBaseContext. Start."); + HILOG_INFO("AbilityContext::AttachBaseContext. Start."); ContextContainer::AttachBaseContext(base); - APP_LOGI("AbilityContext::AttachBaseContext. End."); + HILOG_INFO("AbilityContext::AttachBaseContext. End."); } std::string AbilityContext::GetExternalCacheDir() @@ -629,21 +629,21 @@ int AbilityContext::GetThemeId() bool AbilityContext::TerminateAbilityResult(int startId) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); auto abilityClient = AAFwk::AbilityManagerClient::GetInstance(); if (abilityClient == nullptr) { - APP_LOGE("AbilityContext::TerminateAbilityResult abilityClient is nullptr"); + HILOG_ERROR("AbilityContext::TerminateAbilityResult abilityClient is nullptr"); return false; } - APP_LOGI("%{public}s begin ams->TerminateAbilityResult, startId=%{public}d.", __func__, startId); + HILOG_INFO("%{public}s begin ams->TerminateAbilityResult, startId=%{public}d.", __func__, startId); ErrCode errval = abilityClient->TerminateAbilityResult(token_, startId); - APP_LOGI("%{public}s end ams->TerminateAbilityResult, ret=%{public}d.", __func__, errval); + HILOG_INFO("%{public}s end ams->TerminateAbilityResult, ret=%{public}d.", __func__, errval); if (errval != ERR_OK) { - APP_LOGE("AbilityContext::TerminateAbilityResult TerminateAbilityResult retval is %d", errval); + HILOG_ERROR("AbilityContext::TerminateAbilityResult TerminateAbilityResult retval is %d", errval); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return (errval == ERR_OK) ? true : false; } @@ -679,28 +679,28 @@ void AbilityContext::TerminateAndRemoveMission() void AbilityContext::StartAbilities(const std::vector &wants) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); for (auto want : wants) { StartAbility(want, ABILITY_CONTEXT_DEFAULT_REQUEST_CODE); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } bool AbilityContext::IsFirstInMission() { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); auto abilityClient = AAFwk::AbilityManagerClient::GetInstance(); if (abilityClient == nullptr) { - APP_LOGE("AbilityContext::IsFirstInMission abilityClient is nullptr"); + HILOG_ERROR("AbilityContext::IsFirstInMission abilityClient is nullptr"); return false; } - APP_LOGI("%{public}s begin ams->IsFirstInMission.", __func__); + HILOG_INFO("%{public}s begin ams->IsFirstInMission.", __func__); ErrCode errval = abilityClient->IsFirstInMission(token_); - APP_LOGI("%{public}s end ams->IsFirstInMission, ret=%{public}d", __func__, errval); + HILOG_INFO("%{public}s end ams->IsFirstInMission, ret=%{public}d", __func__, errval); if (errval != ERR_OK) { - APP_LOGE("AbilityContext::IsFirstInMission IsFirstInMission retval is %d", errval); + HILOG_ERROR("AbilityContext::IsFirstInMission IsFirstInMission retval is %d", errval); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return (errval == ERR_OK) ? true : false; } diff --git a/frameworks/kits/ability/native/src/ability_impl.cpp b/frameworks/kits/ability/native/src/ability_impl.cpp index e4aed208c0..bf1f2ccf26 100755 --- a/frameworks/kits/ability/native/src/ability_impl.cpp +++ b/frameworks/kits/ability/native/src/ability_impl.cpp @@ -15,9 +15,9 @@ #include "ability_impl.h" -#include "app_log_wrapper.h" #include "bytrace.h" #include "data_ability_predicates.h" +#include "hilog_wrapper.h" #include "values_bucket.h" namespace OHOS { @@ -32,10 +32,10 @@ void AbilityImpl::Init(std::shared_ptr &application, const std: std::shared_ptr &contextDeal) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("AbilityImpl::init begin"); + HILOG_INFO("AbilityImpl::init begin"); if ((token == nullptr) || (application == nullptr) || (handler == nullptr) || (record == nullptr) || ability == nullptr || contextDeal == nullptr) { - APP_LOGE("AbilityImpl::init failed, token is nullptr, application is nullptr, handler is nullptr, record is " + HILOG_ERROR("AbilityImpl::init failed, token is nullptr, application is nullptr, handler is nullptr, record is " "nullptr, ability is nullptr, contextDeal is nullptr"); return; } @@ -54,7 +54,7 @@ void AbilityImpl::Init(std::shared_ptr &application, const std: lifecycleState_ = AAFwk::ABILITY_STATE_INITIAL; abilityLifecycleCallbacks_ = application; contextDeal_ = contextDeal; - APP_LOGI("AbilityImpl::init end"); + HILOG_INFO("AbilityImpl::init end"); } /** @@ -65,9 +65,9 @@ void AbilityImpl::Init(std::shared_ptr &application, const std: */ void AbilityImpl::Start(const Want &want) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (ability_ == nullptr || ability_->GetAbilityInfo() == nullptr || abilityLifecycleCallbacks_ == nullptr) { - APP_LOGE("AbilityImpl::Start ability_ or abilityLifecycleCallbacks_ is nullptr"); + HILOG_ERROR("AbilityImpl::Start ability_ or abilityLifecycleCallbacks_ is nullptr"); return; } @@ -76,7 +76,7 @@ void AbilityImpl::Start(const Want &want) ability_->HandleCreateAsContinuation(want); } - APP_LOGI("AbilityImpl::Start"); + HILOG_INFO("AbilityImpl::Start"); ability_->OnStart(want); if ((ability_->GetAbilityInfo()->type == AppExecFwk::AbilityType::PAGE) && (ability_->GetAbilityInfo()->isStageBasedModel)) { @@ -96,7 +96,7 @@ void AbilityImpl::Start(const Want &want) (!ability_->GetAbilityInfo()->isStageBasedModel)) { WindowEventRegister(); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -106,9 +106,9 @@ void AbilityImpl::Start(const Want &want) */ void AbilityImpl::Stop() { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (ability_ == nullptr || ability_->GetAbilityInfo() == nullptr || abilityLifecycleCallbacks_ == nullptr) { - APP_LOGE("AbilityImpl::Stop ability_ or abilityLifecycleCallbacks_ is nullptr"); + HILOG_ERROR("AbilityImpl::Stop ability_ or abilityLifecycleCallbacks_ is nullptr"); return; } @@ -122,7 +122,7 @@ void AbilityImpl::Stop() abilityLifecycleCallbacks_->OnAbilityStop(ability_); ability_->Destroy(); // Release window and ability. ability_ = nullptr; - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -132,13 +132,13 @@ void AbilityImpl::Stop() */ void AbilityImpl::Active() { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (ability_ == nullptr || ability_->GetAbilityInfo() == nullptr || abilityLifecycleCallbacks_ == nullptr) { - APP_LOGE("AbilityImpl::Active ability_ or abilityLifecycleCallbacks_ is nullptr"); + HILOG_ERROR("AbilityImpl::Active ability_ or abilityLifecycleCallbacks_ is nullptr"); return; } - APP_LOGI("AbilityImpl::Active"); + HILOG_INFO("AbilityImpl::Active"); ability_->OnActive(); if ((lifecycleState_ == AAFwk::ABILITY_STATE_INACTIVE) && (ability_->GetAbilityInfo()->type == AbilityType::PAGE)) { @@ -148,7 +148,7 @@ void AbilityImpl::Active() lifecycleState_ = AAFwk::ABILITY_STATE_ACTIVE; abilityLifecycleCallbacks_->OnAbilityActive(ability_); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -158,13 +158,13 @@ void AbilityImpl::Active() */ void AbilityImpl::Inactive() { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (ability_ == nullptr || ability_->GetAbilityInfo() == nullptr || abilityLifecycleCallbacks_ == nullptr) { - APP_LOGE("AbilityImpl::Inactive ability_ or abilityLifecycleCallbacks_ is nullptr"); + HILOG_ERROR("AbilityImpl::Inactive ability_ or abilityLifecycleCallbacks_ is nullptr"); return; } - APP_LOGI("AbilityImpl::Inactive"); + HILOG_INFO("AbilityImpl::Inactive"); ability_->OnInactive(); if ((lifecycleState_ == AAFwk::ABILITY_STATE_ACTIVE) && (ability_->GetAbilityInfo()->type == AbilityType::PAGE)) { @@ -174,7 +174,7 @@ void AbilityImpl::Inactive() lifecycleState_ = AAFwk::ABILITY_STATE_INACTIVE; abilityLifecycleCallbacks_->OnAbilityInactive(ability_); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } bool AbilityImpl::IsStageBasedModel() const @@ -193,18 +193,18 @@ int AbilityImpl::GetCompatibleVersion() void AbilityImpl::AfterUnFocused() { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (!ability_ || !ability_->GetAbilityInfo() || !contextDeal_ || !handler_) { - APP_LOGE("AbilityImpl::AfterUnFocused failed"); + HILOG_ERROR("AbilityImpl::AfterUnFocused failed"); return; } if (ability_->GetAbilityInfo()->isStageBasedModel) { - APP_LOGI("new version ability, do nothing when after unfocused."); + HILOG_INFO("new version ability, do nothing when after unfocused."); return; } - APP_LOGI("old version ability, window after unfocused."); + HILOG_INFO("old version ability, window after unfocused."); auto task = [abilityImpl = shared_from_this(), ability = ability_, contextDeal = contextDeal_]() { auto info = contextDeal->GetLifeCycleStateInfo(); info.state = AbilityLifeCycleState::ABILITY_STATE_INACTIVE; @@ -212,19 +212,19 @@ void AbilityImpl::AfterUnFocused() abilityImpl->HandleAbilityTransaction(want, info); }; handler_->PostTask(task); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } void AbilityImpl::WindowLifeCycleImpl::AfterForeground() { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); auto owner = owner_.lock(); if (owner && !owner->IsStageBasedModel()) { return; } - APP_LOGI("new version ability, window after foreground."); + HILOG_INFO("new version ability, window after foreground."); PacMap restoreData; AbilityManagerClient::GetInstance()->AbilityTransitionDone(token_, AbilityLifeCycleState::ABILITY_STATE_FOREGROUND_NEW, restoreData); @@ -233,13 +233,13 @@ void AbilityImpl::WindowLifeCycleImpl::AfterForeground() void AbilityImpl::WindowLifeCycleImpl::AfterBackground() { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); auto owner = owner_.lock(); if (owner && !owner->IsStageBasedModel()) { return; } - APP_LOGI("new version ability, window after background."); + HILOG_INFO("new version ability, window after background."); PacMap restoreData; AbilityManagerClient::GetInstance()->AbilityTransitionDone(token_, AbilityLifeCycleState::ABILITY_STATE_BACKGROUND_NEW, restoreData); @@ -247,17 +247,17 @@ void AbilityImpl::WindowLifeCycleImpl::AfterBackground() void AbilityImpl::WindowLifeCycleImpl::AfterFocused() { - APP_LOGI("%{public}s.", __func__); + HILOG_INFO("%{public}s.", __func__); } void AbilityImpl::WindowLifeCycleImpl::AfterUnFocused() { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); auto owner = owner_.lock(); if (owner) { owner->AfterUnFocused(); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -268,13 +268,13 @@ void AbilityImpl::WindowLifeCycleImpl::AfterUnFocused() */ void AbilityImpl::Foreground(const Want &want) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (ability_ == nullptr || ability_->GetAbilityInfo() == nullptr || abilityLifecycleCallbacks_ == nullptr) { - APP_LOGE("AbilityImpl::Foreground ability_ or abilityLifecycleCallbacks_ is nullptr"); + HILOG_ERROR("AbilityImpl::Foreground ability_ or abilityLifecycleCallbacks_ is nullptr"); return; } - APP_LOGI("AbilityImpl::Foreground"); + HILOG_INFO("AbilityImpl::Foreground"); ability_->OnForeground(want); if ((ability_->GetAbilityInfo()->type == AppExecFwk::AbilityType::PAGE) && (ability_->GetAbilityInfo()->isStageBasedModel)) { @@ -283,7 +283,7 @@ void AbilityImpl::Foreground(const Want &want) lifecycleState_ = AAFwk::ABILITY_STATE_INACTIVE; } abilityLifecycleCallbacks_->OnAbilityForeground(ability_); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -293,13 +293,13 @@ void AbilityImpl::Foreground(const Want &want) */ void AbilityImpl::Background() { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (ability_ == nullptr || ability_->GetAbilityInfo() == nullptr || abilityLifecycleCallbacks_ == nullptr) { - APP_LOGE("AbilityImpl::Background ability_ or abilityLifecycleCallbacks_ is nullptr"); + HILOG_ERROR("AbilityImpl::Background ability_ or abilityLifecycleCallbacks_ is nullptr"); return; } - APP_LOGI("AbilityImpl::Background"); + HILOG_INFO("AbilityImpl::Background"); ability_->OnLeaveForeground(); ability_->OnBackground(); if ((ability_->GetAbilityInfo()->type == AppExecFwk::AbilityType::PAGE) && @@ -309,7 +309,7 @@ void AbilityImpl::Background() lifecycleState_ = AAFwk::ABILITY_STATE_BACKGROUND; } abilityLifecycleCallbacks_->OnAbilityBackground(ability_); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -319,15 +319,15 @@ void AbilityImpl::Background() */ void AbilityImpl::DispatchSaveAbilityState() { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (ability_ == nullptr || abilityLifecycleCallbacks_ == nullptr) { - APP_LOGE("AbilityImpl::DispatchSaveAbilityState ability_ or abilityLifecycleCallbacks_ is nullptr"); + HILOG_ERROR("AbilityImpl::DispatchSaveAbilityState ability_ or abilityLifecycleCallbacks_ is nullptr"); return; } - APP_LOGI("AbilityImpl::DispatchSaveAbilityState"); + HILOG_INFO("AbilityImpl::DispatchSaveAbilityState"); needSaveDate_ = true; - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -338,15 +338,15 @@ void AbilityImpl::DispatchSaveAbilityState() */ void AbilityImpl::DispatchRestoreAbilityState(const PacMap &inState) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (ability_ == nullptr) { - APP_LOGE("AbilityImpl::DispatchRestoreAbilityState ability_ is nullptr"); + HILOG_ERROR("AbilityImpl::DispatchRestoreAbilityState ability_ is nullptr"); return; } hasSaveData_ = true; restoreData_ = inState; - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } void AbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::LifeCycleStateInfo &targetState) @@ -360,17 +360,17 @@ void AbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::LifeCy */ sptr AbilityImpl::ConnectAbility(const Want &want) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (ability_ == nullptr) { - APP_LOGE("AbilityImpl::ConnectAbility ability_ is nullptr"); + HILOG_ERROR("AbilityImpl::ConnectAbility ability_ is nullptr"); return nullptr; } - APP_LOGI("AbilityImpl:: ConnectAbility"); + HILOG_INFO("AbilityImpl:: ConnectAbility"); sptr object = ability_->OnConnect(want); lifecycleState_ = AAFwk::ABILITY_STATE_ACTIVE; abilityLifecycleCallbacks_->OnAbilityActive(ability_); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return object; } @@ -382,14 +382,14 @@ sptr AbilityImpl::ConnectAbility(const Want &want) */ void AbilityImpl::DisconnectAbility(const Want &want) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (ability_ == nullptr) { - APP_LOGE("AbilityImpl::DisconnectAbility ability_ is nullptr"); + HILOG_ERROR("AbilityImpl::DisconnectAbility ability_ is nullptr"); return; } ability_->OnDisconnect(want); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -406,17 +406,17 @@ void AbilityImpl::DisconnectAbility(const Want &want) */ void AbilityImpl::CommandAbility(const Want &want, bool restart, int startId) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (ability_ == nullptr) { - APP_LOGE("AbilityImpl::CommandAbility ability_ is nullptr"); + HILOG_ERROR("AbilityImpl::CommandAbility ability_ is nullptr"); return; } - APP_LOGI("AbilityImpl:: CommandAbility"); + HILOG_INFO("AbilityImpl:: CommandAbility"); ability_->OnCommand(want, restart, startId); lifecycleState_ = AAFwk::ABILITY_STATE_ACTIVE; abilityLifecycleCallbacks_->OnAbilityActive(ability_); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -438,7 +438,7 @@ int AbilityImpl::GetCurrentState() */ void AbilityImpl::DoKeyDown(const std::shared_ptr& keyEvent) { - APP_LOGI("AbilityImpl::DoKeyDown called"); + HILOG_INFO("AbilityImpl::DoKeyDown called"); } /** @@ -451,7 +451,7 @@ void AbilityImpl::DoKeyDown(const std::shared_ptr& keyEvent) */ void AbilityImpl::DoKeyUp(const std::shared_ptr& keyEvent) { - APP_LOGI("AbilityImpl::DoKeyUp called"); + HILOG_INFO("AbilityImpl::DoKeyUp called"); } /** @@ -464,7 +464,7 @@ void AbilityImpl::DoKeyUp(const std::shared_ptr& keyEvent) */ void AbilityImpl::DoPointerEvent(std::shared_ptr& pointerEvent) { - APP_LOGI("AbilityImpl::DoPointerEvent called"); + HILOG_INFO("AbilityImpl::DoPointerEvent called"); } /** @@ -480,9 +480,9 @@ void AbilityImpl::DoPointerEvent(std::shared_ptr& pointerEven */ void AbilityImpl::SendResult(int requestCode, int resultCode, const Want &resultData) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (ability_ == nullptr) { - APP_LOGE("AbilityImpl::SendResult ability_ is nullptr"); + HILOG_ERROR("AbilityImpl::SendResult ability_ is nullptr"); return; } @@ -505,24 +505,24 @@ void AbilityImpl::SendResult(int requestCode, int resultCode, const Want &result } grantResult.push_back(intOK); } - APP_LOGI("%{public}s begin OnRequestPermissionsFromUserResult.", __func__); + HILOG_INFO("%{public}s begin OnRequestPermissionsFromUserResult.", __func__); ability_->OnRequestPermissionsFromUserResult(requestCode, permissions, grantResult); - APP_LOGI("%{public}s end OnRequestPermissionsFromUserResult.", __func__); + HILOG_INFO("%{public}s end OnRequestPermissionsFromUserResult.", __func__); } else { - APP_LOGI("%{public}s user cancel permissions.", __func__); + HILOG_INFO("%{public}s user cancel permissions.", __func__); } } else if (resultData.HasParameter(PERMISSION_KEY)) { std::vector permissions = resultData.GetStringArrayParam(PERMISSION_KEY); std::vector grantedResult(permissions.size(), -1); if (resultCode > 0) { grantedResult = resultData.GetIntArrayParam(GRANTED_RESULT_KEY); - APP_LOGI("%{public}s Get user granted result.", __func__); + HILOG_INFO("%{public}s Get user granted result.", __func__); } ability_->OnRequestPermissionsFromUserResult(requestCode, permissions, grantedResult); } else { ability_->OnAbilityResult(requestCode, resultCode, resultData); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -533,14 +533,14 @@ void AbilityImpl::SendResult(int requestCode, int resultCode, const Want &result */ void AbilityImpl::NewWant(const Want &want) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (ability_ == nullptr) { - APP_LOGE("AbilityImpl::NewWant ability_ is nullptr"); + HILOG_ERROR("AbilityImpl::NewWant ability_ is nullptr"); return; } ability_->SetWant(want); ability_->OnNewWant(want); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -553,7 +553,7 @@ void AbilityImpl::NewWant(const Want &want) */ std::vector AbilityImpl::GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) { - APP_LOGI("AbilityImpl::GetFileTypes"); + HILOG_INFO("AbilityImpl::GetFileTypes"); std::vector types; return types; } @@ -571,7 +571,7 @@ std::vector AbilityImpl::GetFileTypes(const Uri &uri, const std::st */ int AbilityImpl::OpenFile(const Uri &uri, const std::string &mode) { - APP_LOGI("AbilityImpl::OpenFile"); + HILOG_INFO("AbilityImpl::OpenFile"); return -1; } @@ -589,7 +589,7 @@ int AbilityImpl::OpenFile(const Uri &uri, const std::string &mode) */ int AbilityImpl::OpenRawFile(const Uri &uri, const std::string &mode) { - APP_LOGI("AbilityImpl::OpenRawFile"); + HILOG_INFO("AbilityImpl::OpenRawFile"); return -1; } @@ -603,7 +603,7 @@ int AbilityImpl::OpenRawFile(const Uri &uri, const std::string &mode) */ int AbilityImpl::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) { - APP_LOGI("AbilityImpl::Insert"); + HILOG_INFO("AbilityImpl::Insert"); return -1; } @@ -619,7 +619,7 @@ int AbilityImpl::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) int AbilityImpl::Update( const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AbilityImpl::Update"); + HILOG_INFO("AbilityImpl::Update"); return -1; } @@ -633,7 +633,7 @@ int AbilityImpl::Update( */ int AbilityImpl::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AbilityImpl::Delete"); + HILOG_INFO("AbilityImpl::Delete"); return -1; } @@ -649,7 +649,7 @@ int AbilityImpl::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates & std::shared_ptr AbilityImpl::Query( const Uri &uri, std::vector &columns, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AbilityImpl::Query"); + HILOG_INFO("AbilityImpl::Query"); return nullptr; } @@ -663,7 +663,7 @@ std::shared_ptr AbilityImpl::Query( */ std::string AbilityImpl::GetType(const Uri &uri) { - APP_LOGI("AbilityImpl::GetType"); + HILOG_INFO("AbilityImpl::GetType"); return ""; } @@ -692,7 +692,7 @@ bool AbilityImpl::Reload(const Uri &uri, const PacMap &extras) */ int AbilityImpl::BatchInsert(const Uri &uri, const std::vector &values) { - APP_LOGI("AbilityImpl::BatchInsert"); + HILOG_INFO("AbilityImpl::BatchInsert"); return -1; } @@ -701,13 +701,13 @@ int AbilityImpl::BatchInsert(const Uri &uri, const std::vectorSerUriString(uri); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -718,7 +718,7 @@ void AbilityImpl::SerUriString(const std::string &uri) void AbilityImpl::SetLifeCycleStateInfo(const AAFwk::LifeCycleStateInfo &info) { if (contextDeal_ == nullptr) { - APP_LOGE("AbilityImpl::SetLifeCycleStateInfo contextDeal_ is nullptr"); + HILOG_ERROR("AbilityImpl::SetLifeCycleStateInfo contextDeal_ is nullptr"); return; } contextDeal_->SetLifeCycleStateInfo(info); @@ -731,21 +731,21 @@ void AbilityImpl::SetLifeCycleStateInfo(const AAFwk::LifeCycleStateInfo &info) */ bool AbilityImpl::CheckAndRestore() { - APP_LOGI("AbilityImpl::CheckAndRestore called start"); + HILOG_INFO("AbilityImpl::CheckAndRestore called start"); if (!hasSaveData_) { - APP_LOGE("AbilityImpl::CheckAndRestore hasSaveData_ is false"); + HILOG_ERROR("AbilityImpl::CheckAndRestore hasSaveData_ is false"); return false; } if (ability_ == nullptr) { - APP_LOGE("AbilityImpl::CheckAndRestore ability_ is nullptr"); + HILOG_ERROR("AbilityImpl::CheckAndRestore ability_ is nullptr"); return false; } - APP_LOGI("AbilityImpl::CheckAndRestore ready to restore"); + HILOG_INFO("AbilityImpl::CheckAndRestore ready to restore"); ability_->OnRestoreAbilityState(restoreData_); - APP_LOGI("AbilityImpl::CheckAndRestore called end"); + HILOG_INFO("AbilityImpl::CheckAndRestore called end"); return true; } @@ -756,24 +756,24 @@ bool AbilityImpl::CheckAndRestore() */ bool AbilityImpl::CheckAndSave() { - APP_LOGI("AbilityImpl::CheckAndSave called start"); + HILOG_INFO("AbilityImpl::CheckAndSave called start"); if (!needSaveDate_) { - APP_LOGE("AbilityImpl::CheckAndSave needSaveDate_ is false"); + HILOG_ERROR("AbilityImpl::CheckAndSave needSaveDate_ is false"); return false; } if (ability_ == nullptr) { - APP_LOGE("AbilityImpl::CheckAndSave ability_ is nullptr"); + HILOG_ERROR("AbilityImpl::CheckAndSave ability_ is nullptr"); return false; } - APP_LOGI("AbilityImpl::CheckAndSave ready to save"); + HILOG_INFO("AbilityImpl::CheckAndSave ready to save"); ability_->OnSaveAbilityState(restoreData_); abilityLifecycleCallbacks_->OnAbilitySaveState(restoreData_); needSaveDate_ = false; - APP_LOGI("AbilityImpl::CheckAndSave called end"); + HILOG_INFO("AbilityImpl::CheckAndSave called end"); return true; } @@ -813,7 +813,7 @@ void AbilityImpl::SetCallingContext( */ Uri AbilityImpl::NormalizeUri(const Uri &uri) { - APP_LOGI("AbilityImpl::NormalizeUri"); + HILOG_INFO("AbilityImpl::NormalizeUri"); return uri; } @@ -829,7 +829,7 @@ Uri AbilityImpl::NormalizeUri(const Uri &uri) */ Uri AbilityImpl::DenormalizeUri(const Uri &uri) { - APP_LOGI("AbilityImpl::DenormalizeUri"); + HILOG_INFO("AbilityImpl::DenormalizeUri"); return uri; } @@ -838,18 +838,18 @@ Uri AbilityImpl::DenormalizeUri(const Uri &uri) */ void AbilityImpl::ScheduleUpdateConfiguration(const Configuration &config) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (ability_ == nullptr) { - APP_LOGE("AbilityImpl::ScheduleUpdateConfiguration ability_ is nullptr"); + HILOG_ERROR("AbilityImpl::ScheduleUpdateConfiguration ability_ is nullptr"); return; } if (lifecycleState_ != AAFwk::ABILITY_STATE_INITIAL) { - APP_LOGI("ability name: [%{public}s]", ability_->GetAbilityName().c_str()); + HILOG_INFO("ability name: [%{public}s]", ability_->GetAbilityName().c_str()); ability_->OnConfigurationUpdatedNotify(config); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } void AbilityImpl::InputEventConsumerImpl::OnInputEvent(std::shared_ptr keyEvent) const @@ -857,16 +857,16 @@ void AbilityImpl::InputEventConsumerImpl::OnInputEvent(std::shared_ptrGetKeyAction(); if (code == MMI::KeyEvent::KEY_ACTION_DOWN) { abilityImpl_->DoKeyDown(keyEvent); - APP_LOGI("AbilityImpl::OnKeyDown keyAction: %{public}d.", code); + HILOG_INFO("AbilityImpl::OnKeyDown keyAction: %{public}d.", code); } else if (code == MMI::KeyEvent::KEY_ACTION_UP) { abilityImpl_->DoKeyUp(keyEvent); - APP_LOGI("AbilityImpl::DoKeyUp keyAction: %{public}d.", code); + HILOG_INFO("AbilityImpl::DoKeyUp keyAction: %{public}d.", code); } } void AbilityImpl::InputEventConsumerImpl::OnInputEvent(std::shared_ptr pointerEvent) const { - APP_LOGI("AbilityImpl::DoPointerEvent called."); + HILOG_INFO("AbilityImpl::DoPointerEvent called."); abilityImpl_->DoPointerEvent(pointerEvent); } @@ -875,7 +875,7 @@ void AbilityImpl::InputEventConsumerImpl::OnInputEvent(std::shared_ptrGetAbilityInfo()->isStageBasedModel) { auto window = ability_->GetWindow(); if (window) { @@ -894,7 +894,7 @@ void AbilityImpl::WindowEventRegister() std::shared_ptr AbilityImpl::CreatePostEventTimeouter(std::string taskstr) { if (ability_ == nullptr) { - APP_LOGE("AbilityImpl::CreatePostEventTimeouter ability_ is nullptr"); + HILOG_ERROR("AbilityImpl::CreatePostEventTimeouter ability_ is nullptr"); return nullptr; } @@ -904,7 +904,7 @@ std::shared_ptr AbilityImpl::CreatePostEventTimeouter(s std::vector> AbilityImpl::ExecuteBatch( const std::vector> &operations) { - APP_LOGI("AbilityImpl::ExecuteBatch"); + HILOG_INFO("AbilityImpl::ExecuteBatch"); std::vector> results; return results; } @@ -912,7 +912,7 @@ std::vector> AbilityImpl::ExecuteBatch( void AbilityImpl::ContinueAbility(const std::string& deviceId) { if (ability_ == nullptr) { - APP_LOGE("AbilityImpl::ContinueAbility ability_ is nullptr"); + HILOG_ERROR("AbilityImpl::ContinueAbility ability_ is nullptr"); return; } ability_->ContinueAbilityWithStack(deviceId); @@ -921,7 +921,7 @@ void AbilityImpl::ContinueAbility(const std::string& deviceId) void AbilityImpl::NotifyContinuationResult(int32_t result) { if (ability_ == nullptr) { - APP_LOGE("AbilityImpl::NotifyContinuationResult ability_ is nullptr"); + HILOG_ERROR("AbilityImpl::NotifyContinuationResult ability_ is nullptr"); return; } ability_->OnCompleteContinuation(result); diff --git a/frameworks/kits/ability/native/src/ability_impl_factory.cpp b/frameworks/kits/ability/native/src/ability_impl_factory.cpp index 0db5e6c59b..8453ecae0f 100644 --- a/frameworks/kits/ability/native/src/ability_impl_factory.cpp +++ b/frameworks/kits/ability/native/src/ability_impl_factory.cpp @@ -14,8 +14,8 @@ */ #include "ability_impl_factory.h" -#include "app_log_wrapper.h" #include "data_ability_impl.h" +#include "hilog_wrapper.h" #include "new_ability_impl.h" #include "page_ability_impl.h" #include "service_ability_impl.h" @@ -49,12 +49,12 @@ std::shared_ptr AbilityImplFactory::MakeAbilityImplObject(const std int compatibleVersion) { if (info == nullptr) { - APP_LOGE("AbilityImplFactory::MakeAbilityImplObject is error nullptr == info "); + HILOG_ERROR("AbilityImplFactory::MakeAbilityImplObject is error nullptr == info "); return nullptr; } std::shared_ptr abilityImpl = nullptr; - APP_LOGI("AbilityImplFactory::MakeAbilityImplObject type:%{public}d, isStageBasedModel:%{public}d", info->type, + HILOG_INFO("AbilityImplFactory::MakeAbilityImplObject type:%{public}d, isStageBasedModel:%{public}d", info->type, info->isStageBasedModel); switch (info->type) { case AppExecFwk::AbilityType::PAGE: @@ -71,7 +71,7 @@ std::shared_ptr AbilityImplFactory::MakeAbilityImplObject(const std abilityImpl = std::make_shared(); break; default: - APP_LOGE("AbilityImplFactory::MakeAbilityImplObject is error"); + HILOG_ERROR("AbilityImplFactory::MakeAbilityImplObject is error"); break; } diff --git a/frameworks/kits/ability/native/src/ability_lifecycle.cpp b/frameworks/kits/ability/native/src/ability_lifecycle.cpp index 28c7ee112f..7995fd027a 100644 --- a/frameworks/kits/ability/native/src/ability_lifecycle.cpp +++ b/frameworks/kits/ability/native/src/ability_lifecycle.cpp @@ -14,7 +14,7 @@ */ #include "ability_lifecycle_observer_interface.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -29,7 +29,7 @@ namespace AppExecFwk { */ LifeCycle::Event LifeCycle::GetLifecycleState() { - APP_LOGI("LifeCycle::GetLifecycleState: called"); + HILOG_INFO("LifeCycle::GetLifecycleState: called"); return state_; } @@ -43,10 +43,10 @@ LifeCycle::Event LifeCycle::GetLifecycleState() */ void LifeCycle::AddObserver(const std::shared_ptr &observer) { - APP_LOGI("LifeCycle::AddObserver: called"); + HILOG_INFO("LifeCycle::AddObserver: called"); if (observer == nullptr) { - APP_LOGI("LifeCycle::AddObserver: observer is null"); + HILOG_INFO("LifeCycle::AddObserver: observer is null"); return; } @@ -61,9 +61,9 @@ void LifeCycle::AddObserver(const std::shared_ptr &observer) */ void LifeCycle::DispatchLifecycle(const LifeCycle::Event &event, const Want &want) { - APP_LOGI("LifeCycle::DispatchLifecycle: event:%{public}d", event); + HILOG_INFO("LifeCycle::DispatchLifecycle: event:%{public}d", event); if ((event != LifeCycle::Event::ON_FOREGROUND) && (event != LifeCycle::Event::ON_START)) { - APP_LOGE("event value error: event is %{public}d", event); + HILOG_ERROR("event value error: event is %{public}d", event); return; } @@ -100,10 +100,10 @@ void LifeCycle::DispatchLifecycle(const LifeCycle::Event &event, const Want &wan */ void LifeCycle::DispatchLifecycle(const LifeCycle::Event &event) { - APP_LOGI("LifeCycle::DispatchLifecycle: event:%{public}d", event); + HILOG_INFO("LifeCycle::DispatchLifecycle: event:%{public}d", event); if ((event != LifeCycle::Event::ON_ACTIVE) && (event != LifeCycle::Event::ON_BACKGROUND) && (event != LifeCycle::Event::ON_INACTIVE) && (event != LifeCycle::Event::ON_STOP)) { - APP_LOGE("event value error: event is %{public}d", event); + HILOG_ERROR("event value error: event is %{public}d", event); return; } @@ -155,10 +155,10 @@ void LifeCycle::DispatchLifecycle(const LifeCycle::Event &event) */ void LifeCycle::RemoveObserver(const std::shared_ptr &observer) { - APP_LOGI("LifeCycle::RemoveObserver: called"); + HILOG_INFO("LifeCycle::RemoveObserver: called"); if (observer == nullptr) { - APP_LOGI("LifeCycle::RemoveObserver: observer is null"); + HILOG_INFO("LifeCycle::RemoveObserver: observer is null"); return; } diff --git a/frameworks/kits/ability/native/src/ability_loader.cpp b/frameworks/kits/ability/native/src/ability_loader.cpp index d7c1f8ba0e..70dabbd9f1 100644 --- a/frameworks/kits/ability/native/src/ability_loader.cpp +++ b/frameworks/kits/ability/native/src/ability_loader.cpp @@ -14,7 +14,7 @@ */ #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -33,7 +33,7 @@ AbilityLoader &AbilityLoader::GetInstance() void AbilityLoader::RegisterAbility(const std::string &abilityName, const CreateAblity &createFunc) { abilities_.emplace(abilityName, createFunc); - APP_LOGD("AbilityLoader::RegisterAbility:%{public}s", abilityName.c_str()); + HILOG_DEBUG("AbilityLoader::RegisterAbility:%{public}s", abilityName.c_str()); } /** @@ -45,7 +45,7 @@ void AbilityLoader::RegisterAbility(const std::string &abilityName, const Create void AbilityLoader::RegisterExtension(const std::string &abilityName, const CreateExtension &createFunc) { extensions_.emplace(abilityName, createFunc); - APP_LOGD("AbilityLoader::RegisterExtension:%{public}s", abilityName.c_str()); + HILOG_DEBUG("AbilityLoader::RegisterExtension:%{public}s", abilityName.c_str()); } /** @@ -61,7 +61,7 @@ Ability *AbilityLoader::GetAbilityByName(const std::string &abilityName) if (it != abilities_.end()) { return it->second(); } else { - APP_LOGE("AbilityLoader::GetAbilityByName failed:%{public}s", abilityName.c_str()); + HILOG_ERROR("AbilityLoader::GetAbilityByName failed:%{public}s", abilityName.c_str()); } return nullptr; } @@ -79,7 +79,7 @@ AbilityRuntime::Extension *AbilityLoader::GetExtensionByName(const std::string & if (it != extensions_.end()) { return it->second(); } else { - APP_LOGE("AbilityLoader::GetExtensionByName failed:%{public}s", abilityName.c_str()); + HILOG_ERROR("AbilityLoader::GetExtensionByName failed:%{public}s", abilityName.c_str()); } return nullptr; } diff --git a/frameworks/kits/ability/native/src/ability_post_event_timeout.cpp b/frameworks/kits/ability/native/src/ability_post_event_timeout.cpp index bb80e5676d..5a61b3c28d 100644 --- a/frameworks/kits/ability/native/src/ability_post_event_timeout.cpp +++ b/frameworks/kits/ability/native/src/ability_post_event_timeout.cpp @@ -13,10 +13,10 @@ * limitations under the License. */ -#include "app_log_wrapper.h" #include "ability_post_event_timeout.h" #include "ability_handler.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -40,9 +40,9 @@ AbilityPostEventTimeout::~AbilityPostEventTimeout() void AbilityPostEventTimeout::TimingBegin(int64_t delaytime) { - APP_LOGI("AbilityPostEventTimeout::TimingBegin() call %{public}s", task_.c_str()); + HILOG_INFO("AbilityPostEventTimeout::TimingBegin() call %{public}s", task_.c_str()); if (handler_ == nullptr) { - APP_LOGE("AbilityPostEventTimeout::TimingBegin %{public}s handler_ is nullptr", task_.c_str()); + HILOG_ERROR("AbilityPostEventTimeout::TimingBegin %{public}s handler_ is nullptr", task_.c_str()); return; } @@ -52,7 +52,7 @@ void AbilityPostEventTimeout::TimingBegin(int64_t delaytime) void AbilityPostEventTimeout::TimeEnd() { if (handler_ == nullptr) { - APP_LOGE("AbilityPostEventTimeout::TimeEnd %{public}s handler_ is nullptr", task_.c_str()); + HILOG_ERROR("AbilityPostEventTimeout::TimeEnd %{public}s handler_ is nullptr", task_.c_str()); return; } @@ -65,19 +65,19 @@ void AbilityPostEventTimeout::TimeEnd() void AbilityPostEventTimeout::TimeOutProc() { - APP_LOGI("AbilityPostEventTimeout::TimeOutProc() call %{public}s", task_.c_str()); + HILOG_INFO("AbilityPostEventTimeout::TimeOutProc() call %{public}s", task_.c_str()); if (handler_ == nullptr) { - APP_LOGE("AbilityPostEventTimeout::TimeEnd %{public}s handler_ is nullptr", task_.c_str()); + HILOG_ERROR("AbilityPostEventTimeout::TimeEnd %{public}s handler_ is nullptr", task_.c_str()); return; } std::lock_guard lck(mtx_); if (!taskExec_) { taskExec_ = true; - APP_LOGW("TimeOutProc %{public}s Event TimeOut", task_.c_str()); + HILOG_WARN("TimeOutProc %{public}s Event TimeOut", task_.c_str()); handler_->RemoveTask(task_); } else { - APP_LOGW("AbilityPostEventTimeout::TimeOutProc Exec Failed, The Event is %{public}s", task_.c_str()); + HILOG_WARN("AbilityPostEventTimeout::TimeOutProc Exec Failed, The Event is %{public}s", task_.c_str()); } } diff --git a/frameworks/kits/ability/native/src/ability_process.cpp b/frameworks/kits/ability/native/src/ability_process.cpp index 2f72f04fc9..4f042e4066 100644 --- a/frameworks/kits/ability/native/src/ability_process.cpp +++ b/frameworks/kits/ability/native/src/ability_process.cpp @@ -17,7 +17,7 @@ #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { static void *g_handle = nullptr; @@ -55,9 +55,9 @@ AbilityProcess::~AbilityProcess() ErrCode AbilityProcess::StartAbility(Ability *ability, CallAbilityParam param, CallbackInfo callback) { - APP_LOGI("AbilityProcess::StartAbility begin"); + HILOG_INFO("AbilityProcess::StartAbility begin"); if (ability == nullptr) { - APP_LOGE("AbilityProcess::StartAbility ability is nullptr"); + HILOG_ERROR("AbilityProcess::StartAbility ability is nullptr"); return ERR_NULL_OBJECT; } @@ -67,15 +67,15 @@ ErrCode AbilityProcess::StartAbility(Ability *ability, CallAbilityParam param, C windowMode == AbilityWindowConfiguration::MULTI_WINDOW_DISPLAY_SECONDARY) { param.want.SetParam(Want::PARAM_RESV_WINDOW_MODE, windowMode); } - APP_LOGI("window mode is %{public}d", windowMode); + HILOG_INFO("window mode is %{public}d", windowMode); ErrCode err = ERR_OK; if (param.forResultOption == true) { if (param.setting == nullptr) { - APP_LOGI("%{public}s param.setting == nullptr call StartAbilityForResult.", __func__); + HILOG_INFO("%{public}s param.setting == nullptr call StartAbilityForResult.", __func__); err = ability->StartAbilityForResult(param.want, param.requestCode); } else { - APP_LOGI("%{public}s param.setting != nullptr call StartAbilityForResult.", __func__); + HILOG_INFO("%{public}s param.setting != nullptr call StartAbilityForResult.", __func__); err = ability->StartAbilityForResult(param.want, param.requestCode, *(param.setting)); } @@ -84,9 +84,9 @@ ErrCode AbilityProcess::StartAbility(Ability *ability, CallAbilityParam param, C std::map map; auto it = abilityResultMap_.find(ability); if (it == abilityResultMap_.end()) { - APP_LOGI("AbilityProcess::StartAbility ability: %{public}p is not in the abilityResultMap_", ability); + HILOG_INFO("AbilityProcess::StartAbility ability: %{public}p is not in the abilityResultMap_", ability); } else { - APP_LOGI("AbilityProcess::StartAbility ability: %{public}p is in the abilityResultMap_", ability); + HILOG_INFO("AbilityProcess::StartAbility ability: %{public}p is in the abilityResultMap_", ability); map = it->second; } callback.errCode = err; @@ -94,33 +94,33 @@ ErrCode AbilityProcess::StartAbility(Ability *ability, CallAbilityParam param, C abilityResultMap_[ability] = map; } else { if (param.setting == nullptr) { - APP_LOGI("%{public}s param.setting == nullptr call StartAbility.", __func__); + HILOG_INFO("%{public}s param.setting == nullptr call StartAbility.", __func__); err = ability->StartAbility(param.want); } else { - APP_LOGI("%{public}s param.setting != nullptr call StartAbility.", __func__); + HILOG_INFO("%{public}s param.setting != nullptr call StartAbility.", __func__); err = ability->StartAbility(param.want, *(param.setting)); } } - APP_LOGI("AbilityProcess::StartAbility end"); + HILOG_INFO("AbilityProcess::StartAbility end"); return err; } void AbilityProcess::OnAbilityResult(Ability *ability, int requestCode, int resultCode, const Want &resultData) { - APP_LOGI("AbilityProcess::OnAbilityResult begin"); + HILOG_INFO("AbilityProcess::OnAbilityResult begin"); std::lock_guard lock_l(mutex_); auto it = abilityResultMap_.find(ability); if (it == abilityResultMap_.end()) { - APP_LOGE("AbilityProcess::OnAbilityResult ability: %{public}p is not in the abilityResultMap", ability); + HILOG_ERROR("AbilityProcess::OnAbilityResult ability: %{public}p is not in the abilityResultMap", ability); return; } std::map map = it->second; auto callback = map.find(requestCode); if (callback == map.end()) { - APP_LOGE("AbilityProcess::OnAbilityResult requestCode: %{public}d is not in the map", requestCode); + HILOG_ERROR("AbilityProcess::OnAbilityResult requestCode: %{public}d is not in the map", requestCode); return; } CallbackInfo callbackInfo = callback->second; @@ -129,7 +129,7 @@ void AbilityProcess::OnAbilityResult(Ability *ability, int requestCode, int resu if (g_handle == nullptr) { g_handle = dlopen(SHARED_LIBRARY_FEATURE_ABILITY, RTLD_LAZY); if (g_handle == nullptr) { - APP_LOGE("%{public}s, dlopen failed %{public}s. %{public}s", + HILOG_ERROR("%{public}s, dlopen failed %{public}s. %{public}s", __func__, SHARED_LIBRARY_FEATURE_ABILITY, dlerror()); @@ -140,7 +140,8 @@ void AbilityProcess::OnAbilityResult(Ability *ability, int requestCode, int resu // get function auto func = reinterpret_cast(dlsym(g_handle, FUNC_CALL_ON_ABILITY_RESULT)); if (func == nullptr) { - APP_LOGE("%{public}s, dlsym failed %{public}s. %{public}s", __func__, FUNC_CALL_ON_ABILITY_RESULT, dlerror()); + HILOG_ERROR( + "%{public}s, dlsym failed %{public}s. %{public}s", __func__, FUNC_CALL_ON_ABILITY_RESULT, dlerror()); dlclose(g_handle); g_handle = nullptr; return; @@ -150,15 +151,15 @@ void AbilityProcess::OnAbilityResult(Ability *ability, int requestCode, int resu map.erase(requestCode); abilityResultMap_[ability] = map; - APP_LOGI("AbilityProcess::OnAbilityResult end"); + HILOG_INFO("AbilityProcess::OnAbilityResult end"); } void AbilityProcess::RequestPermissionsFromUser( Ability *ability, CallAbilityPermissionParam ¶m, CallbackInfo callbackInfo) { - APP_LOGI("AbilityProcess::RequestPermissionsFromUser begin"); + HILOG_INFO("AbilityProcess::RequestPermissionsFromUser begin"); if (ability == nullptr) { - APP_LOGE("AbilityProcess::RequestPermissionsFromUser ability is nullptr"); + HILOG_ERROR("AbilityProcess::RequestPermissionsFromUser ability is nullptr"); return; } @@ -169,11 +170,11 @@ void AbilityProcess::RequestPermissionsFromUser( std::map map; auto it = abilityRequestPermissionsForUserMap_.find(ability); if (it == abilityRequestPermissionsForUserMap_.end()) { - APP_LOGI("AbilityProcess::RequestPermissionsFromUser ability: %{public}p is not in the " + HILOG_INFO("AbilityProcess::RequestPermissionsFromUser ability: %{public}p is not in the " "abilityRequestPermissionsForUserMap_", ability); } else { - APP_LOGI("AbilityProcess::RequestPermissionsFromUser ability: %{public}p is in the " + HILOG_INFO("AbilityProcess::RequestPermissionsFromUser ability: %{public}p is in the " "abilityRequestPermissionsForUserMap_", ability); map = it->second; @@ -182,15 +183,15 @@ void AbilityProcess::RequestPermissionsFromUser( map[param.requestCode] = callbackInfo; abilityRequestPermissionsForUserMap_[ability] = map; } - APP_LOGI("AbilityProcess::RequestPermissionsFromUser end"); + HILOG_INFO("AbilityProcess::RequestPermissionsFromUser end"); } void AbilityProcess::OnRequestPermissionsFromUserResult(Ability *ability, int requestCode, const std::vector &permissions, const std::vector &grantResults) { - APP_LOGI("AbilityProcess::OnRequestPermissionsFromUserResult begin"); + HILOG_INFO("AbilityProcess::OnRequestPermissionsFromUserResult begin"); if (ability == nullptr) { - APP_LOGE("AbilityProcess::OnRequestPermissionsFromUserResult ability is nullptr"); + HILOG_ERROR("AbilityProcess::OnRequestPermissionsFromUserResult ability is nullptr"); return; } @@ -198,7 +199,7 @@ void AbilityProcess::OnRequestPermissionsFromUserResult(Ability *ability, int re auto it = abilityRequestPermissionsForUserMap_.find(ability); if (it == abilityRequestPermissionsForUserMap_.end()) { - APP_LOGE("AbilityProcess::OnRequestPermissionsFromUserResult ability: %{public}p is not in the " + HILOG_ERROR("AbilityProcess::OnRequestPermissionsFromUserResult ability: %{public}p is not in the " "abilityRequestPermissionsForUserMap_", ability); return; @@ -207,7 +208,7 @@ void AbilityProcess::OnRequestPermissionsFromUserResult(Ability *ability, int re auto callback = map.find(requestCode); if (callback == map.end()) { - APP_LOGE("AbilityProcess::OnRequestPermissionsFromUserResult requestCode: %{public}d is not in the map", + HILOG_ERROR("AbilityProcess::OnRequestPermissionsFromUserResult requestCode: %{public}d is not in the map", requestCode); return; } @@ -217,7 +218,7 @@ void AbilityProcess::OnRequestPermissionsFromUserResult(Ability *ability, int re if (g_handle == nullptr) { g_handle = dlopen(SHARED_LIBRARY_FEATURE_ABILITY, RTLD_LAZY); if (g_handle == nullptr) { - APP_LOGE("%{public}s, dlopen failed %{public}s. %{public}s", + HILOG_ERROR("%{public}s, dlopen failed %{public}s. %{public}s", __func__, SHARED_LIBRARY_FEATURE_ABILITY, dlerror()); @@ -229,7 +230,7 @@ void AbilityProcess::OnRequestPermissionsFromUserResult(Ability *ability, int re auto func = reinterpret_cast( dlsym(g_handle, FUNC_CALL_ON_REQUEST_PERMISSIONS_FROM_USERRESULT)); if (func == nullptr) { - APP_LOGE("%{public}s, dlsym failed %{public}s. %{public}s", + HILOG_ERROR("%{public}s, dlsym failed %{public}s. %{public}s", __func__, FUNC_CALL_ON_REQUEST_PERMISSIONS_FROM_USERRESULT, dlerror()); @@ -241,7 +242,7 @@ void AbilityProcess::OnRequestPermissionsFromUserResult(Ability *ability, int re map.erase(requestCode); abilityRequestPermissionsForUserMap_[ability] = map; - APP_LOGI("AbilityProcess::OnRequestPermissionsFromUserResult end"); + HILOG_INFO("AbilityProcess::OnRequestPermissionsFromUserResult end"); } } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file diff --git a/frameworks/kits/ability/native/src/ability_thread.cpp b/frameworks/kits/ability/native/src/ability_thread.cpp index d177a6aded..6968a77063 100644 --- a/frameworks/kits/ability/native/src/ability_thread.cpp +++ b/frameworks/kits/ability/native/src/ability_thread.cpp @@ -20,12 +20,12 @@ #include "ability_loader.h" #include "ability_state.h" #include "abs_shared_result_set.h" -#include "app_log_wrapper.h" #include "application_impl.h" #include "bytrace.h" #include "context_deal.h" #include "data_ability_predicates.h" #include "dataobs_mgr_client.h" +#include "hilog_wrapper.h" #include "ohos_application.h" #include "page_ability_impl.h" #include "values_bucket.h" @@ -70,23 +70,23 @@ AbilityThread::~AbilityThread() std::string AbilityThread::CreateAbilityName(const std::shared_ptr &abilityRecord) { std::string abilityName; - APP_LOGI("AbilityThread::CreateAbilityName begin"); + HILOG_INFO("AbilityThread::CreateAbilityName begin"); if (abilityRecord == nullptr) { - APP_LOGE("AbilityThread::CreateAbilityName failed,abilityRecord is nullptr"); + HILOG_ERROR("AbilityThread::CreateAbilityName failed,abilityRecord is nullptr"); return abilityName; } std::shared_ptr abilityInfo = abilityRecord->GetAbilityInfo(); if (abilityInfo == nullptr) { - APP_LOGE("AbilityThread::ability attach failed,abilityInfo is nullptr"); + HILOG_ERROR("AbilityThread::ability attach failed,abilityInfo is nullptr"); return abilityName; } - APP_LOGI("AbilityThread::ability attach the ability type is %{public}d", abilityInfo->type); - APP_LOGI("AbilityThread::ability attach the ability is Native %{public}d", abilityInfo->isNativeAbility); + HILOG_INFO("AbilityThread::ability attach the ability type is %{public}d", abilityInfo->type); + HILOG_INFO("AbilityThread::ability attach the ability is Native %{public}d", abilityInfo->isNativeAbility); if (abilityInfo->isNativeAbility) { - APP_LOGI("AbilityThread::CreateAbilityName end, create native ability."); + HILOG_INFO("AbilityThread::CreateAbilityName end, create native ability."); return abilityInfo->name; } @@ -124,12 +124,12 @@ std::string AbilityThread::CreateAbilityName(const std::shared_ptrextensionAbilityType == ExtensionAbilityType::WALLPAPER) { abilityName = WALLPAPER_EXTENSION; } - APP_LOGI("CreateAbilityName extension type, abilityName:%{public}s", abilityName.c_str()); + HILOG_INFO("CreateAbilityName extension type, abilityName:%{public}s", abilityName.c_str()); } else { abilityName = abilityInfo->name; } - APP_LOGI("AbilityThread::CreateAbilityName end"); + HILOG_INFO("AbilityThread::CreateAbilityName end"); return abilityName; } @@ -146,17 +146,17 @@ std::string AbilityThread::CreateAbilityName(const std::shared_ptr AbilityThread::CreateAndInitContextDeal(std::shared_ptr &application, const std::shared_ptr &abilityRecord, const std::shared_ptr &abilityObject) { - APP_LOGI("AbilityThread::CreateAndInitContextDeal begin"); + HILOG_INFO("AbilityThread::CreateAndInitContextDeal begin"); std::shared_ptr contextDeal = nullptr; - APP_LOGI("AbilityThread::CreateAndInitContextDeal called"); + HILOG_INFO("AbilityThread::CreateAndInitContextDeal called"); if ((application == nullptr) || (abilityRecord == nullptr) || (abilityObject == nullptr)) { - APP_LOGE("AbilityThread::ability attach failed,context or record or abilityObject is nullptr"); + HILOG_ERROR("AbilityThread::ability attach failed,context or record or abilityObject is nullptr"); return contextDeal; } contextDeal = std::make_shared(); if (contextDeal == nullptr) { - APP_LOGE("AbilityThread::ability attach failed,contextDeal is nullptr"); + HILOG_ERROR("AbilityThread::ability attach failed,contextDeal is nullptr"); return contextDeal; } @@ -170,7 +170,7 @@ std::shared_ptr AbilityThread::CreateAndInitContextDeal(std::shared contextDeal->SetBundleCodePath(abilityRecord->GetAbilityInfo()->codePath); contextDeal->SetContext(abilityObject); contextDeal->SetRunner(abilityHandler_->GetEventRunner()); - APP_LOGI("AbilityThread::CreateAndInitContextDeal end"); + HILOG_INFO("AbilityThread::CreateAndInitContextDeal end"); return contextDeal; } @@ -185,9 +185,9 @@ void AbilityThread::Attach(std::shared_ptr &application, const std::shared_ptr &stageContext) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("AbilityThread::Attach begin"); + HILOG_INFO("AbilityThread::Attach begin"); if ((application == nullptr) || (abilityRecord == nullptr) || (mainRunner == nullptr)) { - APP_LOGE("AbilityThread::ability attach failed,context or record is nullptr"); + HILOG_ERROR("AbilityThread::ability attach failed,context or record is nullptr"); return; } @@ -195,19 +195,19 @@ void AbilityThread::Attach(std::shared_ptr &application, std::string abilityName = CreateAbilityName(abilityRecord); abilityHandler_ = std::make_shared(mainRunner, this); if (abilityHandler_ == nullptr) { - APP_LOGE("AbilityThread::ability attach failed,abilityHandler_ is nullptr"); + HILOG_ERROR("AbilityThread::ability attach failed,abilityHandler_ is nullptr"); return; } // 2.new ability auto ability = AbilityLoader::GetInstance().GetAbilityByName(abilityName); if (ability == nullptr) { - APP_LOGE("AbilityThread::ability attach failed,load ability failed"); + HILOG_ERROR("AbilityThread::ability attach failed,load ability failed"); return; } ability->SetCompatibleVersion(abilityRecord->GetCompatibleVersion()); - APP_LOGI("AbilityThread::new ability success."); + HILOG_INFO("AbilityThread::new ability success."); currentAbility_.reset(ability); token_ = abilityRecord->GetToken(); abilityRecord->SetEventHandler(abilityHandler_); @@ -226,22 +226,22 @@ void AbilityThread::Attach(std::shared_ptr &application, DelayedSingleton::GetInstance()->MakeAbilityImplObject(abilityRecord->GetAbilityInfo(), abilityRecord->GetCompatibleVersion()); if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::ability abilityImpl_ == nullptr"); + HILOG_ERROR("AbilityThread::ability abilityImpl_ == nullptr"); return; } - APP_LOGI("AbilityThread::Attach before abilityImpl_->Init"); + HILOG_INFO("AbilityThread::Attach before abilityImpl_->Init"); abilityImpl_->Init(application, abilityRecord, currentAbility_, abilityHandler_, token_, contextDeal); - APP_LOGI("AbilityThread::Attach after abilityImpl_->Init"); + HILOG_INFO("AbilityThread::Attach after abilityImpl_->Init"); // 4. ability attach : ipc - APP_LOGI("AbilityThread::Attach before AttachAbilityThread"); + HILOG_INFO("AbilityThread::Attach before AttachAbilityThread"); ErrCode err = AbilityManagerClient::GetInstance()->AttachAbilityThread(this, token_); - APP_LOGI("AbilityThread::Attach after AttachAbilityThread"); + HILOG_INFO("AbilityThread::Attach after AttachAbilityThread"); if (err != ERR_OK) { - APP_LOGE("AbilityThread:: attach success failed err = %{public}d", err); + HILOG_ERROR("AbilityThread:: attach success failed err = %{public}d", err); return; } - APP_LOGI("AbilityThread::Attach end"); + HILOG_INFO("AbilityThread::Attach end"); } /** @@ -254,9 +254,9 @@ void AbilityThread::AttachExtension(std::shared_ptr &applicatio const std::shared_ptr &abilityRecord, const std::shared_ptr &mainRunner) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("AbilityThread::AttachExtension begin"); + HILOG_INFO("AbilityThread::AttachExtension begin"); if ((application == nullptr) || (abilityRecord == nullptr) || (mainRunner == nullptr)) { - APP_LOGE("AbilityThread::AttachExtension attach failed,context or record is nullptr"); + HILOG_ERROR("AbilityThread::AttachExtension attach failed,context or record is nullptr"); return; } @@ -264,18 +264,18 @@ void AbilityThread::AttachExtension(std::shared_ptr &applicatio std::string abilityName = CreateAbilityName(abilityRecord); abilityHandler_ = std::make_shared(mainRunner, this); if (abilityHandler_ == nullptr) { - APP_LOGE("AbilityThread::AttachExtension attach failed,abilityHandler_ is nullptr"); + HILOG_ERROR("AbilityThread::AttachExtension attach failed,abilityHandler_ is nullptr"); return; } // 2.new ability auto extension = AbilityLoader::GetInstance().GetExtensionByName(abilityName); if (extension == nullptr) { - APP_LOGE("AbilityThread::AttachExtension attach failed,load ability failed"); + HILOG_ERROR("AbilityThread::AttachExtension attach failed,load ability failed"); return; } - APP_LOGI("AbilityThread::new extension success."); + HILOG_INFO("AbilityThread::new extension success."); currentExtension_.reset(extension); token_ = abilityRecord->GetToken(); abilityRecord->SetEventHandler(abilityHandler_); @@ -283,20 +283,20 @@ void AbilityThread::AttachExtension(std::shared_ptr &applicatio abilityRecord->SetAbilityThread(this); extensionImpl_ = std::make_shared(); if (extensionImpl_ == nullptr) { - APP_LOGE("AbilityThread::extension extensionImpl_ == nullptr"); + HILOG_ERROR("AbilityThread::extension extensionImpl_ == nullptr"); return; } // 3.new init - APP_LOGI("AbilityThread::extensionImpl_ init."); + HILOG_INFO("AbilityThread::extensionImpl_ init."); extensionImpl_->Init(application, abilityRecord, currentExtension_, abilityHandler_, token_); // 4.ipc attach init ErrCode err = AbilityManagerClient::GetInstance()->AttachAbilityThread(this, token_); - APP_LOGI("AbilityThread::AttachExtension after AttachAbilityThread"); + HILOG_INFO("AbilityThread::AttachExtension after AttachAbilityThread"); if (err != ERR_OK) { - APP_LOGE("AbilityThread:: attach extension success failed err = %{public}d", err); + HILOG_ERROR("AbilityThread:: attach extension success failed err = %{public}d", err); return; } - APP_LOGI("AbilityThread::AttachExtension end"); + HILOG_INFO("AbilityThread::AttachExtension end"); } /** @@ -309,9 +309,9 @@ void AbilityThread::AttachExtension(std::shared_ptr &applicatio const std::shared_ptr &abilityRecord) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("AbilityThread::AttachExtension begin"); + HILOG_INFO("AbilityThread::AttachExtension begin"); if ((application == nullptr) || (abilityRecord == nullptr)) { - APP_LOGE("AbilityThread::AttachExtension failed,context or record is nullptr"); + HILOG_ERROR("AbilityThread::AttachExtension failed,context or record is nullptr"); return; } @@ -319,23 +319,23 @@ void AbilityThread::AttachExtension(std::shared_ptr &applicatio std::string abilityName = CreateAbilityName(abilityRecord); runner_ = EventRunner::Create(abilityName); if (runner_ == nullptr) { - APP_LOGE("AbilityThread::AttachExtension failed,create runner failed"); + HILOG_ERROR("AbilityThread::AttachExtension failed,create runner failed"); return; } abilityHandler_ = std::make_shared(runner_, this); if (abilityHandler_ == nullptr) { - APP_LOGE("AbilityThread::AttachExtension failed,abilityHandler_ is nullptr"); + HILOG_ERROR("AbilityThread::AttachExtension failed,abilityHandler_ is nullptr"); return; } // 2.new ability auto extension = AbilityLoader::GetInstance().GetExtensionByName(abilityName); if (extension == nullptr) { - APP_LOGE("AbilityThread::AttachExtension failed,load extension failed"); + HILOG_ERROR("AbilityThread::AttachExtension failed,load extension failed"); return; } - APP_LOGI("AbilityThread::new extension success."); + HILOG_INFO("AbilityThread::new extension success."); currentExtension_.reset(extension); token_ = abilityRecord->GetToken(); abilityRecord->SetEventHandler(abilityHandler_); @@ -343,19 +343,19 @@ void AbilityThread::AttachExtension(std::shared_ptr &applicatio abilityRecord->SetAbilityThread(this); extensionImpl_ = std::make_shared(); if (extensionImpl_ == nullptr) { - APP_LOGE("AbilityThread::extension extensionImpl_ == nullptr"); + HILOG_ERROR("AbilityThread::extension extensionImpl_ == nullptr"); return; } // 3.new init extensionImpl_->Init(application, abilityRecord, currentExtension_, abilityHandler_, token_); // 4.ipc attach init ErrCode err = AbilityManagerClient::GetInstance()->AttachAbilityThread(this, token_); - APP_LOGI("AbilityThread::Attach after AttachAbilityThread"); + HILOG_INFO("AbilityThread::Attach after AttachAbilityThread"); if (err != ERR_OK) { - APP_LOGE("AbilityThread:: AttachExtension failed err = %{public}d", err); + HILOG_ERROR("AbilityThread:: AttachExtension failed err = %{public}d", err); return; } - APP_LOGI("AbilityThread::AttachExtension end"); + HILOG_INFO("AbilityThread::AttachExtension end"); } /** @@ -368,33 +368,33 @@ void AbilityThread::Attach( const std::shared_ptr &stageContext) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("AbilityThread::Attach begin"); + HILOG_INFO("AbilityThread::Attach begin"); if ((application == nullptr) || (abilityRecord == nullptr)) { - APP_LOGE("AbilityThread::ability attach failed,context or record is nullptr"); + HILOG_ERROR("AbilityThread::ability attach failed,context or record is nullptr"); return; } // 1.new AbilityHandler std::string abilityName = CreateAbilityName(abilityRecord); runner_ = EventRunner::Create(abilityName); if (runner_ == nullptr) { - APP_LOGE("AbilityThread::ability attach failed,create runner failed"); + HILOG_ERROR("AbilityThread::ability attach failed,create runner failed"); return; } abilityHandler_ = std::make_shared(runner_, this); if (abilityHandler_ == nullptr) { - APP_LOGE("AbilityThread::ability attach failed,abilityHandler_ is nullptr"); + HILOG_ERROR("AbilityThread::ability attach failed,abilityHandler_ is nullptr"); return; } // 2.new ability auto ability = AbilityLoader::GetInstance().GetAbilityByName(abilityName); if (ability == nullptr) { - APP_LOGE("AbilityThread::ability attach failed,load ability failed"); + HILOG_ERROR("AbilityThread::ability attach failed,load ability failed"); return; } ability->SetCompatibleVersion(abilityRecord->GetCompatibleVersion()); - APP_LOGI("AbilityThread::new ability success."); + HILOG_INFO("AbilityThread::new ability success."); currentAbility_.reset(ability); token_ = abilityRecord->GetToken(); abilityRecord->SetEventHandler(abilityHandler_); @@ -413,22 +413,22 @@ void AbilityThread::Attach( DelayedSingleton::GetInstance()->MakeAbilityImplObject(abilityRecord->GetAbilityInfo(), abilityRecord->GetCompatibleVersion()); if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::ability abilityImpl_ == nullptr"); + HILOG_ERROR("AbilityThread::ability abilityImpl_ == nullptr"); return; } - APP_LOGI("AbilityThread::Attach before abilityImpl_->Init"); + HILOG_INFO("AbilityThread::Attach before abilityImpl_->Init"); abilityImpl_->Init(application, abilityRecord, currentAbility_, abilityHandler_, token_, contextDeal); - APP_LOGI("AbilityThread::Attach after abilityImpl_->Init"); + HILOG_INFO("AbilityThread::Attach after abilityImpl_->Init"); // 4. ability attach : ipc - APP_LOGI("AbilityThread::Attach before AttachAbilityThread"); + HILOG_INFO("AbilityThread::Attach before AttachAbilityThread"); ErrCode err = AbilityManagerClient::GetInstance()->AttachAbilityThread(this, token_); - APP_LOGI("AbilityThread::Attach after AttachAbilityThread"); + HILOG_INFO("AbilityThread::Attach after AttachAbilityThread"); if (err != ERR_OK) { - APP_LOGE("AbilityThread:: attach success failed err = %{public}d", err); + HILOG_ERROR("AbilityThread:: attach success failed err = %{public}d", err); return; } - APP_LOGI("AbilityThread::Attach end"); + HILOG_INFO("AbilityThread::Attach end"); } /** @@ -439,19 +439,19 @@ void AbilityThread::Attach( void AbilityThread::HandleAbilityTransaction(const Want &want, const LifeCycleStateInfo &lifeCycleStateInfo) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("AbilityThread::HandleAbilityTransaction begin"); + HILOG_INFO("AbilityThread::HandleAbilityTransaction begin"); if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::HandleAbilityTransaction abilityImpl_ == nullptr"); + HILOG_ERROR("AbilityThread::HandleAbilityTransaction abilityImpl_ == nullptr"); return; } - APP_LOGI("AbilityThread::HandleAbilityTransaction abilityImpl_->SetCallingContext"); + HILOG_INFO("AbilityThread::HandleAbilityTransaction abilityImpl_->SetCallingContext"); abilityImpl_->SetCallingContext(lifeCycleStateInfo.caller.deviceId, lifeCycleStateInfo.caller.bundleName, lifeCycleStateInfo.caller.abilityName); - APP_LOGI("AbilityThread::HandleAbilityTransaction abilityImpl_->HandleAbilityTransaction"); + HILOG_INFO("AbilityThread::HandleAbilityTransaction abilityImpl_->HandleAbilityTransaction"); abilityImpl_->HandleAbilityTransaction(want, lifeCycleStateInfo); - APP_LOGI("AbilityThread::HandleAbilityTransaction end"); + HILOG_INFO("AbilityThread::HandleAbilityTransaction end"); } /** @@ -463,13 +463,13 @@ void AbilityThread::HandleAbilityTransaction(const Want &want, const LifeCycleSt void AbilityThread::HandleExtensionTransaction(const Want &want, const LifeCycleStateInfo &lifeCycleStateInfo) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("AbilityThread::HandleExtensionTransaction begin"); + HILOG_INFO("AbilityThread::HandleExtensionTransaction begin"); if (extensionImpl_ == nullptr) { - APP_LOGE("AbilityThread::HandleExtensionTransaction extensionImpl_ == nullptr"); + HILOG_ERROR("AbilityThread::HandleExtensionTransaction extensionImpl_ == nullptr"); return; } extensionImpl_->HandleExtensionTransaction(want, lifeCycleStateInfo); - APP_LOGI("AbilityThread::HandleAbilityTransaction end"); + HILOG_INFO("AbilityThread::HandleAbilityTransaction end"); } /** @@ -479,22 +479,22 @@ void AbilityThread::HandleExtensionTransaction(const Want &want, const LifeCycle void AbilityThread::HandleConnectAbility(const Want &want) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("AbilityThread::HandleConnectAbility begin"); + HILOG_INFO("AbilityThread::HandleConnectAbility begin"); if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::HandleConnectAbility abilityImpl_ == nullptr"); + HILOG_ERROR("AbilityThread::HandleConnectAbility abilityImpl_ == nullptr"); return; } - APP_LOGI("AbilityThread::HandleConnectAbility before abilityImpl_->ConnectAbility"); + HILOG_INFO("AbilityThread::HandleConnectAbility before abilityImpl_->ConnectAbility"); sptr service = abilityImpl_->ConnectAbility(want); - APP_LOGI("AbilityThread::HandleConnectAbility after abilityImpl_->ConnectAbility"); - APP_LOGI("AbilityThread::HandleConnectAbility before ScheduleConnectAbilityDone"); + HILOG_INFO("AbilityThread::HandleConnectAbility after abilityImpl_->ConnectAbility"); + HILOG_INFO("AbilityThread::HandleConnectAbility before ScheduleConnectAbilityDone"); ErrCode err = AbilityManagerClient::GetInstance()->ScheduleConnectAbilityDone(token_, service); - APP_LOGI("AbilityThread::HandleConnectAbility after ScheduleConnectAbilityDone"); + HILOG_INFO("AbilityThread::HandleConnectAbility after ScheduleConnectAbilityDone"); if (err != ERR_OK) { - APP_LOGE("AbilityThread:: HandleConnectAbility failed err = %{public}d", err); + HILOG_ERROR("AbilityThread:: HandleConnectAbility failed err = %{public}d", err); } - APP_LOGI("AbilityThread::HandleConnectAbility end"); + HILOG_INFO("AbilityThread::HandleConnectAbility end"); } /** @@ -503,22 +503,22 @@ void AbilityThread::HandleConnectAbility(const Want &want) void AbilityThread::HandleDisconnectAbility(const Want &want) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("AbilityThread::HandleDisconnectAbility begin"); + HILOG_INFO("AbilityThread::HandleDisconnectAbility begin"); if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::HandleDisconnectAbility abilityImpl_ == nullptr"); + HILOG_ERROR("AbilityThread::HandleDisconnectAbility abilityImpl_ == nullptr"); return; } - APP_LOGI("AbilityThread::HandleDisconnectAbility before abilityImpl_->DisconnectAbility"); + HILOG_INFO("AbilityThread::HandleDisconnectAbility before abilityImpl_->DisconnectAbility"); abilityImpl_->DisconnectAbility(want); - APP_LOGI("AbilityThread::HandleDisconnectAbility after abilityImpl_->DisconnectAbility"); - APP_LOGI("AbilityThread::HandleDisconnectAbility before ScheduleDisconnectAbilityDone"); + HILOG_INFO("AbilityThread::HandleDisconnectAbility after abilityImpl_->DisconnectAbility"); + HILOG_INFO("AbilityThread::HandleDisconnectAbility before ScheduleDisconnectAbilityDone"); ErrCode err = AbilityManagerClient::GetInstance()->ScheduleDisconnectAbilityDone(token_); - APP_LOGI("AbilityThread::HandleDisconnectAbility after ScheduleDisconnectAbilityDone"); + HILOG_INFO("AbilityThread::HandleDisconnectAbility after ScheduleDisconnectAbilityDone"); if (err != ERR_OK) { - APP_LOGE("AbilityThread:: HandleDisconnectAbility failed err = %{public}d", err); + HILOG_ERROR("AbilityThread:: HandleDisconnectAbility failed err = %{public}d", err); } - APP_LOGI("AbilityThread::HandleDisconnectAbility end"); + HILOG_INFO("AbilityThread::HandleDisconnectAbility end"); } /** @@ -536,18 +536,18 @@ void AbilityThread::HandleDisconnectAbility(const Want &want) void AbilityThread::HandleCommandAbility(const Want &want, bool restart, int startId) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("AbilityThread::HandleCommandAbility begin"); + HILOG_INFO("AbilityThread::HandleCommandAbility begin"); if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::HandleCommandAbility failed. abilityImpl_ == nullptr"); + HILOG_ERROR("AbilityThread::HandleCommandAbility failed. abilityImpl_ == nullptr"); return; } abilityImpl_->CommandAbility(want, restart, startId); - APP_LOGI("AbilityThread::HandleCommandAbility before ScheduleCommandAbilityDone"); + HILOG_INFO("AbilityThread::HandleCommandAbility before ScheduleCommandAbilityDone"); ErrCode err = AbilityManagerClient::GetInstance()->ScheduleCommandAbilityDone(token_); if (err != ERR_OK) { - APP_LOGE("AbilityThread:: HandleCommandAbility failed err = %{public}d", err); + HILOG_ERROR("AbilityThread:: HandleCommandAbility failed err = %{public}d", err); } - APP_LOGI("AbilityThread::HandleCommandAbility end"); + HILOG_INFO("AbilityThread::HandleCommandAbility end"); } /** @@ -558,17 +558,17 @@ void AbilityThread::HandleCommandAbility(const Want &want, bool restart, int sta void AbilityThread::HandleConnectExtension(const Want &want) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("AbilityThread::HandleConnectExtension begin"); + HILOG_INFO("AbilityThread::HandleConnectExtension begin"); if (extensionImpl_ == nullptr) { - APP_LOGE("AbilityThread::HandleConnectExtension extensionImpl_ == nullptr"); + HILOG_ERROR("AbilityThread::HandleConnectExtension extensionImpl_ == nullptr"); return; } sptr service = extensionImpl_->ConnectExtension(want); ErrCode err = AbilityManagerClient::GetInstance()->ScheduleConnectAbilityDone(token_, service); if (err != ERR_OK) { - APP_LOGE("AbilityThread::HandleConnectExtension failed err = %{public}d", err); + HILOG_ERROR("AbilityThread::HandleConnectExtension failed err = %{public}d", err); } - APP_LOGI("AbilityThread::HandleConnectExtension end"); + HILOG_INFO("AbilityThread::HandleConnectExtension end"); } /** @@ -577,17 +577,17 @@ void AbilityThread::HandleConnectExtension(const Want &want) void AbilityThread::HandleDisconnectExtension(const Want &want) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("AbilityThread::HandleDisconnectExtension begin"); + HILOG_INFO("AbilityThread::HandleDisconnectExtension begin"); if (extensionImpl_ == nullptr) { - APP_LOGE("AbilityThread::HandleDisconnectExtension extensionImpl_ == nullptr"); + HILOG_ERROR("AbilityThread::HandleDisconnectExtension extensionImpl_ == nullptr"); return; } extensionImpl_->DisconnectExtension(want); ErrCode err = AbilityManagerClient::GetInstance()->ScheduleDisconnectAbilityDone(token_); if (err != ERR_OK) { - APP_LOGE("AbilityThread:: HandleDisconnectExtension failed err = %{public}d", err); + HILOG_ERROR("AbilityThread:: HandleDisconnectExtension failed err = %{public}d", err); } - APP_LOGI("AbilityThread::HandleDisconnectExtension end"); + HILOG_INFO("AbilityThread::HandleDisconnectExtension end"); } /** @@ -603,17 +603,17 @@ void AbilityThread::HandleDisconnectExtension(const Want &want) void AbilityThread::HandleCommandExtension(const Want &want, bool restart, int startId) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("AbilityThread::HandleCommandExtension begin"); + HILOG_INFO("AbilityThread::HandleCommandExtension begin"); if (extensionImpl_ == nullptr) { - APP_LOGE("AbilityThread::HandleCommandExtension extensionImpl_ == nullptr"); + HILOG_ERROR("AbilityThread::HandleCommandExtension extensionImpl_ == nullptr"); return; } extensionImpl_->CommandExtension(want, restart, startId); ErrCode err = AbilityManagerClient::GetInstance()->ScheduleCommandAbilityDone(token_); if (err != ERR_OK) { - APP_LOGE("AbilityThread::HandleCommandExtension failed err = %{public}d", err); + HILOG_ERROR("AbilityThread::HandleCommandExtension failed err = %{public}d", err); } - APP_LOGI("AbilityThread::HandleCommandExtension end"); + HILOG_INFO("AbilityThread::HandleCommandExtension end"); } /** @@ -622,16 +622,16 @@ void AbilityThread::HandleCommandExtension(const Want &want, bool restart, int s */ void AbilityThread::HandleRestoreAbilityState(const PacMap &state) { - APP_LOGI("AbilityThread::HandleRestoreAbilityState begin"); + HILOG_INFO("AbilityThread::HandleRestoreAbilityState begin"); if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::HandleRestoreAbilityState abilityImpl_ == nullptr"); + HILOG_ERROR("AbilityThread::HandleRestoreAbilityState abilityImpl_ == nullptr"); return; } - APP_LOGI("AbilityThread::HandleRestoreAbilityState before abilityImpl_->DispatchRestoreAbilityState"); + HILOG_INFO("AbilityThread::HandleRestoreAbilityState before abilityImpl_->DispatchRestoreAbilityState"); abilityImpl_->DispatchRestoreAbilityState(state); - APP_LOGI("AbilityThread::HandleRestoreAbilityState after abilityImpl_->DispatchRestoreAbilityState"); - APP_LOGI("AbilityThread::HandleRestoreAbilityState end"); + HILOG_INFO("AbilityThread::HandleRestoreAbilityState after abilityImpl_->DispatchRestoreAbilityState"); + HILOG_INFO("AbilityThread::HandleRestoreAbilityState end"); } /** @@ -639,18 +639,18 @@ void AbilityThread::HandleRestoreAbilityState(const PacMap &state) */ void AbilityThread::ScheduleSaveAbilityState() { - APP_LOGI("AbilityThread::ScheduleSaveAbilityState begin"); + HILOG_INFO("AbilityThread::ScheduleSaveAbilityState begin"); if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::ScheduleSaveAbilityState abilityImpl_ == nullptr"); + HILOG_ERROR("AbilityThread::ScheduleSaveAbilityState abilityImpl_ == nullptr"); return; } - APP_LOGI("AbilityThread::ScheduleSaveAbilityState before abilityImpl_->DispatchSaveAbilityState"); + HILOG_INFO("AbilityThread::ScheduleSaveAbilityState before abilityImpl_->DispatchSaveAbilityState"); abilityImpl_->DispatchSaveAbilityState(); - APP_LOGI("AbilityThread::ScheduleSaveAbilityState after abilityImpl_->DispatchSaveAbilityState"); - APP_LOGI("AbilityThread::ScheduleSaveAbilityState end"); + HILOG_INFO("AbilityThread::ScheduleSaveAbilityState after abilityImpl_->DispatchSaveAbilityState"); + HILOG_INFO("AbilityThread::ScheduleSaveAbilityState end"); } /** @@ -659,15 +659,15 @@ void AbilityThread::ScheduleSaveAbilityState() */ void AbilityThread::ScheduleRestoreAbilityState(const PacMap &state) { - APP_LOGI("AbilityThread::ScheduleRestoreAbilityState begin"); + HILOG_INFO("AbilityThread::ScheduleRestoreAbilityState begin"); if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::ScheduleRestoreAbilityState abilityImpl_ == nullptr"); + HILOG_ERROR("AbilityThread::ScheduleRestoreAbilityState abilityImpl_ == nullptr"); return; } - APP_LOGI("AbilityThread::ScheduleRestoreAbilityState before abilityImpl_->DispatchRestoreAbilityState"); + HILOG_INFO("AbilityThread::ScheduleRestoreAbilityState before abilityImpl_->DispatchRestoreAbilityState"); abilityImpl_->DispatchRestoreAbilityState(state); - APP_LOGI("AbilityThread::ScheduleRestoreAbilityState after abilityImpl_->DispatchRestoreAbilityState"); - APP_LOGI("AbilityThread::ScheduleRestoreAbilityState end"); + HILOG_INFO("AbilityThread::ScheduleRestoreAbilityState after abilityImpl_->DispatchRestoreAbilityState"); + HILOG_INFO("AbilityThread::ScheduleRestoreAbilityState end"); } /* @@ -675,12 +675,12 @@ void AbilityThread::ScheduleRestoreAbilityState(const PacMap &state) */ void AbilityThread::ScheduleUpdateConfiguration(const Configuration &config) { - APP_LOGI("AbilityThread::ScheduleUpdateConfiguration begin"); + HILOG_INFO("AbilityThread::ScheduleUpdateConfiguration begin"); wptr weak = this; auto task = [weak, config]() { auto abilityThread = weak.promote(); if (abilityThread == nullptr) { - APP_LOGE("abilityThread is nullptr, ScheduleUpdateConfiguration failed."); + HILOG_ERROR("abilityThread is nullptr, ScheduleUpdateConfiguration failed."); return; } @@ -692,15 +692,15 @@ void AbilityThread::ScheduleUpdateConfiguration(const Configuration &config) }; if (abilityHandler_ == nullptr) { - APP_LOGE("AbilityThread::ScheduleUpdateConfiguration abilityHandler_ is nullptr"); + HILOG_ERROR("AbilityThread::ScheduleUpdateConfiguration abilityHandler_ is nullptr"); return; } bool ret = abilityHandler_->PostTask(task); if (!ret) { - APP_LOGE("AbilityThread::ScheduleUpdateConfiguration PostTask error"); + HILOG_ERROR("AbilityThread::ScheduleUpdateConfiguration PostTask error"); } - APP_LOGI("AbilityThread::ScheduleUpdateConfiguration end"); + HILOG_INFO("AbilityThread::ScheduleUpdateConfiguration end"); } /* @@ -708,30 +708,30 @@ void AbilityThread::ScheduleUpdateConfiguration(const Configuration &config) */ void AbilityThread::HandleUpdateConfiguration(const Configuration &config) { - APP_LOGI("AbilityThread::HandleUpdateConfiguration begin"); + HILOG_INFO("AbilityThread::HandleUpdateConfiguration begin"); if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::HandleUpdateConfiguration abilityImpl_ is nullptr"); + HILOG_ERROR("AbilityThread::HandleUpdateConfiguration abilityImpl_ is nullptr"); return; } - APP_LOGI("AbilityThread::HandleUpdateConfiguration before abilityImpl_->ScheduleUpdateConfiguration"); + HILOG_INFO("AbilityThread::HandleUpdateConfiguration before abilityImpl_->ScheduleUpdateConfiguration"); abilityImpl_->ScheduleUpdateConfiguration(config); - APP_LOGI("AbilityThread::HandleUpdateConfiguration after abilityImpl_->ScheduleUpdateConfiguration"); - APP_LOGI("AbilityThread::HandleUpdateConfiguration end"); + HILOG_INFO("AbilityThread::HandleUpdateConfiguration after abilityImpl_->ScheduleUpdateConfiguration"); + HILOG_INFO("AbilityThread::HandleUpdateConfiguration end"); } void AbilityThread::HandleExtensionUpdateConfiguration(const Configuration &config) { - APP_LOGI("AbilityThread::HandleExtensionUpdateConfiguration begin"); + HILOG_INFO("AbilityThread::HandleExtensionUpdateConfiguration begin"); if (!extensionImpl_) { - APP_LOGE("AbilityThread::HandleExtensionUpdateConfiguration extensionImpl_ is nullptr"); + HILOG_ERROR("AbilityThread::HandleExtensionUpdateConfiguration extensionImpl_ is nullptr"); return; } - APP_LOGI("AbilityThread::HandleExtensionUpdateConfiguration before extensionImpl_->ScheduleUpdateConfiguration"); + HILOG_INFO("AbilityThread::HandleExtensionUpdateConfiguration before extensionImpl_->ScheduleUpdateConfiguration"); extensionImpl_->ScheduleUpdateConfiguration(config); - APP_LOGI("AbilityThread::HandleExtensionUpdateConfiguration after extensionImpl_->ScheduleUpdateConfiguration"); - APP_LOGI("AbilityThread::HandleExtensionUpdateConfiguration end"); + HILOG_INFO("AbilityThread::HandleExtensionUpdateConfiguration after extensionImpl_->ScheduleUpdateConfiguration"); + HILOG_INFO("AbilityThread::HandleExtensionUpdateConfiguration end"); } /** @@ -742,21 +742,21 @@ void AbilityThread::HandleExtensionUpdateConfiguration(const Configuration &conf void AbilityThread::ScheduleAbilityTransaction(const Want &want, const LifeCycleStateInfo &lifeCycleStateInfo) { BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); - APP_LOGI("ScheduleAbilityTransaction begin: targeState = %{public}d, isNewWant = %{public}d", + HILOG_INFO("ScheduleAbilityTransaction begin: targeState = %{public}d, isNewWant = %{public}d", lifeCycleStateInfo.state, lifeCycleStateInfo.isNewWant); want.DumpInfo(0); if (token_ == nullptr) { - APP_LOGE("ScheduleAbilityTransaction::failed, token_ nullptr"); + HILOG_ERROR("ScheduleAbilityTransaction::failed, token_ nullptr"); return; } wptr weak = this; auto task = [weak, want, lifeCycleStateInfo]() { auto abilityThread = weak.promote(); if (abilityThread == nullptr) { - APP_LOGE("abilityThread is nullptr, ScheduleAbilityTransaction failed."); + HILOG_ERROR("abilityThread is nullptr, ScheduleAbilityTransaction failed."); return; } if (abilityThread->isExtension_) { @@ -767,15 +767,15 @@ void AbilityThread::ScheduleAbilityTransaction(const Want &want, const LifeCycle }; if (abilityHandler_ == nullptr) { - APP_LOGE("AbilityThread::ScheduleAbilityTransaction abilityHandler_ == nullptr"); + HILOG_ERROR("AbilityThread::ScheduleAbilityTransaction abilityHandler_ == nullptr"); return; } bool ret = abilityHandler_->PostTask(task); if (!ret) { - APP_LOGE("AbilityThread::ScheduleAbilityTransaction PostTask error"); + HILOG_ERROR("AbilityThread::ScheduleAbilityTransaction PostTask error"); } - APP_LOGI("ScheduleAbilityTransaction end"); + HILOG_INFO("ScheduleAbilityTransaction end"); } /** @@ -784,12 +784,12 @@ void AbilityThread::ScheduleAbilityTransaction(const Want &want, const LifeCycle */ void AbilityThread::ScheduleConnectAbility(const Want &want) { - APP_LOGI("AbilityThread::ScheduleConnectAbility begin, isExtension_:%{public}d", isExtension_); + HILOG_INFO("AbilityThread::ScheduleConnectAbility begin, isExtension_:%{public}d", isExtension_); wptr weak = this; auto task = [weak, want]() { auto abilityThread = weak.promote(); if (abilityThread == nullptr) { - APP_LOGE("abilityThread is nullptr, ScheduleConnectAbility failed."); + HILOG_ERROR("abilityThread is nullptr, ScheduleConnectAbility failed."); return; } if (abilityThread->isExtension_) { @@ -800,15 +800,15 @@ void AbilityThread::ScheduleConnectAbility(const Want &want) }; if (abilityHandler_ == nullptr) { - APP_LOGE("AbilityThread::ScheduleConnectAbility abilityHandler_ == nullptr"); + HILOG_ERROR("AbilityThread::ScheduleConnectAbility abilityHandler_ == nullptr"); return; } bool ret = abilityHandler_->PostTask(task); if (!ret) { - APP_LOGE("AbilityThread::ScheduleConnectAbility PostTask error"); + HILOG_ERROR("AbilityThread::ScheduleConnectAbility PostTask error"); } - APP_LOGI("AbilityThread::ScheduleConnectAbility end"); + HILOG_INFO("AbilityThread::ScheduleConnectAbility end"); } /** @@ -817,12 +817,12 @@ void AbilityThread::ScheduleConnectAbility(const Want &want) */ void AbilityThread::ScheduleDisconnectAbility(const Want &want) { - APP_LOGI("AbilityThread::ScheduleDisconnectAbility begin, isExtension_:%{public}d", isExtension_); + HILOG_INFO("AbilityThread::ScheduleDisconnectAbility begin, isExtension_:%{public}d", isExtension_); wptr weak = this; auto task = [weak, want]() { auto abilityThread = weak.promote(); if (abilityThread == nullptr) { - APP_LOGE("abilityThread is nullptr, ScheduleDisconnectAbility failed."); + HILOG_ERROR("abilityThread is nullptr, ScheduleDisconnectAbility failed."); return; } if (abilityThread->isExtension_) { @@ -833,15 +833,15 @@ void AbilityThread::ScheduleDisconnectAbility(const Want &want) }; if (abilityHandler_ == nullptr) { - APP_LOGE("AbilityThread::ScheduleDisconnectAbility abilityHandler_ == nullptr"); + HILOG_ERROR("AbilityThread::ScheduleDisconnectAbility abilityHandler_ == nullptr"); return; } bool ret = abilityHandler_->PostTask(task); if (!ret) { - APP_LOGE("AbilityThread::ScheduleDisconnectAbility PostTask error"); + HILOG_ERROR("AbilityThread::ScheduleDisconnectAbility PostTask error"); } - APP_LOGI("AbilityThread::ScheduleDisconnectAbility end"); + HILOG_INFO("AbilityThread::ScheduleDisconnectAbility end"); } /** @@ -858,12 +858,12 @@ void AbilityThread::ScheduleDisconnectAbility(const Want &want) */ void AbilityThread::ScheduleCommandAbility(const Want &want, bool restart, int startId) { - APP_LOGI("AbilityThread::ScheduleCommandAbility begin. startId:%{public}d", startId); + HILOG_INFO("AbilityThread::ScheduleCommandAbility begin. startId:%{public}d", startId); wptr weak = this; auto task = [weak, want, restart, startId]() { auto abilityThread = weak.promote(); if (abilityThread == nullptr) { - APP_LOGE("abilityThread is nullptr, ScheduleCommandAbility failed."); + HILOG_ERROR("abilityThread is nullptr, ScheduleCommandAbility failed."); return; } if (abilityThread->isExtension_) { @@ -874,15 +874,15 @@ void AbilityThread::ScheduleCommandAbility(const Want &want, bool restart, int s }; if (abilityHandler_ == nullptr) { - APP_LOGE("AbilityThread::ScheduleCommandAbility abilityHandler_ == nullptr"); + HILOG_ERROR("AbilityThread::ScheduleCommandAbility abilityHandler_ == nullptr"); return; } bool ret = abilityHandler_->PostTask(task); if (!ret) { - APP_LOGE("AbilityThread::ScheduleCommandAbility PostTask error"); + HILOG_ERROR("AbilityThread::ScheduleCommandAbility PostTask error"); } - APP_LOGI("AbilityThread::ScheduleCommandAbility end"); + HILOG_INFO("AbilityThread::ScheduleCommandAbility end"); } /** @@ -898,35 +898,35 @@ void AbilityThread::ScheduleCommandAbility(const Want &want, bool restart, int s */ void AbilityThread::SendResult(int requestCode, int resultCode, const Want &want) { - APP_LOGI("AbilityThread::SendResult begin"); + HILOG_INFO("AbilityThread::SendResult begin"); if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::SendResult abilityImpl_ == nullptr"); + HILOG_ERROR("AbilityThread::SendResult abilityImpl_ == nullptr"); return; } wptr weak = this; auto task = [weak, requestCode, resultCode, want]() { auto abilityThread = weak.promote(); if (abilityThread == nullptr || abilityThread->abilityImpl_ == nullptr) { - APP_LOGE("abilityThread or abilityImpl is nullptr, SendResult failed."); + HILOG_ERROR("abilityThread or abilityImpl is nullptr, SendResult failed."); return; } if (requestCode != -1) { - APP_LOGI("AbilityThread::SendResult before abilityImpl_->SendResult"); + HILOG_INFO("AbilityThread::SendResult before abilityImpl_->SendResult"); abilityThread->abilityImpl_->SendResult(requestCode, resultCode, want); - APP_LOGI("AbilityThread::SendResult after abilityImpl_->SendResult"); + HILOG_INFO("AbilityThread::SendResult after abilityImpl_->SendResult"); } }; if (abilityHandler_ == nullptr) { - APP_LOGE("AbilityThread::SendResult abilityHandler_ == nullptr"); + HILOG_ERROR("AbilityThread::SendResult abilityHandler_ == nullptr"); return; } bool ret = abilityHandler_->PostTask(task); if (!ret) { - APP_LOGE("AbilityThread::SendResult PostTask error"); + HILOG_ERROR("AbilityThread::SendResult PostTask error"); } - APP_LOGI("AbilityThread::SendResult end"); + HILOG_INFO("AbilityThread::SendResult end"); } /** @@ -939,17 +939,17 @@ void AbilityThread::SendResult(int requestCode, int resultCode, const Want &want */ std::vector AbilityThread::GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) { - APP_LOGI("AbilityThread::GetFileTypes begin"); + HILOG_INFO("AbilityThread::GetFileTypes begin"); std::vector types; if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::GetFileTypes abilityImpl_ is nullptr"); + HILOG_ERROR("AbilityThread::GetFileTypes abilityImpl_ is nullptr"); return types; } - APP_LOGI("AbilityThread::GetFileTypes before abilityImpl_->GetFileTypes"); + HILOG_INFO("AbilityThread::GetFileTypes before abilityImpl_->GetFileTypes"); types = abilityImpl_->GetFileTypes(uri, mimeTypeFilter); - APP_LOGI("AbilityThread::GetFileTypes after abilityImpl_->GetFileTypes"); - APP_LOGI("AbilityThread::GetFileTypes end"); + HILOG_INFO("AbilityThread::GetFileTypes after abilityImpl_->GetFileTypes"); + HILOG_INFO("AbilityThread::GetFileTypes end"); return types; } @@ -966,17 +966,17 @@ std::vector AbilityThread::GetFileTypes(const Uri &uri, const std:: */ int AbilityThread::OpenFile(const Uri &uri, const std::string &mode) { - APP_LOGI("AbilityThread::OpenFile begin"); + HILOG_INFO("AbilityThread::OpenFile begin"); int fd = -1; if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::OpenFile abilityImpl_ is nullptr"); + HILOG_ERROR("AbilityThread::OpenFile abilityImpl_ is nullptr"); return fd; } - APP_LOGI("AbilityThread::OpenFile before abilityImpl_->OpenFile"); + HILOG_INFO("AbilityThread::OpenFile before abilityImpl_->OpenFile"); fd = abilityImpl_->OpenFile(uri, mode); - APP_LOGI("AbilityThread::OpenFile after abilityImpl_->OpenFile"); - APP_LOGI("AbilityThread::OpenFile end"); + HILOG_INFO("AbilityThread::OpenFile after abilityImpl_->OpenFile"); + HILOG_INFO("AbilityThread::OpenFile end"); return fd; } @@ -994,17 +994,17 @@ int AbilityThread::OpenFile(const Uri &uri, const std::string &mode) */ int AbilityThread::OpenRawFile(const Uri &uri, const std::string &mode) { - APP_LOGI("AbilityThread::OpenRawFile begin"); + HILOG_INFO("AbilityThread::OpenRawFile begin"); int fd = -1; if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::OpenRawFile abilityImpl_ is nullptr"); + HILOG_ERROR("AbilityThread::OpenRawFile abilityImpl_ is nullptr"); return fd; } - APP_LOGI("AbilityThread::OpenRawFile before abilityImpl_->OpenRawFile"); + HILOG_INFO("AbilityThread::OpenRawFile before abilityImpl_->OpenRawFile"); fd = abilityImpl_->OpenRawFile(uri, mode); - APP_LOGI("AbilityThread::OpenRawFile after abilityImpl_->OpenRawFile"); - APP_LOGI("AbilityThread::OpenRawFile end"); + HILOG_INFO("AbilityThread::OpenRawFile after abilityImpl_->OpenRawFile"); + HILOG_INFO("AbilityThread::OpenRawFile end"); return fd; } @@ -1018,17 +1018,17 @@ int AbilityThread::OpenRawFile(const Uri &uri, const std::string &mode) */ int AbilityThread::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) { - APP_LOGI("AbilityThread::Insert begin"); + HILOG_INFO("AbilityThread::Insert begin"); int index = -1; if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::Insert abilityImpl_ is nullptr"); + HILOG_ERROR("AbilityThread::Insert abilityImpl_ is nullptr"); return index; } - APP_LOGI("AbilityThread::Insert before abilityImpl_->Insert"); + HILOG_INFO("AbilityThread::Insert before abilityImpl_->Insert"); index = abilityImpl_->Insert(uri, value); - APP_LOGI("AbilityThread::Insert after abilityImpl_->Insert"); - APP_LOGI("AbilityThread::Insert end"); + HILOG_INFO("AbilityThread::Insert after abilityImpl_->Insert"); + HILOG_INFO("AbilityThread::Insert end"); return index; } @@ -1044,17 +1044,17 @@ int AbilityThread::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) int AbilityThread::Update( const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AbilityThread::Update begin"); + HILOG_INFO("AbilityThread::Update begin"); int index = -1; if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::Update abilityImpl_ is nullptr"); + HILOG_ERROR("AbilityThread::Update abilityImpl_ is nullptr"); return index; } - APP_LOGI("AbilityThread::Update before abilityImpl_->Update"); + HILOG_INFO("AbilityThread::Update before abilityImpl_->Update"); index = abilityImpl_->Update(uri, value, predicates); - APP_LOGI("AbilityThread::Update after abilityImpl_->Update"); - APP_LOGI("AbilityThread::Update end"); + HILOG_INFO("AbilityThread::Update after abilityImpl_->Update"); + HILOG_INFO("AbilityThread::Update end"); return index; } @@ -1068,16 +1068,16 @@ int AbilityThread::Update( */ int AbilityThread::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AbilityThread::Delete begin"); + HILOG_INFO("AbilityThread::Delete begin"); int index = -1; if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::Delete abilityImpl_ is nullptr"); + HILOG_ERROR("AbilityThread::Delete abilityImpl_ is nullptr"); return index; } - APP_LOGI("AbilityThread::Delete before abilityImpl_->Delete"); + HILOG_INFO("AbilityThread::Delete before abilityImpl_->Delete"); index = abilityImpl_->Delete(uri, predicates); - APP_LOGI("AbilityThread::Delete after abilityImpl_->Delete"); - APP_LOGI("AbilityThread::Delete end"); + HILOG_INFO("AbilityThread::Delete after abilityImpl_->Delete"); + HILOG_INFO("AbilityThread::Delete end"); return index; } @@ -1093,17 +1093,17 @@ int AbilityThread::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates std::shared_ptr AbilityThread::Query( const Uri &uri, std::vector &columns, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AbilityThread::Query begin"); + HILOG_INFO("AbilityThread::Query begin"); std::shared_ptr resultSet = nullptr; if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::Query abilityImpl_ is nullptr"); + HILOG_ERROR("AbilityThread::Query abilityImpl_ is nullptr"); return resultSet; } - APP_LOGI("AbilityThread::Query before abilityImpl_->Query"); + HILOG_INFO("AbilityThread::Query before abilityImpl_->Query"); resultSet = abilityImpl_->Query(uri, columns, predicates); - APP_LOGI("AbilityThread::Query after abilityImpl_->Query"); - APP_LOGI("AbilityThread::Query end"); + HILOG_INFO("AbilityThread::Query after abilityImpl_->Query"); + HILOG_INFO("AbilityThread::Query end"); return resultSet; } @@ -1117,17 +1117,17 @@ std::shared_ptr AbilityThread::Query( */ std::string AbilityThread::GetType(const Uri &uri) { - APP_LOGI("AbilityThread::GetType begin"); + HILOG_INFO("AbilityThread::GetType begin"); std::string type; if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::GetType abilityImpl_ is nullptr"); + HILOG_ERROR("AbilityThread::GetType abilityImpl_ is nullptr"); return type; } - APP_LOGI("AbilityThread::GetType before abilityImpl_->GetType"); + HILOG_INFO("AbilityThread::GetType before abilityImpl_->GetType"); type = abilityImpl_->GetType(uri); - APP_LOGI("AbilityThread::GetType after abilityImpl_->GetType"); - APP_LOGI("AbilityThread::GetType end"); + HILOG_INFO("AbilityThread::GetType after abilityImpl_->GetType"); + HILOG_INFO("AbilityThread::GetType end"); return type; } @@ -1143,16 +1143,16 @@ std::string AbilityThread::GetType(const Uri &uri) */ bool AbilityThread::Reload(const Uri &uri, const PacMap &extras) { - APP_LOGI("AbilityThread::Reload begin"); + HILOG_INFO("AbilityThread::Reload begin"); bool ret = false; if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::Reload abilityImpl_ is nullptr"); + HILOG_ERROR("AbilityThread::Reload abilityImpl_ is nullptr"); return ret; } - APP_LOGI("AbilityThread::Reload before abilityImpl_->Reload"); + HILOG_INFO("AbilityThread::Reload before abilityImpl_->Reload"); ret = abilityImpl_->Reload(uri, extras); - APP_LOGI("AbilityThread::Reload after abilityImpl_->Reload"); - APP_LOGI("AbilityThread::Reload end"); + HILOG_INFO("AbilityThread::Reload after abilityImpl_->Reload"); + HILOG_INFO("AbilityThread::Reload end"); return ret; } @@ -1166,43 +1166,43 @@ bool AbilityThread::Reload(const Uri &uri, const PacMap &extras) */ int AbilityThread::BatchInsert(const Uri &uri, const std::vector &values) { - APP_LOGI("AbilityThread::BatchInsert begin"); + HILOG_INFO("AbilityThread::BatchInsert begin"); int ret = -1; if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::BatchInsert abilityImpl_ is nullptr"); + HILOG_ERROR("AbilityThread::BatchInsert abilityImpl_ is nullptr"); return ret; } - APP_LOGI("AbilityThread::BatchInsert before abilityImpl_->BatchInsert"); + HILOG_INFO("AbilityThread::BatchInsert before abilityImpl_->BatchInsert"); ret = abilityImpl_->BatchInsert(uri, values); - APP_LOGI("AbilityThread::BatchInsert after abilityImpl_->BatchInsert"); - APP_LOGI("AbilityThread::BatchInsert end"); + HILOG_INFO("AbilityThread::BatchInsert after abilityImpl_->BatchInsert"); + HILOG_INFO("AbilityThread::BatchInsert end"); return ret; } void AbilityThread::NotifyMultiWinModeChanged(int32_t winModeKey, bool flag) { - APP_LOGI("NotifyMultiWinModeChanged.key:%{public}d,flag:%{public}d", winModeKey, flag); + HILOG_INFO("NotifyMultiWinModeChanged.key:%{public}d,flag:%{public}d", winModeKey, flag); auto window = currentAbility_->GetWindow(); if (window == nullptr) { - APP_LOGE("NotifyMultiWinModeChanged window == nullptr"); + HILOG_ERROR("NotifyMultiWinModeChanged window == nullptr"); return; } if (flag) { // true: normal windowMode -> free windowMode if (winModeKey == MULTI_WINDOW_DISPLAY_FLOATING) { - APP_LOGI("NotifyMultiWinModeChanged.SetWindowMode:WINDOW_MODE_FREE begin."); + HILOG_INFO("NotifyMultiWinModeChanged.SetWindowMode:WINDOW_MODE_FREE begin."); window->SetWindowType(Rosen::WindowType::WINDOW_TYPE_FLOAT); - APP_LOGI("NotifyMultiWinModeChanged.SetWindowMode:WINDOW_MODE_FREE end."); + HILOG_INFO("NotifyMultiWinModeChanged.SetWindowMode:WINDOW_MODE_FREE end."); } else { - APP_LOGI("NotifyMultiWinModeChanged.key:%{public}d", winModeKey); + HILOG_INFO("NotifyMultiWinModeChanged.key:%{public}d", winModeKey); } } else { // false: free windowMode -> normal windowMode - APP_LOGI("NotifyMultiWinModeChanged.SetWindowMode:WINDOW_MODE_TOP begin."); + HILOG_INFO("NotifyMultiWinModeChanged.SetWindowMode:WINDOW_MODE_TOP begin."); window->SetWindowType(Rosen::WindowType::WINDOW_TYPE_APP_MAIN_WINDOW); - APP_LOGI("NotifyMultiWinModeChanged.SetWindowMode:WINDOW_MODE_TOP end."); + HILOG_INFO("NotifyMultiWinModeChanged.SetWindowMode:WINDOW_MODE_TOP end."); } return; @@ -1210,10 +1210,10 @@ void AbilityThread::NotifyMultiWinModeChanged(int32_t winModeKey, bool flag) void AbilityThread::NotifyTopActiveAbilityChanged(bool flag) { - APP_LOGI("NotifyTopActiveAbilityChanged,flag:%{public}d", flag); + HILOG_INFO("NotifyTopActiveAbilityChanged,flag:%{public}d", flag); auto window = currentAbility_->GetWindow(); if (window == nullptr) { - APP_LOGE("NotifyMultiWinModeChanged window == nullptr"); + HILOG_ERROR("NotifyMultiWinModeChanged window == nullptr"); return; } if (flag) { @@ -1224,9 +1224,9 @@ void AbilityThread::NotifyTopActiveAbilityChanged(bool flag) void AbilityThread::ContinueAbility(const std::string& deviceId) { - APP_LOGI("ContinueAbility, deviceId:%{public}s", deviceId.c_str()); + HILOG_INFO("ContinueAbility, deviceId:%{public}s", deviceId.c_str()); if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::ContinueAbility abilityImpl_ is nullptr"); + HILOG_ERROR("AbilityThread::ContinueAbility abilityImpl_ is nullptr"); return; } abilityImpl_->ContinueAbility(deviceId); @@ -1234,9 +1234,9 @@ void AbilityThread::ContinueAbility(const std::string& deviceId) void AbilityThread::NotifyContinuationResult(int32_t result) { - APP_LOGI("NotifyContinuationResult, result:%{public}d", result); + HILOG_INFO("NotifyContinuationResult, result:%{public}d", result); if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::NotifyContinuationResult abilityImpl_ is nullptr"); + HILOG_ERROR("AbilityThread::NotifyContinuationResult abilityImpl_ is nullptr"); return; } abilityImpl_->NotifyContinuationResult(result); @@ -1253,10 +1253,10 @@ void AbilityThread::AbilityThreadMain(std::shared_ptr &applicat const std::shared_ptr &abilityRecord, const std::shared_ptr &mainRunner, const std::shared_ptr &stageContext) { - APP_LOGI("AbilityThread::AbilityThreadMain begin"); + HILOG_INFO("AbilityThread::AbilityThreadMain begin"); sptr thread = sptr(new (std::nothrow) AbilityThread()); if (thread == nullptr) { - APP_LOGE("AbilityThread::AbilityThreadMain failed,thread is nullptr"); + HILOG_ERROR("AbilityThread::AbilityThreadMain failed,thread is nullptr"); return; } thread->InitExtensionFlag(abilityRecord); @@ -1265,7 +1265,7 @@ void AbilityThread::AbilityThreadMain(std::shared_ptr &applicat } else { thread->Attach(application, abilityRecord, mainRunner, stageContext); } - APP_LOGI("AbilityThread::AbilityThreadMain end"); + HILOG_INFO("AbilityThread::AbilityThreadMain end"); } /** @@ -1278,10 +1278,10 @@ void AbilityThread::AbilityThreadMain( std::shared_ptr &application, const std::shared_ptr &abilityRecord, const std::shared_ptr &stageContext) { - APP_LOGI("AbilityThread::AbilityThreadMain begin"); + HILOG_INFO("AbilityThread::AbilityThreadMain begin"); sptr thread = sptr(new (std::nothrow) AbilityThread()); if (thread == nullptr || abilityRecord == nullptr) { - APP_LOGE("AbilityThread::AbilityThreadMain failed, thread is nullptr"); + HILOG_ERROR("AbilityThread::AbilityThreadMain failed, thread is nullptr"); return; } thread->InitExtensionFlag(abilityRecord); @@ -1290,24 +1290,24 @@ void AbilityThread::AbilityThreadMain( } else { thread->Attach(application, abilityRecord, stageContext); } - APP_LOGI("AbilityThread::AbilityThreadMain end"); + HILOG_INFO("AbilityThread::AbilityThreadMain end"); } void AbilityThread::InitExtensionFlag(const std::shared_ptr &abilityRecord) { - APP_LOGI("AbilityThread::InitExtensionFlag start"); + HILOG_INFO("AbilityThread::InitExtensionFlag start"); if (abilityRecord == nullptr) { - APP_LOGE("AbilityThread::InitExtensionFlag abilityRecord null"); + HILOG_ERROR("AbilityThread::InitExtensionFlag abilityRecord null"); return; } std::shared_ptr abilityInfo = abilityRecord->GetAbilityInfo(); if (abilityInfo == nullptr) { - APP_LOGE("AbilityThread::InitExtensionFlag abilityInfo null"); + HILOG_ERROR("AbilityThread::InitExtensionFlag abilityInfo null"); return; } - APP_LOGI("AbilityThread::InitExtensionFlag:%{public}d", abilityInfo->type); + HILOG_INFO("AbilityThread::InitExtensionFlag:%{public}d", abilityInfo->type); if (abilityInfo->type == AppExecFwk::AbilityType::EXTENSION) { - APP_LOGI("AbilityThread::InitExtensionFlag true"); + HILOG_INFO("AbilityThread::InitExtensionFlag true"); isExtension_ = true; } else { isExtension_ = false; @@ -1328,17 +1328,17 @@ void AbilityThread::InitExtensionFlag(const std::shared_ptr */ Uri AbilityThread::NormalizeUri(const Uri &uri) { - APP_LOGI("AbilityThread::NormalizeUri begin"); + HILOG_INFO("AbilityThread::NormalizeUri begin"); Uri urivalue(""); if (abilityImpl_ == nullptr) { - APP_LOGE("DataAbilityHelper::normalizeUri failed dataAbility == nullptr"); + HILOG_ERROR("DataAbilityHelper::normalizeUri failed dataAbility == nullptr"); return urivalue; } - APP_LOGI("AbilityThread::NormalizeUri before abilityImpl_->NormalizeUri"); + HILOG_INFO("AbilityThread::NormalizeUri before abilityImpl_->NormalizeUri"); urivalue = abilityImpl_->NormalizeUri(uri); - APP_LOGI("AbilityThread::NormalizeUri after abilityImpl_->NormalizeUri"); - APP_LOGI("AbilityThread::NormalizeUri end"); + HILOG_INFO("AbilityThread::NormalizeUri after abilityImpl_->NormalizeUri"); + HILOG_INFO("AbilityThread::NormalizeUri end"); return urivalue; } @@ -1354,17 +1354,17 @@ Uri AbilityThread::NormalizeUri(const Uri &uri) */ Uri AbilityThread::DenormalizeUri(const Uri &uri) { - APP_LOGI("AbilityThread::DenormalizeUri begin"); + HILOG_INFO("AbilityThread::DenormalizeUri begin"); Uri urivalue(""); if (abilityImpl_ == nullptr) { - APP_LOGE("DataAbilityHelper::denormalizeUri failed dataAbility == nullptr"); + HILOG_ERROR("DataAbilityHelper::denormalizeUri failed dataAbility == nullptr"); return urivalue; } - APP_LOGI("AbilityThread::DenormalizeUri before abilityImpl_->DenormalizeUri"); + HILOG_INFO("AbilityThread::DenormalizeUri before abilityImpl_->DenormalizeUri"); urivalue = abilityImpl_->DenormalizeUri(uri); - APP_LOGI("AbilityThread::DenormalizeUri after abilityImpl_->DenormalizeUri"); - APP_LOGI("AbilityThread::DenormalizeUri end"); + HILOG_INFO("AbilityThread::DenormalizeUri after abilityImpl_->DenormalizeUri"); + HILOG_INFO("AbilityThread::DenormalizeUri end"); return urivalue; } @@ -1378,13 +1378,13 @@ bool AbilityThread::HandleRegisterObserver(const Uri &uri, const sptrRegisterObserver(uri, dataObserver); if (ret != ERR_OK) { - APP_LOGE("%{public}s obsMgrClient->RegisterObserver error return %{public}d", __func__, ret); + HILOG_ERROR("%{public}s obsMgrClient->RegisterObserver error return %{public}d", __func__, ret); return false; } return true; @@ -1400,13 +1400,13 @@ bool AbilityThread::HandleUnregisterObserver(const Uri &uri, const sptrUnregisterObserver(uri, dataObserver); if (ret != ERR_OK) { - APP_LOGE("%{public}s obsMgrClient->UnregisterObserver error return %{public}d", __func__, ret); + HILOG_ERROR("%{public}s obsMgrClient->UnregisterObserver error return %{public}d", __func__, ret); return false; } return true; @@ -1421,13 +1421,13 @@ bool AbilityThread::HandleNotifyChange(const Uri &uri) { auto obsMgrClient = DataObsMgrClient::GetInstance(); if (obsMgrClient == nullptr) { - APP_LOGE("%{public}s obsMgrClient is nullptr", __func__); + HILOG_ERROR("%{public}s obsMgrClient is nullptr", __func__); return false; } ErrCode ret = obsMgrClient->NotifyChange(uri); if (ret != ERR_OK) { - APP_LOGE("%{public}s obsMgrClient->NotifyChange error return %{public}d", __func__, ret); + HILOG_ERROR("%{public}s obsMgrClient->NotifyChange error return %{public}d", __func__, ret); return false; } return true; @@ -1440,7 +1440,7 @@ bool AbilityThread::HandleNotifyChange(const Uri &uri) */ bool AbilityThread::CheckObsPermission() { - APP_LOGI("%{public}s CheckObsPermission() run Permission Checkout", __func__); + HILOG_INFO("%{public}s CheckObsPermission() run Permission Checkout", __func__); return true; } @@ -1452,9 +1452,9 @@ bool AbilityThread::CheckObsPermission() */ bool AbilityThread::ScheduleRegisterObserver(const Uri &uri, const sptr &dataObserver) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); if (!CheckObsPermission()) { - APP_LOGE("%{public}s CheckObsPermission() return false", __func__); + HILOG_ERROR("%{public}s CheckObsPermission() return false", __func__); return false; } @@ -1462,20 +1462,20 @@ bool AbilityThread::ScheduleRegisterObserver(const Uri &uri, const sptrHandleRegisterObserver(uri, dataObserver); }; if (abilityHandler_ == nullptr) { - APP_LOGE("AbilityThread::ScheduleRegisterObserver abilityHandler_ == nullptr"); + HILOG_ERROR("AbilityThread::ScheduleRegisterObserver abilityHandler_ == nullptr"); return false; } bool ret = abilityHandler_->PostTask(task); if (!ret) { - APP_LOGE("AbilityThread::ScheduleRegisterObserver PostTask error"); + HILOG_ERROR("AbilityThread::ScheduleRegisterObserver PostTask error"); } return ret; } @@ -1488,9 +1488,9 @@ bool AbilityThread::ScheduleRegisterObserver(const Uri &uri, const sptr &dataObserver) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); if (!CheckObsPermission()) { - APP_LOGE("%{public}s CheckObsPermission() return false", __func__); + HILOG_ERROR("%{public}s CheckObsPermission() return false", __func__); return false; } @@ -1498,20 +1498,20 @@ bool AbilityThread::ScheduleUnregisterObserver(const Uri &uri, const sptrHandleUnregisterObserver(uri, dataObserver); }; if (abilityHandler_ == nullptr) { - APP_LOGE("AbilityThread::ScheduleUnregisterObserver abilityHandler_ == nullptr"); + HILOG_ERROR("AbilityThread::ScheduleUnregisterObserver abilityHandler_ == nullptr"); return false; } bool ret = abilityHandler_->PostSyncTask(task); if (!ret) { - APP_LOGE("AbilityThread::ScheduleUnregisterObserver PostTask error"); + HILOG_ERROR("AbilityThread::ScheduleUnregisterObserver PostTask error"); } return ret; } @@ -1523,9 +1523,9 @@ bool AbilityThread::ScheduleUnregisterObserver(const Uri &uri, const sptrHandleNotifyChange(uri); }; if (abilityHandler_ == nullptr) { - APP_LOGE("AbilityThread::ScheduleNotifyChange abilityHandler_ == nullptr"); + HILOG_ERROR("AbilityThread::ScheduleNotifyChange abilityHandler_ == nullptr"); return false; } bool ret = abilityHandler_->PostTask(task); if (!ret) { - APP_LOGE("AbilityThread::ScheduleNotifyChange PostTask error"); + HILOG_ERROR("AbilityThread::ScheduleNotifyChange PostTask error"); } return ret; } @@ -1555,17 +1555,17 @@ std::vector> AbilityThread::ExecuteBatch( const std::vector> &operations) { - APP_LOGI("AbilityThread::ExecuteBatch start"); + HILOG_INFO("AbilityThread::ExecuteBatch start"); std::vector> results; if (abilityImpl_ == nullptr) { - APP_LOGE("AbilityThread::ExecuteBatch abilityImpl_ is nullptr"); + HILOG_ERROR("AbilityThread::ExecuteBatch abilityImpl_ is nullptr"); results.clear(); return results; } - APP_LOGI("AbilityThread::ExecuteBatch before abilityImpl_->ExecuteBatch"); + HILOG_INFO("AbilityThread::ExecuteBatch before abilityImpl_->ExecuteBatch"); results = abilityImpl_->ExecuteBatch(operations); - APP_LOGI("AbilityThread::ExecuteBatch after abilityImpl_->ExecuteBatch"); - APP_LOGI("AbilityThread::ExecuteBatch end"); + HILOG_INFO("AbilityThread::ExecuteBatch after abilityImpl_->ExecuteBatch"); + HILOG_INFO("AbilityThread::ExecuteBatch end"); return results; } @@ -1583,17 +1583,17 @@ std::shared_ptr AbilityThread::BuildAbilityConte void AbilityThread::DumpAbilityInfo(const std::vector ¶ms, std::vector &info) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (!params.empty()) { if (abilityImpl_->IsStageBasedModel()) { auto scene = currentAbility_->GetScene(); if (scene == nullptr) { - APP_LOGE("DumpAbilityInfo scene == nullptr"); + HILOG_ERROR("DumpAbilityInfo scene == nullptr"); return; } auto window = scene->GetMainWindow(); if (window == nullptr) { - APP_LOGE("DumpAbilityInfo window == nullptr"); + HILOG_ERROR("DumpAbilityInfo window == nullptr"); return; } window->DumpInfo(params, info); @@ -1607,12 +1607,12 @@ void AbilityThread::DumpAbilityInfo(const std::vector ¶ms, std: info.push_back(dumpInfo); if (!abilityHandler_) { - APP_LOGI("abilityHandler_ is nullptr."); + HILOG_INFO("abilityHandler_ is nullptr."); return; } auto runner = abilityHandler_->GetEventRunner(); if (!runner) { - APP_LOGI("runner_ is nullptr."); + HILOG_INFO("runner_ is nullptr."); return; } @@ -1621,33 +1621,33 @@ void AbilityThread::DumpAbilityInfo(const std::vector ¶ms, std: info.push_back(dumpInfo); if (!currentAbility_) { - APP_LOGI("currentAbility is nullptr."); + HILOG_INFO("currentAbility is nullptr."); return; } const auto ablityContext = currentAbility_->GetAbilityContext(); if (!ablityContext) { - APP_LOGI("current ability context is nullptr."); + HILOG_INFO("current ability context is nullptr."); return; } const auto localCallContainer = ablityContext->GetLocalCallContainer(); if (!localCallContainer) { - APP_LOGI("current ability context locall call container is nullptr."); + HILOG_INFO("current ability context locall call container is nullptr."); return; } localCallContainer->DumpCalls(info); - APP_LOGI("localCallContainer need to get calls info."); + HILOG_INFO("localCallContainer need to get calls info."); } sptr AbilityThread::CallRequest() { - APP_LOGI("AbilityThread::CallRequest begin"); + HILOG_INFO("AbilityThread::CallRequest begin"); if (!currentAbility_) { - APP_LOGI("ability is nullptr."); + HILOG_INFO("ability is nullptr."); return nullptr; } @@ -1656,25 +1656,25 @@ sptr AbilityThread::CallRequest() auto syncTask = [ability = weakAbility, &retval] () { auto currentAbility = ability.lock(); if (currentAbility == nullptr) { - APP_LOGE("ability is nullptr."); + HILOG_ERROR("ability is nullptr."); return; } - APP_LOGD("AbilityThread::CallRequest syncTask CallRequest begin"); + HILOG_DEBUG("AbilityThread::CallRequest syncTask CallRequest begin"); retval = currentAbility->CallRequest(); - APP_LOGD("AbilityThread::CallRequest syncTask CallRequest end %{public}p", retval.GetRefPtr()); + HILOG_DEBUG("AbilityThread::CallRequest syncTask CallRequest end %{public}p", retval.GetRefPtr()); }; if (abilityHandler_ == nullptr) { - APP_LOGE("ability Handler is nullptr."); + HILOG_ERROR("ability Handler is nullptr."); return nullptr; } - APP_LOGD("AbilityThread::CallRequest post sync task"); + HILOG_DEBUG("AbilityThread::CallRequest post sync task"); abilityHandler_->PostSyncTask(syncTask); - APP_LOGI("AbilityThread::CallRequest end"); + HILOG_INFO("AbilityThread::CallRequest end"); return retval; } } // namespace AppExecFwk diff --git a/frameworks/kits/ability/native/src/ability_window.cpp b/frameworks/kits/ability/native/src/ability_window.cpp index 1f0894b664..722ecce9d0 100644 --- a/frameworks/kits/ability/native/src/ability_window.cpp +++ b/frameworks/kits/ability/native/src/ability_window.cpp @@ -16,7 +16,7 @@ #include "ability_window.h" #include "ability.h" #include "ability_handler.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -33,11 +33,11 @@ AbilityWindow::~AbilityWindow() */ void AbilityWindow::Init(std::shared_ptr& handler, std::shared_ptr ability) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); handler_ = handler; ability_ = std::weak_ptr(ability); windowScene_ = std::make_shared(); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -52,28 +52,28 @@ bool AbilityWindow::InitWindow(Rosen::WindowType winType, std::shared_ptr &abilityContext, sptr &listener, int32_t displayId, sptr option) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); auto ret = windowScene_->Init(displayId, abilityContext, listener, option); if (ret != OHOS::Rosen::WMError::WM_OK) { - APP_LOGE("%{public}s error. failed to init window scene!", __func__); + HILOG_ERROR("%{public}s error. failed to init window scene!", __func__); return false; } auto window = windowScene_->GetMainWindow(); if (!window) { - APP_LOGI("%{public}s window is nullptr.", __func__); + HILOG_INFO("%{public}s window is nullptr.", __func__); return false; } ret = window->SetWindowType(winType); if (ret != OHOS::Rosen::WMError::WM_OK) { - APP_LOGE("Set window type error, errcode = %{public}d", ret); + HILOG_ERROR("Set window type error, errcode = %{public}d", ret); return false; } winType_ = winType; isWindowAttached = true; - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return true; } @@ -83,19 +83,19 @@ bool AbilityWindow::InitWindow(Rosen::WindowType winType, */ void AbilityWindow::OnPostAbilityStart() { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); if (!isWindowAttached) { - APP_LOGE("AbilityWindow::OnPostAbilityStart window not attached."); + HILOG_ERROR("AbilityWindow::OnPostAbilityStart window not attached."); return; } if (windowScene_) { - APP_LOGI("%{public}s begin windowScene_->GoBackground.", __func__); + HILOG_INFO("%{public}s begin windowScene_->GoBackground.", __func__); windowScene_->GoBackground(); - APP_LOGI("%{public}s end windowScene_->GoBackground.", __func__); + HILOG_INFO("%{public}s end windowScene_->GoBackground.", __func__); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -104,25 +104,25 @@ void AbilityWindow::OnPostAbilityStart() */ void AbilityWindow::OnPostAbilityActive() { - APP_LOGI("AbilityWindow::OnPostAbilityActive called."); + HILOG_INFO("AbilityWindow::OnPostAbilityActive called."); if (!isWindowAttached) { - APP_LOGE("AbilityWindow::OnPostAbilityActive window not attached."); + HILOG_ERROR("AbilityWindow::OnPostAbilityActive window not attached."); return; } if (windowScene_) { - APP_LOGI("%{public}s begin windowScene_->GoForeground.", __func__); + HILOG_INFO("%{public}s begin windowScene_->GoForeground.", __func__); windowScene_->GoForeground(); - APP_LOGI("%{public}s end windowScene_->GoForeground.", __func__); + HILOG_INFO("%{public}s end windowScene_->GoForeground.", __func__); - APP_LOGI("%{public}s begin windowScene_->RequestFocus.", __func__); + HILOG_INFO("%{public}s begin windowScene_->RequestFocus.", __func__); if (!(winType_ >= Rosen::WindowType::SYSTEM_WINDOW_BASE && winType_ < Rosen::WindowType::SYSTEM_WINDOW_END)) { windowScene_->RequestFocus(); } - APP_LOGI("%{public}s end windowScene_->RequestFocus.", __func__); + HILOG_INFO("%{public}s end windowScene_->RequestFocus.", __func__); } - APP_LOGI("AbilityWindow::OnPostAbilityActive end."); + HILOG_INFO("AbilityWindow::OnPostAbilityActive end."); } /** @@ -131,12 +131,12 @@ void AbilityWindow::OnPostAbilityActive() */ void AbilityWindow::OnPostAbilityInactive() { - APP_LOGI("AbilityWindow::OnPostAbilityInactive called."); + HILOG_INFO("AbilityWindow::OnPostAbilityInactive called."); if (!isWindowAttached) { - APP_LOGE("AbilityWindow::OnPostAbilityInactive window not attached."); + HILOG_ERROR("AbilityWindow::OnPostAbilityInactive window not attached."); return; } - APP_LOGI("AbilityWindow::OnPostAbilityInactive end."); + HILOG_INFO("AbilityWindow::OnPostAbilityInactive end."); } /** @@ -145,19 +145,19 @@ void AbilityWindow::OnPostAbilityInactive() */ void AbilityWindow::OnPostAbilityBackground(uint32_t sceneFlag) { - APP_LOGI("AbilityWindow::OnPostAbilityBackground called."); + HILOG_INFO("AbilityWindow::OnPostAbilityBackground called."); if (!isWindowAttached) { - APP_LOGE("AbilityWindow::OnPostAbilityBackground window not attached."); + HILOG_ERROR("AbilityWindow::OnPostAbilityBackground window not attached."); return; } if (windowScene_) { - APP_LOGI("%{public}s begin windowScene_->GoBackground, sceneFlag:%{public}d.", __func__, sceneFlag); + HILOG_INFO("%{public}s begin windowScene_->GoBackground, sceneFlag:%{public}d.", __func__, sceneFlag); windowScene_->GoBackground(sceneFlag); - APP_LOGI("%{public}s end windowScene_->GoBackground.", __func__); + HILOG_INFO("%{public}s end windowScene_->GoBackground.", __func__); } - APP_LOGI("AbilityWindow::OnPostAbilityBackground end."); + HILOG_INFO("AbilityWindow::OnPostAbilityBackground end."); } /** @@ -166,19 +166,19 @@ void AbilityWindow::OnPostAbilityBackground(uint32_t sceneFlag) */ void AbilityWindow::OnPostAbilityForeground(uint32_t sceneFlag) { - APP_LOGI("AbilityWindow::OnPostAbilityForeground called."); + HILOG_INFO("AbilityWindow::OnPostAbilityForeground called."); if (!isWindowAttached) { - APP_LOGE("AbilityWindow::OnPostAbilityForeground window not attached."); + HILOG_ERROR("AbilityWindow::OnPostAbilityForeground window not attached."); return; } if (windowScene_) { - APP_LOGI("%{public}s begin windowScene_->GoForeground, sceneFlag:%{public}d.", __func__, sceneFlag); + HILOG_INFO("%{public}s begin windowScene_->GoForeground, sceneFlag:%{public}d.", __func__, sceneFlag); windowScene_->GoForeground(sceneFlag); - APP_LOGI("%{public}s end windowScene_->GoForeground.", __func__); + HILOG_INFO("%{public}s end windowScene_->GoForeground.", __func__); } - APP_LOGI("AbilityWindow::OnPostAbilityForeground end."); + HILOG_INFO("AbilityWindow::OnPostAbilityForeground end."); } /** @@ -187,19 +187,19 @@ void AbilityWindow::OnPostAbilityForeground(uint32_t sceneFlag) */ void AbilityWindow::OnPostAbilityStop() { - APP_LOGI("AbilityWindow::OnPostAbilityStop called."); + HILOG_INFO("AbilityWindow::OnPostAbilityStop called."); if (!isWindowAttached) { - APP_LOGE("AbilityWindow::OnPostAbilityStop window not attached."); + HILOG_ERROR("AbilityWindow::OnPostAbilityStop window not attached."); return; } if (windowScene_) { windowScene_ = nullptr; - APP_LOGI("AbilityWindow::widow windowScene_ release end."); + HILOG_INFO("AbilityWindow::widow windowScene_ release end."); } isWindowAttached = false; - APP_LOGI("AbilityWindow::OnPostAbilityStop end."); + HILOG_INFO("AbilityWindow::OnPostAbilityStop end."); } /** @@ -210,7 +210,7 @@ void AbilityWindow::OnPostAbilityStop() const sptr AbilityWindow::GetWindow() { if (!isWindowAttached) { - APP_LOGE("AbilityWindow::GetWindow window not attached."); + HILOG_ERROR("AbilityWindow::GetWindow window not attached."); } return windowScene_ ? windowScene_->GetMainWindow() : nullptr; } diff --git a/frameworks/kits/ability/native/src/continuation/distributed/continuation_handler.cpp b/frameworks/kits/ability/native/src/continuation/distributed/continuation_handler.cpp index b2accd0050..649520f78c 100644 --- a/frameworks/kits/ability/native/src/continuation/distributed/continuation_handler.cpp +++ b/frameworks/kits/ability/native/src/continuation/distributed/continuation_handler.cpp @@ -15,9 +15,9 @@ #include "continuation_handler.h" #include "ability_manager_client.h" -#include "app_log_wrapper.h" #include "distributed_errors.h" #include "element_name.h" +#include "hilog_wrapper.h" using OHOS::AAFwk::WantParams; namespace OHOS { @@ -33,13 +33,13 @@ ContinuationHandler::ContinuationHandler( bool ContinuationHandler::HandleStartContinuationWithStack(const sptr &token, const std::string &deviceId) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (token == nullptr) { - APP_LOGE("HandleStartContinuationWithStack token is null."); + HILOG_ERROR("HandleStartContinuationWithStack token is null."); return false; } if (abilityInfo_ == nullptr) { - APP_LOGE("HandleStartContinuationWithStack abilityInfo is null."); + HILOG_ERROR("HandleStartContinuationWithStack abilityInfo is null."); return false; } @@ -48,7 +48,7 @@ bool ContinuationHandler::HandleStartContinuationWithStack(const sptr continuationManagerTmp = nullptr; continuationManagerTmp = continuationManager_.lock(); if (continuationManagerTmp == nullptr) { - APP_LOGE("HandleStartContinuationWithStack: get continuationManagerTmp is nullptr"); + HILOG_ERROR("HandleStartContinuationWithStack: get continuationManagerTmp is nullptr"); return false; } @@ -56,7 +56,7 @@ bool ContinuationHandler::HandleStartContinuationWithStack(const sptrOnContinue(wantParams); if (status != ERR_OK) { - APP_LOGI("OnContinue failed, BundleName = %{public}s, ClassName= %{public}s, status: %{public}d", + HILOG_INFO("OnContinue failed, BundleName = %{public}s, ClassName= %{public}s, status: %{public}d", abilityInfo_->bundleName.c_str(), abilityInfo_->name.c_str(), status); @@ -67,22 +67,22 @@ bool ContinuationHandler::HandleStartContinuationWithStack(const sptrStartContinuation(want, token, status); if (result != ERR_OK) { - APP_LOGE("startContinuation failed."); + HILOG_ERROR("startContinuation failed."); return false; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return true; } bool ContinuationHandler::HandleStartContinuation(const sptr &token, const std::string &deviceId) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (token == nullptr) { - APP_LOGE("ContinuationHandler::HandleStartContinuation token is null."); + HILOG_ERROR("ContinuationHandler::HandleStartContinuation token is null."); return false; } if (abilityInfo_ == nullptr) { - APP_LOGE("ContinuationHandler::HandleStartContinuation abilityInfo is null."); + HILOG_ERROR("ContinuationHandler::HandleStartContinuation abilityInfo is null."); return false; } @@ -91,14 +91,14 @@ bool ContinuationHandler::HandleStartContinuation(const sptr &tok std::shared_ptr continuationManagerTmp = nullptr; continuationManagerTmp = continuationManager_.lock(); if (continuationManagerTmp == nullptr) { - APP_LOGE("handleStartContinuation: get continuationManagerTmp is nullptr"); + HILOG_ERROR("handleStartContinuation: get continuationManagerTmp is nullptr"); return false; } // DMS decided to start continuation. Callback to ability. if (!continuationManagerTmp->StartContinuation()) { - APP_LOGI("handleStartContinuation: Ability rejected."); - APP_LOGI("ID_ABILITY_SHELL_CONTINUE_ABILITY, BundleName = %{public}s, ClassName= %{public}s", + HILOG_INFO("handleStartContinuation: Ability rejected."); + HILOG_INFO("ID_ABILITY_SHELL_CONTINUE_ABILITY, BundleName = %{public}s, ClassName= %{public}s", abilityInfo_->bundleName.c_str(), abilityInfo_->name.c_str()); return false; @@ -106,8 +106,8 @@ bool ContinuationHandler::HandleStartContinuation(const sptr &tok WantParams wantParams; if (!continuationManagerTmp->SaveData(wantParams)) { - APP_LOGI("handleStartContinuation: ScheduleSaveData failed."); - APP_LOGI("ID_ABILITY_SHELL_CONTINUE_ABILITY, BundleName = %{public}s, ClassName= %{public}s", + HILOG_INFO("handleStartContinuation: ScheduleSaveData failed."); + HILOG_INFO("ID_ABILITY_SHELL_CONTINUE_ABILITY, BundleName = %{public}s, ClassName= %{public}s", abilityInfo_->bundleName.c_str(), abilityInfo_->name.c_str()); return false; @@ -118,18 +118,18 @@ bool ContinuationHandler::HandleStartContinuation(const sptr &tok int result = AAFwk::AbilityManagerClient::GetInstance()->StartContinuation(want, token, 0); if (result != 0) { - APP_LOGE("distClient_.startContinuation failed."); + HILOG_ERROR("distClient_.startContinuation failed."); return false; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return true; } void ContinuationHandler::HandleReceiveRemoteScheduler(const sptr &remoteReplica) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (remoteReplica == nullptr) { - APP_LOGE("scheduler is nullptr"); + HILOG_ERROR("scheduler is nullptr"); return; } @@ -152,66 +152,66 @@ void ContinuationHandler::HandleReceiveRemoteScheduler(const sptr } remoteReplicaProxy_->PassPrimary(remotePrimaryStub_); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } void ContinuationHandler::HandleCompleteContinuation(int result) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::shared_ptr continuationManagerTmp = nullptr; continuationManagerTmp = continuationManager_.lock(); if (continuationManagerTmp == nullptr) { - APP_LOGE("ContinuationHandler::HandleCompleteContinuation: get continuationManagerTmp is nullptr"); + HILOG_ERROR("ContinuationHandler::HandleCompleteContinuation: get continuationManagerTmp is nullptr"); return; } continuationManagerTmp->CompleteContinuation(result); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } void ContinuationHandler::SetReversible(bool reversible) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); reversible_ = reversible; } void ContinuationHandler::SetAbilityInfo(std::shared_ptr &abilityInfo) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); abilityInfo_ = std::make_shared(*(abilityInfo.get())); ClearDeviceInfo(abilityInfo_); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } void ContinuationHandler::SetPrimaryStub(const sptr &Primary) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); remotePrimaryStub_ = Primary; } void ContinuationHandler::ClearDeviceInfo(std::shared_ptr &abilityInfo) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); abilityInfo->deviceId = ""; abilityInfo->deviceTypes.clear(); } void ContinuationHandler::OnReplicaDied(const wptr &remote) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (remoteReplicaProxy_ == nullptr) { - APP_LOGE("BUG: remote death notifies to a unready replica."); + HILOG_ERROR("BUG: remote death notifies to a unready replica."); return; } auto object = remote.promote(); if (!object) { - APP_LOGE("replica on remoteReplica died: null object."); + HILOG_ERROR("replica on remoteReplica died: null object."); return; } if (object != remoteReplicaProxy_->AsObject()) { - APP_LOGE("replica on remoteReplica died: remoteReplica is not matches with remote."); + HILOG_ERROR("replica on remoteReplica died: remoteReplica is not matches with remote."); return; } @@ -224,80 +224,80 @@ void ContinuationHandler::OnReplicaDied(const wptr &remote) remoteReplicaProxy_.clear(); NotifyReplicaTerminated(); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } void ContinuationHandler::NotifyReplicaTerminated() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); CleanUpAfterReverse(); std::shared_ptr continuationManagerTmp = nullptr; continuationManagerTmp = continuationManager_.lock(); if (continuationManagerTmp == nullptr) { - APP_LOGE("ContinuationHandler::NotifyReplicaTerminated: get continuationManagerTmp is nullptr"); + HILOG_ERROR("ContinuationHandler::NotifyReplicaTerminated: get continuationManagerTmp is nullptr"); return; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); continuationManagerTmp->NotifyRemoteTerminated(); } Want ContinuationHandler::SetWantParams(const WantParams &wantParams) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); Want want; want.SetParams(wantParams); want.AddFlags(want.FLAG_ABILITY_CONTINUATION); if (abilityInfo_->launchMode != LaunchMode::STANDARD) { - APP_LOGI("SetWantParams: Clear task."); + HILOG_INFO("SetWantParams: Clear task."); } if (reversible_) { - APP_LOGI("SetWantParams: Reversible."); + HILOG_INFO("SetWantParams: Reversible."); want.AddFlags(Want::FLAG_ABILITY_CONTINUATION_REVERSIBLE); } ElementName element("", abilityInfo_->bundleName, abilityInfo_->name); want.SetElement(element); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return want; } void ContinuationHandler::CleanUpAfterReverse() { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); remoteReplicaProxy_ = nullptr; } void ContinuationHandler::PassPrimary(const sptr &Primary) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); remotePrimaryProxy_ = iface_cast(Primary); } bool ContinuationHandler::ReverseContinuation() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (remotePrimaryProxy_ == nullptr) { - APP_LOGE("ReverseContinuation:remotePrimaryProxy_ not initialized, can not reverse"); + HILOG_ERROR("ReverseContinuation:remotePrimaryProxy_ not initialized, can not reverse"); return false; } if (abilityInfo_ == nullptr) { - APP_LOGE("ReverseContinuation: abilityInfo is null"); + HILOG_ERROR("ReverseContinuation: abilityInfo is null"); return false; } std::shared_ptr continuationManagerTmp = nullptr; continuationManagerTmp = continuationManager_.lock(); if (continuationManagerTmp == nullptr) { - APP_LOGE("ReverseContinuation: get continuationManagerTmp is nullptr"); + HILOG_ERROR("ReverseContinuation: get continuationManagerTmp is nullptr"); return false; } if (!continuationManagerTmp->StartContinuation()) { - APP_LOGE("ReverseContinuation: Ability rejected."); - APP_LOGI("ReverseContinuation, BundleName = %{public}s, ClassName= %{public}s", + HILOG_ERROR("ReverseContinuation: Ability rejected."); + HILOG_INFO("ReverseContinuation, BundleName = %{public}s, ClassName= %{public}s", abilityInfo_->bundleName.c_str(), abilityInfo_->name.c_str()); return false; @@ -305,8 +305,8 @@ bool ContinuationHandler::ReverseContinuation() WantParams wantParams; if (!continuationManagerTmp->SaveData(wantParams)) { - APP_LOGE("ReverseContinuation: SaveData failed."); - APP_LOGI("ReverseContinuation, BundleName = %{public}s, ClassName= %{public}s", + HILOG_ERROR("ReverseContinuation: SaveData failed."); + HILOG_INFO("ReverseContinuation, BundleName = %{public}s, ClassName= %{public}s", abilityInfo_->bundleName.c_str(), abilityInfo_->name.c_str()); return false; @@ -315,41 +315,41 @@ bool ContinuationHandler::ReverseContinuation() Want want; want.SetParams(wantParams); if (remotePrimaryProxy_->ContinuationBack(want)) { - APP_LOGE("reverseContinuation: ContinuationBack send failed."); + HILOG_ERROR("reverseContinuation: ContinuationBack send failed."); return false; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return true; } void ContinuationHandler::NotifyReverseResult(int reverseResult) { - APP_LOGI("NotifyReverseResult: Start. result = %{public}d", reverseResult); + HILOG_INFO("NotifyReverseResult: Start. result = %{public}d", reverseResult); if (reverseResult == 0) { std::shared_ptr ability = nullptr; ability = ability_.lock(); if (ability == nullptr) { - APP_LOGE("ContinuationHandler::NotifyReverseResult failed. ability is nullptr"); + HILOG_ERROR("ContinuationHandler::NotifyReverseResult failed. ability is nullptr"); return; } ability->TerminateAbility(); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } bool ContinuationHandler::ContinuationBack(const Want &want) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::shared_ptr continuationManagerTmp = nullptr; continuationManagerTmp = continuationManager_.lock(); if (continuationManagerTmp == nullptr) { - APP_LOGE("ContinuationBack: get continuationManagerTmp is nullptr"); + HILOG_ERROR("ContinuationBack: get continuationManagerTmp is nullptr"); return false; } int result = 0; if (!continuationManagerTmp->RestoreFromRemote(want.GetParams())) { - APP_LOGI("ContinuationBack: RestoreFromRemote failed."); + HILOG_INFO("ContinuationBack: RestoreFromRemote failed."); result = ABILITY_FAILED_RESTORE_DATA; } @@ -357,34 +357,34 @@ bool ContinuationHandler::ContinuationBack(const Want &want) if (result == 0) { CleanUpAfterReverse(); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return true; } void ContinuationHandler::NotifyTerminationToPrimary() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (remotePrimaryProxy_ == nullptr) { - APP_LOGE("NotifyTerminationToPrimary: remotePrimary not initialized, can not notify"); + HILOG_ERROR("NotifyTerminationToPrimary: remotePrimary not initialized, can not notify"); return; } - APP_LOGI("NotifyTerminationToPrimary: Start"); + HILOG_INFO("NotifyTerminationToPrimary: Start"); remotePrimaryProxy_->NotifyReplicaTerminated(); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } bool ContinuationHandler::ReverseContinueAbility() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (remoteReplicaProxy_ == nullptr) { - APP_LOGE("ReverseContinueAbility: remoteReplica not initialized, can not reverse"); + HILOG_ERROR("ReverseContinueAbility: remoteReplica not initialized, can not reverse"); return false; } - APP_LOGI("ReverseContinueAbility: Start"); + HILOG_INFO("ReverseContinueAbility: Start"); bool requestSendSuccess = remoteReplicaProxy_->ReverseContinuation(); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return requestSendSuccess; } diff --git a/frameworks/kits/ability/native/src/continuation/distributed/continuation_manager.cpp b/frameworks/kits/ability/native/src/continuation/distributed/continuation_manager.cpp index 92d95f336f..75f2a5495d 100644 --- a/frameworks/kits/ability/native/src/continuation/distributed/continuation_manager.cpp +++ b/frameworks/kits/ability/native/src/continuation/distributed/continuation_manager.cpp @@ -18,10 +18,10 @@ #include "ability.h" #include "ability_continuation_interface.h" #include "ability_manager_client.h" -#include "app_log_wrapper.h" #include "continuation_handler.h" #include "distributed_client.h" #include "distributed_objectstore.h" +#include "hilog_wrapper.h" #include "operation_builder.h" #include "string_ex.h" #include "string_wrapper.h" @@ -45,9 +45,9 @@ ContinuationManager::ContinuationManager() bool ContinuationManager::Init(const std::shared_ptr &ability, const sptr &continueToken, const std::shared_ptr &abilityInfo, const std::shared_ptr &continuationHandler) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (ability == nullptr) { - APP_LOGE("ContinuationManager::Init failed. ability is nullptr"); + HILOG_ERROR("ContinuationManager::Init failed. ability is nullptr"); return false; } ability_ = ability; @@ -55,24 +55,24 @@ bool ContinuationManager::Init(const std::shared_ptr &ability, const sp std::shared_ptr abilityTmp = nullptr; abilityTmp = ability_.lock(); if (abilityTmp == nullptr) { - APP_LOGE("ContinuationManager::Init failed. get ability is nullptr"); + HILOG_ERROR("ContinuationManager::Init failed. get ability is nullptr"); return false; } if (abilityTmp->GetAbilityInfo() == nullptr) { - APP_LOGE("ContinuationManager::Init failed. abilityInfo is nullptr"); + HILOG_ERROR("ContinuationManager::Init failed. abilityInfo is nullptr"); return false; } abilityInfo_ = abilityTmp->GetAbilityInfo(); if (continueToken == nullptr) { - APP_LOGE("ContinuationManager::Init failed. continueToken is nullptr"); + HILOG_ERROR("ContinuationManager::Init failed. continueToken is nullptr"); return false; } continueToken_ = continueToken; continuationHandler_ = continuationHandler; - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return true; } @@ -88,25 +88,25 @@ std::string ContinuationManager::GetOriginalDeviceId() void ContinuationManager::ContinueAbilityWithStack(const std::string &deviceId) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); HandleContinueAbilityWithStack(deviceId); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } bool ContinuationManager::HandleContinueAbilityWithStack(const std::string &deviceId) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (!CheckAbilityToken()) { - APP_LOGE("HandleContinueAbilityWithStack checkAbilityToken failed"); + HILOG_ERROR("HandleContinueAbilityWithStack checkAbilityToken failed"); return false; } sptr continueToken = continueToken_; std::shared_ptr continuationHandler = continuationHandler_.lock(); if (continuationHandler == nullptr) { - APP_LOGE("HandleContinueAbilityWithStack continuationHandler is nullptr"); + HILOG_ERROR("HandleContinueAbilityWithStack continuationHandler is nullptr"); return false; } @@ -115,52 +115,52 @@ bool ContinuationManager::HandleContinueAbilityWithStack(const std::string &devi continuationHandler->HandleStartContinuationWithStack(continueToken, deviceId); }; if (!mainHandler_->PostTask(task)) { - APP_LOGE("HandleContinueAbilityWithStack postTask failed"); + HILOG_ERROR("HandleContinueAbilityWithStack postTask failed"); return false; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return true; } int32_t ContinuationManager::OnStartAndSaveData(WantParams &wantParams) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::shared_ptr ability = nullptr; ability = ability_.lock(); if (ability == nullptr) { - APP_LOGE("ability is nullptr"); + HILOG_ERROR("ability is nullptr"); return ERR_INVALID_VALUE; } if (!ability->OnStartContinuation()) { - APP_LOGE("Ability rejected."); + HILOG_ERROR("Ability rejected."); return CONTINUE_ABILITY_REJECTED; } if (!ability->OnSaveData(wantParams)) { - APP_LOGE("SaveData failed."); + HILOG_ERROR("SaveData failed."); return CONTINUE_SAVE_DATA_FAILED; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return ERR_OK; } int32_t ContinuationManager::OnContinueAndGetContent(WantParams &wantParams) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::shared_ptr ability = nullptr; ability = ability_.lock(); if (ability == nullptr) { - APP_LOGE("ability is nullptr"); + HILOG_ERROR("ability is nullptr"); return ERR_INVALID_VALUE; } bool status; - APP_LOGI("OnContinue begin"); + HILOG_INFO("OnContinue begin"); status = ability->OnContinue(wantParams); - APP_LOGI("OnContinue end"); + HILOG_INFO("OnContinue end"); if (!status) { - APP_LOGE("OnContinue failed."); + HILOG_ERROR("OnContinue failed."); return CONTINUE_ON_CONTINUE_FAILED; } auto abilityInfo = abilityInfo_.lock(); @@ -169,25 +169,25 @@ int32_t ContinuationManager::OnContinueAndGetContent(WantParams &wantParams) status = GetContentInfo(wantParams); if (!status) { - APP_LOGE("GetContentInfo failed."); + HILOG_ERROR("GetContentInfo failed."); return CONTINUE_GET_CONTENT_FAILED; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return ERR_OK; } int32_t ContinuationManager::OnContinue(WantParams &wantParams) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); auto ability = ability_.lock(); auto abilityInfo = abilityInfo_.lock(); if (ability == nullptr || abilityInfo == nullptr) { - APP_LOGE("ability or abilityInfo is nullptr"); + HILOG_ERROR("ability or abilityInfo is nullptr"); return ERR_INVALID_VALUE; } bool stageBased = abilityInfo->isStageBasedModel; - APP_LOGI("ability isStageBasedModel %{public}d", stageBased); + HILOG_INFO("ability isStageBasedModel %{public}d", stageBased); if (!stageBased) { return OnStartAndSaveData(wantParams); } else { @@ -197,42 +197,44 @@ int32_t ContinuationManager::OnContinue(WantParams &wantParams) bool ContinuationManager::GetContentInfo(WantParams &wantParams) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::shared_ptr ability = nullptr; ability = ability_.lock(); if (ability == nullptr) { - APP_LOGE("ability is nullptr"); + HILOG_ERROR("ability is nullptr"); return false; } std::string pageStack = ability->GetContentInfo(); if (pageStack.empty()) { - APP_LOGE("GetContentInfo failed."); + HILOG_ERROR("GetContentInfo failed."); return false; } - APP_LOGI("ability pageStack: %{public}s", pageStack.c_str()); + HILOG_INFO("ability pageStack: %{public}s", pageStack.c_str()); wantParams.SetParam(PAGE_STACK_PROPERTY_NAME, String::Box(pageStack)); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return true; } void ContinuationManager::ContinueAbility(bool reversible, const std::string &deviceId) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (CheckContinuationIllegal()) { - APP_LOGE("ContinuationManager::ContinueAbility failed. Ability not available to continueAbility."); + HILOG_ERROR("ContinuationManager::ContinueAbility failed. Ability not available to continueAbility."); return; } if (progressState_ != ProgressState::INITIAL) { - APP_LOGE("ContinuationManager::ContinueAbility failed. Another request in progress. progressState_: %{public}d", + HILOG_ERROR( + "ContinuationManager::ContinueAbility failed. Another request in progress. progressState_: %{public}d", progressState_); return; } if (continuationState_ != ContinuationState::LOCAL_RUNNING) { - APP_LOGE("ContinuationManager::ContinueAbility failed. Illegal continuation state. Current state is %{public}d", + HILOG_ERROR( + "ContinuationManager::ContinueAbility failed. Illegal continuation state. Current state is %{public}d", continuationState_); return; } @@ -241,26 +243,27 @@ void ContinuationManager::ContinueAbility(bool reversible, const std::string &de reversible_ = reversible; ChangeProcessState(ProgressState::WAITING_SCHEDULE); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } bool ContinuationManager::ReverseContinueAbility() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (progressState_ != ProgressState::INITIAL) { - APP_LOGE("ContinuationManager::ReverseContinueAbility failed. progressState_ is %{public}d.", progressState_); + HILOG_ERROR( + "ContinuationManager::ReverseContinueAbility failed. progressState_ is %{public}d.", progressState_); return false; } if (continuationState_ != ContinuationState::REMOTE_RUNNING) { - APP_LOGE("ContinuationManager::ReverseContinueAbility failed. continuationState_ is %{public}d.", + HILOG_ERROR("ContinuationManager::ReverseContinueAbility failed. continuationState_ is %{public}d.", continuationState_); return false; } std::shared_ptr continuationHandler = continuationHandler_.lock(); if (continuationHandler == nullptr) { - APP_LOGE("ContinuationManager::ReverseContinueAbility failed. continuationHandler_ is nullptr."); + HILOG_ERROR("ContinuationManager::ReverseContinueAbility failed. continuationHandler_ is nullptr."); return false; } @@ -269,39 +272,39 @@ bool ContinuationManager::ReverseContinueAbility() ChangeProcessState(ProgressState::WAITING_SCHEDULE); RestoreStateWhenTimeout(TIMEOUT_MS_WAIT_REMOTE_NOTIFY_BACK, ProgressState::WAITING_SCHEDULE); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return requestSuccess; } bool ContinuationManager::StartContinuation() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); ChangeProcessState(ProgressState::IN_PROGRESS); bool result = DoScheduleStartContinuation(); if (!result) { ChangeProcessState(ProgressState::INITIAL); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return result; } bool ContinuationManager::SaveData(WantParams &saveData) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); bool result = DoScheduleSaveData(saveData); if (!result) { ChangeProcessState(ProgressState::INITIAL); } else { RestoreStateWhenTimeout(TIMEOUT_MS_WAIT_DMS_NOTIFY_CONTINUATION_COMPLETE, ProgressState::IN_PROGRESS); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return result; } bool ContinuationManager::RestoreData( const WantParams &restoreData, bool reversible, const std::string &originalDeviceId) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); ChangeProcessState(ProgressState::IN_PROGRESS); bool result = DoScheduleRestoreData(restoreData); if (reversible) { @@ -309,31 +312,32 @@ bool ContinuationManager::RestoreData( } originalDeviceId_ = originalDeviceId; ChangeProcessState(ProgressState::INITIAL); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return result; } void ContinuationManager::NotifyCompleteContinuation( const std::string &originDeviceId, int sessionId, bool success, const sptr &reverseScheduler) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); AAFwk::AbilityManagerClient::GetInstance()->NotifyCompleteContinuation( originDeviceId, sessionId, success); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } void ContinuationManager::CompleteContinuation(int result) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (CheckContinuationIllegal()) { - APP_LOGE("ContinuationManager::CompleteContinuation failed. Ability not available to complete continuation."); + HILOG_ERROR( + "ContinuationManager::CompleteContinuation failed. Ability not available to complete continuation."); return; } std::shared_ptr ability = nullptr; ability = ability_.lock(); if (ability == nullptr) { - APP_LOGE("ContinuationManager::CheckContinuationIllegal failed. ability is nullptr"); + HILOG_ERROR("ContinuationManager::CheckContinuationIllegal failed. ability is nullptr"); return; } @@ -347,12 +351,12 @@ void ContinuationManager::CompleteContinuation(int result) if (!reversible_) { ability->TerminateAbility(); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } bool ContinuationManager::RestoreFromRemote(const WantParams &restoreData) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); ChangeProcessState(ProgressState::IN_PROGRESS); bool result = DoRestoreFromRemote(restoreData); /* @@ -363,60 +367,60 @@ bool ContinuationManager::RestoreFromRemote(const WantParams &restoreData) if (result) { continuationState_ = ContinuationState::LOCAL_RUNNING; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return result; } bool ContinuationManager::NotifyRemoteTerminated() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); continuationState_ = ContinuationState::LOCAL_RUNNING; ChangeProcessState(ProgressState::INITIAL); std::shared_ptr ability = nullptr; ability = ability_.lock(); if (ability == nullptr) { - APP_LOGE("ContinuationManager::NotifyRemoteTerminated failed. ability is nullptr"); + HILOG_ERROR("ContinuationManager::NotifyRemoteTerminated failed. ability is nullptr"); return false; } ability->OnRemoteTerminated(); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return true; } bool ContinuationManager::CheckContinuationIllegal() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::shared_ptr ability = nullptr; ability = ability_.lock(); if (ability == nullptr) { - APP_LOGE("ContinuationManager::CheckContinuationIllegal failed. ability is nullptr"); + HILOG_ERROR("ContinuationManager::CheckContinuationIllegal failed. ability is nullptr"); return false; } if (ability->GetState() >= AbilityLifecycleExecutor::LifecycleState::UNINITIALIZED) { - APP_LOGE("ContinuationManager::CheckContinuationIllegal failed. ability state is wrong: %{public}d", + HILOG_ERROR("ContinuationManager::CheckContinuationIllegal failed. ability state is wrong: %{public}d", ability->GetState()); return true; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return false; } bool ContinuationManager::HandleContinueAbility(bool reversible, const std::string &deviceId) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (!CheckAbilityToken()) { - APP_LOGE("ContinuationManager::HandleContinueAbility failed. CheckAbilityToken failed"); + HILOG_ERROR("ContinuationManager::HandleContinueAbility failed. CheckAbilityToken failed"); return false; } sptr continueToken = continueToken_; std::shared_ptr continuationHandler = continuationHandler_.lock(); if (continuationHandler == nullptr) { - APP_LOGE("ContinuationManager::HandleContinueAbility failed. continuationHandler is nullptr"); + HILOG_ERROR("ContinuationManager::HandleContinueAbility failed. continuationHandler is nullptr"); return false; } continuationHandler->SetReversible(reversible); @@ -427,11 +431,11 @@ bool ContinuationManager::HandleContinueAbility(bool reversible, const std::stri }; if (!mainHandler_->PostTask(task)) { - APP_LOGE("ContinuationManager::HandleContinueAbility failed.PostTask failed"); + HILOG_ERROR("ContinuationManager::HandleContinueAbility failed.PostTask failed"); return false; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return true; } @@ -442,7 +446,7 @@ ContinuationManager::ProgressState ContinuationManager::GetProcessState() void ContinuationManager::ChangeProcessState(const ProgressState &newState) { - APP_LOGI("%{public}s called begin. progressState_: %{public}d, newState: %{public}d", + HILOG_INFO("%{public}s called begin. progressState_: %{public}d, newState: %{public}d", __func__, progressState_, newState); @@ -455,18 +459,18 @@ void ContinuationManager::ChangeProcessStateToInit() { if (mainHandler_ != nullptr) { mainHandler_->RemoveTask("Restore_State_When_Timeout"); - APP_LOGI("Restore_State_When_Timeout task removed"); + HILOG_INFO("Restore_State_When_Timeout task removed"); } ChangeProcessState(ProgressState::INITIAL); } void ContinuationManager::RestoreStateWhenTimeout(long timeoutInMs, const ProgressState &preState) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); InitMainHandlerIfNeed(); auto timeoutTask = [continuationManager = shared_from_this(), preState]() { - APP_LOGI( + HILOG_INFO( "ContinuationManager::RestoreStateWhenTimeout called. preState = %{public}d, currentState = %{public}d.", preState, continuationManager->GetProcessState()); @@ -475,45 +479,45 @@ void ContinuationManager::RestoreStateWhenTimeout(long timeoutInMs, const Progre } }; mainHandler_->PostTask(timeoutTask, "Restore_State_When_Timeout", timeoutInMs); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } void ContinuationManager::InitMainHandlerIfNeed() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (mainHandler_ == nullptr) { - APP_LOGI("Try to init main handler."); + HILOG_INFO("Try to init main handler."); std::lock_guard lock_l(lock_); if ((mainHandler_ == nullptr) && (EventRunner::GetMainEventRunner() != nullptr)) { mainHandler_ = std::make_shared(EventRunner::GetMainEventRunner()); } } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } bool ContinuationManager::CheckAbilityToken() { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); if (continueToken_ == nullptr) { - APP_LOGI("%{public}s called failed", __func__); + HILOG_INFO("%{public}s called failed", __func__); return false; } - APP_LOGI("%{public}s called success", __func__); + HILOG_INFO("%{public}s called success", __func__); return true; } void ContinuationManager::CheckDmsInterfaceResult(int result, const std::string &interfaceName) { - APP_LOGI("ContinuationManager::CheckDmsInterfaceResult called. interfaceName: %{public}s, result: %{public}d.", + HILOG_INFO("ContinuationManager::CheckDmsInterfaceResult called. interfaceName: %{public}s, result: %{public}d.", interfaceName.c_str(), result); } bool ContinuationManager::DoScheduleStartContinuation() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (CheckContinuationIllegal()) { - APP_LOGE( + HILOG_ERROR( "ContinuationManager::DoScheduleStartContinuation called. Ability not available to startContinuation."); return false; } @@ -521,29 +525,29 @@ bool ContinuationManager::DoScheduleStartContinuation() std::shared_ptr ability = nullptr; ability = ability_.lock(); if (ability == nullptr) { - APP_LOGE("ContinuationManager::DoScheduleStartContinuation failed. ability is nullptr"); + HILOG_ERROR("ContinuationManager::DoScheduleStartContinuation failed. ability is nullptr"); return false; } if (!ability->OnStartContinuation()) { - APP_LOGI("%{public}s called failed to StartContinuation", __func__); + HILOG_INFO("%{public}s called failed to StartContinuation", __func__); return false; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return true; } bool ContinuationManager::DoScheduleSaveData(WantParams &saveData) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (CheckContinuationIllegal()) { - APP_LOGE("ContinuationManager::DoScheduleSaveData failed. Ability not available to save data."); + HILOG_ERROR("ContinuationManager::DoScheduleSaveData failed. Ability not available to save data."); return false; } std::shared_ptr ability = nullptr; ability = ability_.lock(); if (ability == nullptr) { - APP_LOGE("ContinuationManager::DoScheduleSaveData failed. ability is nullptr"); + HILOG_ERROR("ContinuationManager::DoScheduleSaveData failed. ability is nullptr"); return false; } @@ -554,24 +558,24 @@ bool ContinuationManager::DoScheduleSaveData(WantParams &saveData) } if (!ret) { - APP_LOGE("ContinuationManager::DoScheduleSaveData failed. Ability save data failed."); + HILOG_ERROR("ContinuationManager::DoScheduleSaveData failed. Ability save data failed."); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return ret; } bool ContinuationManager::DoScheduleRestoreData(const WantParams &restoreData) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (CheckContinuationIllegal()) { - APP_LOGE("ContinuationManager::DoScheduleRestoreData failed. Ability not available to restore data."); + HILOG_ERROR("ContinuationManager::DoScheduleRestoreData failed. Ability not available to restore data."); return false; } std::shared_ptr ability = nullptr; ability = ability_.lock(); if (ability == nullptr) { - APP_LOGE("ContinuationManager::DoScheduleRestoreData failed. ability is nullptr"); + HILOG_ERROR("ContinuationManager::DoScheduleRestoreData failed. ability is nullptr"); return false; } @@ -582,19 +586,19 @@ bool ContinuationManager::DoScheduleRestoreData(const WantParams &restoreData) bool ret = ability->OnRestoreData(abilityRestoreData); if (!ret) { - APP_LOGE("ContinuationManager::DoScheduleRestoreData failed. Ability restore data failed."); + HILOG_ERROR("ContinuationManager::DoScheduleRestoreData failed. Ability restore data failed."); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return ret; } bool ContinuationManager::DoRestoreFromRemote(const WantParams &restoreData) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::shared_ptr ability = nullptr; ability = ability_.lock(); if (ability == nullptr) { - APP_LOGE("ContinuationManager::DoRestoreFromRemote failed. ability is nullptr"); + HILOG_ERROR("ContinuationManager::DoRestoreFromRemote failed. ability is nullptr"); return false; } @@ -605,9 +609,9 @@ bool ContinuationManager::DoRestoreFromRemote(const WantParams &restoreData) bool ret = ability->OnRestoreData(abilityRestoreData); if (!ret) { - APP_LOGE("ContinuationManager::DoRestoreFromRemote failed. Ability restore data failed."); + HILOG_ERROR("ContinuationManager::DoRestoreFromRemote failed. Ability restore data failed."); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return ret; } } // namespace AppExecFwk diff --git a/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_primary.cpp b/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_primary.cpp index d3606b13e6..455b2af0d9 100644 --- a/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_primary.cpp +++ b/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_primary.cpp @@ -14,8 +14,8 @@ */ #include "reverse_continuation_scheduler_primary.h" -#include "app_log_wrapper.h" #include "continuation_handler.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -31,22 +31,22 @@ ReverseContinuationSchedulerPrimary::ReverseContinuationSchedulerPrimary( */ void ReverseContinuationSchedulerPrimary::NotifyReplicaTerminated() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); auto task = [reverseContinuationSchedulerPrimary = this]() { reverseContinuationSchedulerPrimary->HandlerNotifyReplicaTerminated(); }; if (mainHandler_ == nullptr) { - APP_LOGE("ReverseContinuationSchedulerPrimary::NotifyReplicaTerminated mainHandler_ == nullptr"); + HILOG_ERROR("ReverseContinuationSchedulerPrimary::NotifyReplicaTerminated mainHandler_ == nullptr"); return; } bool ret = mainHandler_->PostTask(task); if (!ret) { - APP_LOGE("ReverseContinuationSchedulerPrimary::NotifyReplicaTerminated PostTask error"); + HILOG_ERROR("ReverseContinuationSchedulerPrimary::NotifyReplicaTerminated PostTask error"); return; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } /** @@ -57,50 +57,50 @@ void ReverseContinuationSchedulerPrimary::NotifyReplicaTerminated() */ bool ReverseContinuationSchedulerPrimary::ContinuationBack(const AAFwk::Want &want) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); auto task = [reverseContinuationSchedulerPrimary = this, want]() { reverseContinuationSchedulerPrimary->HandlerContinuationBack(want); }; if (mainHandler_ == nullptr) { - APP_LOGE("ReverseContinuationSchedulerPrimary::ContinuationBack mainHandler_ == nullptr"); + HILOG_ERROR("ReverseContinuationSchedulerPrimary::ContinuationBack mainHandler_ == nullptr"); return false; } bool ret = mainHandler_->PostTask(task); if (!ret) { - APP_LOGE("ReverseContinuationSchedulerPrimary::ContinuationBack PostTask error"); + HILOG_ERROR("ReverseContinuationSchedulerPrimary::ContinuationBack PostTask error"); return false; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return true; } void ReverseContinuationSchedulerPrimary::HandlerNotifyReplicaTerminated() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::shared_ptr continuationHandler = nullptr; continuationHandler = continuationHandler_.lock(); if (continuationHandler == nullptr) { - APP_LOGE( + HILOG_ERROR( "ReverseContinuationSchedulerPrimary::HandlerNotifyReplicaTerminated get continuationHandler is nullptr"); return; } continuationHandler->NotifyReplicaTerminated(); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } void ReverseContinuationSchedulerPrimary::HandlerContinuationBack(const AAFwk::Want &want) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::shared_ptr continuationHandler = nullptr; continuationHandler = continuationHandler_.lock(); if (continuationHandler == nullptr) { - APP_LOGE("ReverseContinuationSchedulerPrimary::HandlerContinuationBack get continuationHandler is nullptr"); + HILOG_ERROR("ReverseContinuationSchedulerPrimary::HandlerContinuationBack get continuationHandler is nullptr"); return; } continuationHandler->ContinuationBack(want); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } } // namespace AppExecFwk diff --git a/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_primary_proxy.cpp b/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_primary_proxy.cpp index 104cffabb0..00b6225f1c 100644 --- a/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_primary_proxy.cpp +++ b/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_primary_proxy.cpp @@ -15,7 +15,7 @@ */ #include "reverse_continuation_scheduler_primary_proxy.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -30,25 +30,25 @@ ReverseContinuationSchedulerPrimaryProxy::ReverseContinuationSchedulerPrimaryPro */ void ReverseContinuationSchedulerPrimaryProxy::NotifyReplicaTerminated() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); if (!data.WriteInterfaceToken(ReverseContinuationSchedulerPrimaryProxy::GetDescriptor())) { - APP_LOGE("ReverseContinuationSchedulerPrimaryProxy::NotifyReplicaTerminated write interface token failed"); + HILOG_ERROR("ReverseContinuationSchedulerPrimaryProxy::NotifyReplicaTerminated write interface token failed"); return; } sptr remoteObject = Remote(); if (remoteObject == nullptr) { - APP_LOGE("ReverseContinuationSchedulerPrimaryProxy::NotifyReplicaTerminated Remote() is nullptr"); + HILOG_ERROR("ReverseContinuationSchedulerPrimaryProxy::NotifyReplicaTerminated Remote() is nullptr"); return; } if (!remoteObject->SendRequest( IReverseContinuationSchedulerPrimary::NOTIFY_REPLICA_TERMINATED, data, reply, option)) { - APP_LOGE("ReverseContinuationSchedulerPrimaryProxy::NotifyReplicaTerminated SendRequest return false"); + HILOG_ERROR("ReverseContinuationSchedulerPrimaryProxy::NotifyReplicaTerminated SendRequest return false"); return; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } /** @@ -59,28 +59,28 @@ void ReverseContinuationSchedulerPrimaryProxy::NotifyReplicaTerminated() */ bool ReverseContinuationSchedulerPrimaryProxy::ContinuationBack(const AAFwk::Want &want) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); if (!data.WriteInterfaceToken(ReverseContinuationSchedulerPrimaryProxy::GetDescriptor())) { - APP_LOGE("ReverseContinuationSchedulerPrimaryProxy::ContinuationBack write interface token failed"); + HILOG_ERROR("ReverseContinuationSchedulerPrimaryProxy::ContinuationBack write interface token failed"); return false; } if (!data.WriteParcelable(&want)) { - APP_LOGE("ReverseContinuationSchedulerPrimaryProxy::ContinuationBack fail to WriteParcelable"); + HILOG_ERROR("ReverseContinuationSchedulerPrimaryProxy::ContinuationBack fail to WriteParcelable"); return false; } sptr remoteObject = Remote(); if (remoteObject == nullptr) { - APP_LOGE("ReverseContinuationSchedulerPrimaryProxy::ContinuationBack Remote() is nullptr"); + HILOG_ERROR("ReverseContinuationSchedulerPrimaryProxy::ContinuationBack Remote() is nullptr"); return false; } if (!remoteObject->SendRequest(IReverseContinuationSchedulerPrimary::CONTINUATION_BACK, data, reply, option)) { - APP_LOGE("ReverseContinuationSchedulerPrimaryProxy::ContinuationBack SendRequest return false"); + HILOG_ERROR("ReverseContinuationSchedulerPrimaryProxy::ContinuationBack SendRequest return false"); return false; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return true; } diff --git a/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_primary_stub.cpp b/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_primary_stub.cpp index ea5dfc772e..7bcbb367d7 100644 --- a/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_primary_stub.cpp +++ b/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_primary_stub.cpp @@ -15,7 +15,7 @@ #include "reverse_continuation_scheduler_primary_stub.h" #include "ability_scheduler_interface.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "string_ex.h" namespace OHOS { @@ -48,11 +48,11 @@ ReverseContinuationSchedulerPrimaryStub::~ReverseContinuationSchedulerPrimaryStu int ReverseContinuationSchedulerPrimaryStub::OnRemoteRequest( uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::u16string token = data.ReadInterfaceToken(); std::u16string descriptor = Str8ToStr16(DESCRIPTOR); if (descriptor != token) { - APP_LOGE("ReverseContinuationSchedulerPrimaryStub::OnRemoteRequest failed, DESCRIPTOR != touken"); + HILOG_ERROR("ReverseContinuationSchedulerPrimaryStub::OnRemoteRequest failed, DESCRIPTOR != touken"); return -1; } @@ -62,37 +62,37 @@ int ReverseContinuationSchedulerPrimaryStub::OnRemoteRequest( if (func != nullptr) { return (this->*func)(data, reply); } else { - APP_LOGW("ReverseContinuationSchedulerPrimaryStub::OnRemoteRequest failed, func is nullptr"); + HILOG_WARN("ReverseContinuationSchedulerPrimaryStub::OnRemoteRequest failed, func is nullptr"); } } else { - APP_LOGW("ReverseContinuationSchedulerPrimaryStub::OnRemoteRequest failed, iter not find"); + HILOG_WARN("ReverseContinuationSchedulerPrimaryStub::OnRemoteRequest failed, iter not find"); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return IPCObjectStub::OnRemoteRequest(code, data, reply, option); } int ReverseContinuationSchedulerPrimaryStub::NotifyReplicaTerminatedInner(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); NotifyReplicaTerminated(); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return 0; } int ReverseContinuationSchedulerPrimaryStub::ContinuationBackInner(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); AAFwk::Want *want = data.ReadParcelable(); if (want == nullptr) { - APP_LOGE("ReverseContinuationSchedulerPrimaryStub::ContinuationBackInner want is nullptr"); + HILOG_ERROR("ReverseContinuationSchedulerPrimaryStub::ContinuationBackInner want is nullptr"); return -1; } if (!ContinuationBack(*want)) { - APP_LOGE("ReverseContinuationSchedulerPrimaryStub::NotifyReverseaTerminatedInner failed, ContinuationBack() " + HILOG_ERROR("ReverseContinuationSchedulerPrimaryStub::NotifyReverseaTerminatedInner failed, ContinuationBack() " "return false"); return -1; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return 0; } diff --git a/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_replica.cpp b/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_replica.cpp index f7d58af0ca..a831a817d8 100644 --- a/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_replica.cpp +++ b/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_replica.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "reverse_continuation_scheduler_replica.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -26,97 +26,97 @@ ReverseContinuationSchedulerReplica::ReverseContinuationSchedulerReplica( } void ReverseContinuationSchedulerReplica::PassPrimary(const sptr &primary) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); auto task = [reverseContinuationSchedulerReplica = this, primary]() { reverseContinuationSchedulerReplica->HandlerPassPrimary(primary); }; if (mainHandler_ == nullptr) { - APP_LOGE("ReverseContinuationSchedulerReplica::PassPrimary mainHandler_ == nullptr"); + HILOG_ERROR("ReverseContinuationSchedulerReplica::PassPrimary mainHandler_ == nullptr"); return; } bool ret = mainHandler_->PostTask(task); if (!ret) { - APP_LOGE("ReverseContinuationSchedulerReplica::PassPrimary PostTask error"); + HILOG_ERROR("ReverseContinuationSchedulerReplica::PassPrimary PostTask error"); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } bool ReverseContinuationSchedulerReplica::ReverseContinuation() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); auto task = [reverseContinuationSchedulerReplica = this]() { reverseContinuationSchedulerReplica->HandlerReverseContinuation(); }; if (mainHandler_ == nullptr) { - APP_LOGE("ReverseContinuationSchedulerReplica::ReverseContinuation mainHandler_ == nullptr"); + HILOG_ERROR("ReverseContinuationSchedulerReplica::ReverseContinuation mainHandler_ == nullptr"); return false; } bool ret = mainHandler_->PostTask(task); if (!ret) { - APP_LOGE("ReverseContinuationSchedulerReplica::ReverseContinuation PostTask error"); + HILOG_ERROR("ReverseContinuationSchedulerReplica::ReverseContinuation PostTask error"); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return true; } void ReverseContinuationSchedulerReplica::NotifyReverseResult(int reverseResult) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); auto task = [reverseContinuationSchedulerReplica = this, reverseResult]() { reverseContinuationSchedulerReplica->HandlerNotifyReverseResult(reverseResult); }; if (mainHandler_ == nullptr) { - APP_LOGE("ReverseContinuationSchedulerReplica::NotifyReverseResult mainHandler_ == nullptr"); + HILOG_ERROR("ReverseContinuationSchedulerReplica::NotifyReverseResult mainHandler_ == nullptr"); return; } bool ret = mainHandler_->PostTask(task); if (!ret) { - APP_LOGE("ReverseContinuationSchedulerReplica::NotifyReverseResult PostTask error"); + HILOG_ERROR("ReverseContinuationSchedulerReplica::NotifyReverseResult PostTask error"); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } void ReverseContinuationSchedulerReplica::HandlerPassPrimary(const sptr &primary) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::shared_ptr replicaHandlerTmp = nullptr; replicaHandlerTmp = replicaHandler_.lock(); if (replicaHandlerTmp == nullptr) { - APP_LOGE("ReverseContinuationSchedulerReplica::PassPrimary get replicaHandlerTmp is nullptr"); + HILOG_ERROR("ReverseContinuationSchedulerReplica::PassPrimary get replicaHandlerTmp is nullptr"); return; } replicaHandlerTmp->PassPrimary(primary); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } bool ReverseContinuationSchedulerReplica::HandlerReverseContinuation() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::shared_ptr replicaHandlerTmp = nullptr; replicaHandlerTmp = replicaHandler_.lock(); if (replicaHandlerTmp == nullptr) { - APP_LOGE("ReverseContinuationSchedulerReplica::PassPrimary get replicaHandlerTmp is nullptr"); + HILOG_ERROR("ReverseContinuationSchedulerReplica::PassPrimary get replicaHandlerTmp is nullptr"); return false; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return replicaHandlerTmp->ReverseContinuation(); } void ReverseContinuationSchedulerReplica::HandlerNotifyReverseResult(int reverseResult) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::shared_ptr replicaHandlerTmp = nullptr; replicaHandlerTmp = replicaHandler_.lock(); if (replicaHandlerTmp == nullptr) { - APP_LOGE("ReverseContinuationSchedulerReplica::PassPrimary get replicaHandlerTmp is nullptr"); + HILOG_ERROR("ReverseContinuationSchedulerReplica::PassPrimary get replicaHandlerTmp is nullptr"); return; } replicaHandlerTmp->NotifyReverseResult(reverseResult); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } } // namespace AppExecFwk diff --git a/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_replica_proxy.cpp b/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_replica_proxy.cpp index c17e7e79ae..31924194d8 100644 --- a/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_replica_proxy.cpp +++ b/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_replica_proxy.cpp @@ -14,7 +14,7 @@ */ #include "reverse_continuation_scheduler_replica_proxy.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -31,42 +31,42 @@ sptr ReverseContinuationSchedulerReplicaProxy::AsObject() } void ReverseContinuationSchedulerReplicaProxy::PassPrimary(const sptr &primary) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); if (!data.WriteInterfaceToken(ReverseContinuationSchedulerReplicaProxy::GetDescriptor())) { - APP_LOGE("ReverseContinuationSchedulerReplicaProxy::PassPrimary write interface token failed"); + HILOG_ERROR("ReverseContinuationSchedulerReplicaProxy::PassPrimary write interface token failed"); return; } if (!data.WriteRemoteObject(primary)) { - APP_LOGE("ReverseContinuationSchedulerReplicaProxy::PassPrimary write parcel callback failed"); + HILOG_ERROR("ReverseContinuationSchedulerReplicaProxy::PassPrimary write parcel callback failed"); return; } sptr remoteObject = Remote(); if (remoteObject == nullptr) { - APP_LOGE("ReverseContinuationSchedulerReplicaProxy::PassPrimary Remote() is NULL"); + HILOG_ERROR("ReverseContinuationSchedulerReplicaProxy::PassPrimary Remote() is NULL"); return; } if (!remoteObject->SendRequest( static_cast(IReverseContinuationSchedulerReplica::Message::PASS_PRIMARY), data, reply, option)) { - APP_LOGE("ReverseContinuationSchedulerReplicaProxy::PassPrimary SendRequest return false"); + HILOG_ERROR("ReverseContinuationSchedulerReplicaProxy::PassPrimary SendRequest return false"); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } bool ReverseContinuationSchedulerReplicaProxy::ReverseContinuation() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); if (!data.WriteInterfaceToken(ReverseContinuationSchedulerReplicaProxy::GetDescriptor())) { - APP_LOGE("ReverseContinuationSchedulerReplicaProxy::ReverseContinuation write interface token failed"); + HILOG_ERROR("ReverseContinuationSchedulerReplicaProxy::ReverseContinuation write interface token failed"); return false; } sptr remoteObject = Remote(); if (remoteObject == nullptr) { - APP_LOGE("ReverseContinuationSchedulerReplicaProxy::ReverseContinuation Remote() is nullptr"); + HILOG_ERROR("ReverseContinuationSchedulerReplicaProxy::ReverseContinuation Remote() is nullptr"); return false; } if (!remoteObject->SendRequest( @@ -74,29 +74,29 @@ bool ReverseContinuationSchedulerReplicaProxy::ReverseContinuation() data, reply, option)) { - APP_LOGE("ReverseContinuationSchedulerReplicaProxy::ReverseContinuation SendRequest return false"); + HILOG_ERROR("ReverseContinuationSchedulerReplicaProxy::ReverseContinuation SendRequest return false"); return false; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return true; } void ReverseContinuationSchedulerReplicaProxy::NotifyReverseResult(int reverseResult) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); if (!data.WriteInterfaceToken(ReverseContinuationSchedulerReplicaProxy::GetDescriptor())) { - APP_LOGE("ReverseContinuationSchedulerReplicaProxy::NotifyReverseResult write interface token failed"); + HILOG_ERROR("ReverseContinuationSchedulerReplicaProxy::NotifyReverseResult write interface token failed"); return; } if (!data.WriteInt32(reverseResult)) { - APP_LOGE("ReverseContinuationSchedulerReplicaProxy::NotifyReverseResult write parcel flags failed"); + HILOG_ERROR("ReverseContinuationSchedulerReplicaProxy::NotifyReverseResult write parcel flags failed"); return; } sptr remoteObject = Remote(); if (remoteObject == nullptr) { - APP_LOGE("ReverseContinuationSchedulerReplicaProxy::NotifyReverseResult Remote() is NULL"); + HILOG_ERROR("ReverseContinuationSchedulerReplicaProxy::NotifyReverseResult Remote() is NULL"); return; } if (!remoteObject->SendRequest( @@ -104,9 +104,9 @@ void ReverseContinuationSchedulerReplicaProxy::NotifyReverseResult(int reverseRe data, reply, option)) { - APP_LOGE("ReverseContinuationSchedulerReplicaProxy::NotifyReverseResult SendRequest return false"); + HILOG_ERROR("ReverseContinuationSchedulerReplicaProxy::NotifyReverseResult SendRequest return false"); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file diff --git a/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_replica_stub.cpp b/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_replica_stub.cpp index e37bed205a..63a3a10f0e 100644 --- a/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_replica_stub.cpp +++ b/frameworks/kits/ability/native/src/continuation/distributed/reverse_continuation_scheduler_replica_stub.cpp @@ -14,7 +14,7 @@ */ #include "reverse_continuation_scheduler_replica_stub.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -33,35 +33,35 @@ ReverseContinuationSchedulerReplicaStub::~ReverseContinuationSchedulerReplicaStu } int32_t ReverseContinuationSchedulerReplicaStub::PassPrimaryInner(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); const sptr primary = data.ReadParcelable(); PassPrimary(primary); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return NO_ERROR; } int32_t ReverseContinuationSchedulerReplicaStub::ReverseContinuationInner(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); ReverseContinuation(); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return NO_ERROR; } int32_t ReverseContinuationSchedulerReplicaStub::NotifyReverseResultInner(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); int reverseResult = data.ReadInt32(); NotifyReverseResult(reverseResult); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return NO_ERROR; } int ReverseContinuationSchedulerReplicaStub::OnRemoteRequest( uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - APP_LOGI("%{public}s called begin, code = %{public}d, flags= %{public}d.", __func__, code, option.GetFlags()); + HILOG_INFO("%{public}s called begin, code = %{public}d, flags= %{public}d.", __func__, code, option.GetFlags()); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (remoteDescriptor != ReverseContinuationSchedulerReplicaStub::GetDescriptor()) { - APP_LOGE("ReverseContinuationSchedulerReplicaStub::OnRemoteRequest token is invalid"); + HILOG_ERROR("ReverseContinuationSchedulerReplicaStub::OnRemoteRequest token is invalid"); return ERR_INVALID_STATE; } @@ -72,7 +72,7 @@ int ReverseContinuationSchedulerReplicaStub::OnRemoteRequest( return (this->*continuationFunc)(data, reply); } } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return IPCObjectStub::OnRemoteRequest(code, data, reply, option); } } // namespace AppExecFwk diff --git a/frameworks/kits/ability/native/src/continuation/remote_register_service/connect_callback_proxy.cpp b/frameworks/kits/ability/native/src/continuation/remote_register_service/connect_callback_proxy.cpp index 6e40602263..90bb42e9c3 100644 --- a/frameworks/kits/ability/native/src/continuation/remote_register_service/connect_callback_proxy.cpp +++ b/frameworks/kits/ability/native/src/continuation/remote_register_service/connect_callback_proxy.cpp @@ -14,8 +14,8 @@ */ #include "connect_callback_proxy.h" -#include "app_log_wrapper.h" #include "extra_params.h" +#include "hilog_wrapper.h" #include "string_ex.h" namespace OHOS { @@ -29,15 +29,15 @@ namespace AppExecFwk { */ void ConnectCallbackProxy::Connect(const string &deviceId, const string &deviceType) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); MessageParcel data; if (!data.WriteInterfaceToken(IConnectCallback::GetDescriptor()) || !data.WriteString(deviceId) || data.WriteString(deviceType)) { - APP_LOGE("%{public}s params is wrong", __func__); + HILOG_ERROR("%{public}s params is wrong", __func__); return; } RemoteRequest(data, COMMAND_CONNECT); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } /** * @brief Remote device sends disconnection request. @@ -46,25 +46,25 @@ void ConnectCallbackProxy::Connect(const string &deviceId, const string &deviceT */ void ConnectCallbackProxy::Disconnect(const string &deviceId) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); MessageParcel data; if (!data.WriteInterfaceToken(IConnectCallback::GetDescriptor()) || !data.WriteString(deviceId)) { - APP_LOGE("%{public}s params is wrong", __func__); + HILOG_ERROR("%{public}s params is wrong", __func__); return; } RemoteRequest(data, COMMAND_DISCONNECT); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } void ConnectCallbackProxy::RemoteRequest(MessageParcel &data, int commandDisconnect) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); MessageParcel reply; MessageOption option; if (Remote() == nullptr) { return; } Remote()->SendRequest(commandDisconnect, data, reply, option); - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); } } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file diff --git a/frameworks/kits/ability/native/src/continuation/remote_register_service/connect_callback_stub.cpp b/frameworks/kits/ability/native/src/continuation/remote_register_service/connect_callback_stub.cpp index ec621fd073..858f63e741 100644 --- a/frameworks/kits/ability/native/src/continuation/remote_register_service/connect_callback_stub.cpp +++ b/frameworks/kits/ability/native/src/continuation/remote_register_service/connect_callback_stub.cpp @@ -14,8 +14,8 @@ */ #include "connect_callback_stub.h" -#include "app_log_wrapper.h" #include "ipc_types.h" +#include "hilog_wrapper.h" #include "string_ex.h" namespace OHOS { @@ -29,20 +29,20 @@ ConnectCallbackStub::ConnectCallbackStub() int ConnectCallbackStub::ConnectInner(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); string deviceId = Str16ToStr8(data.ReadString16()); string deviceType = Str16ToStr8(data.ReadString16()); Connect(deviceId, deviceType); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return OHOS::ERR_NONE; } int ConnectCallbackStub::DisconnectInner(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); string deviceId = Str16ToStr8(data.ReadString16()); Disconnect(deviceId); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return OHOS::ERR_NONE; } /** @@ -55,10 +55,10 @@ int ConnectCallbackStub::DisconnectInner(MessageParcel &data, MessageParcel &rep int ConnectCallbackStub::OnRemoteRequest( uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::u16string token = data.ReadInterfaceToken(); if (token.compare(IConnectCallback::GetDescriptor()) != 0) { - APP_LOGE("%{public}s Descriptor is wrong", __func__); + HILOG_ERROR("%{public}s Descriptor is wrong", __func__); return OHOS::ERR_INVALID_REPLY; } auto localFuncIt = memberFuncMap_.find(code); @@ -68,7 +68,7 @@ int ConnectCallbackStub::OnRemoteRequest( return (this->*memberFunc)(data, reply); } } - APP_LOGI("ConnectCallbackStub::OnRemoteRequest, default case, need check."); + HILOG_INFO("ConnectCallbackStub::OnRemoteRequest, default case, need check."); return IPCObjectStub::OnRemoteRequest(code, data, reply, option); } } // namespace AppExecFwk diff --git a/frameworks/kits/ability/native/src/continuation/remote_register_service/continuation_connector.cpp b/frameworks/kits/ability/native/src/continuation/remote_register_service/continuation_connector.cpp index e2c0f67ae7..f7eb8b575f 100644 --- a/frameworks/kits/ability/native/src/continuation/remote_register_service/continuation_connector.cpp +++ b/frameworks/kits/ability/native/src/continuation/remote_register_service/continuation_connector.cpp @@ -15,8 +15,8 @@ #include "continuation_connector.h" -#include "app_log_wrapper.h" #include "continuation_device_callback_proxy.h" +#include "hilog_wrapper.h" #include "remote_register_service_proxy.h" namespace OHOS { @@ -62,14 +62,14 @@ sptr ContinuationConnector::GetInstance(const std::weak_p void ContinuationConnector::OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (remoteObject == nullptr) { - APP_LOGE("ContinuationConnector::OnAbilityConnectDone failed, remote is nullptr"); + HILOG_ERROR("ContinuationConnector::OnAbilityConnectDone failed, remote is nullptr"); return; } remoteRegisterService_ = iface_cast(remoteObject); if (remoteRegisterService_ == nullptr) { - APP_LOGE("ContinuationConnector::OnAbilityConnectDone failed, remoteRegisterService_ is nullptr"); + HILOG_ERROR("ContinuationConnector::OnAbilityConnectDone failed, remoteRegisterService_ is nullptr"); return; } isConnected_.store(true); @@ -80,7 +80,7 @@ void ContinuationConnector::OnAbilityConnectDone( } continuationRequestList_.clear(); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } /** @@ -94,10 +94,10 @@ void ContinuationConnector::OnAbilityConnectDone( */ void ContinuationConnector::OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); remoteRegisterService_ = nullptr; isConnected_.store(false); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } /** @@ -107,18 +107,18 @@ void ContinuationConnector::OnAbilityDisconnectDone(const AppExecFwk::ElementNam */ void ContinuationConnector::BindRemoteRegisterAbility(const std::shared_ptr &request) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::shared_ptr tmpcontext = context_.lock(); if (tmpcontext == nullptr) { - APP_LOGE("ContinuationConnector::BindRemoteRegisterAbility failed, context_.lock is nullptr"); + HILOG_ERROR("ContinuationConnector::BindRemoteRegisterAbility failed, context_.lock is nullptr"); return; } if (request == nullptr) { - APP_LOGE("ContinuationConnector::BindRemoteRegisterAbility failed, request is nullptr"); + HILOG_ERROR("ContinuationConnector::BindRemoteRegisterAbility failed, request is nullptr"); return; } if (IsAbilityConnected()) { - APP_LOGI("ContinuationConnector::BindRemoteRegisterAbility, remote register bounded"); + HILOG_INFO("ContinuationConnector::BindRemoteRegisterAbility, remote register bounded"); request->Execute(); return; } @@ -128,7 +128,7 @@ void ContinuationConnector::BindRemoteRegisterAbility(const std::shared_ptrDisconnectAbility(this); isConnected_.store(false); remoteRegisterService_ = nullptr; - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } /** @@ -168,13 +168,13 @@ bool ContinuationConnector::IsAbilityConnected() */ bool ContinuationConnector::Unregister(int token) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (remoteRegisterService_ == nullptr) { - APP_LOGE("ContinuationConnector::Unregister failed, remoteRegisterService_ is nullptr"); + HILOG_ERROR("ContinuationConnector::Unregister failed, remoteRegisterService_ is nullptr"); return false; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return remoteRegisterService_->Unregister(token); } @@ -189,13 +189,13 @@ bool ContinuationConnector::Unregister(int token) */ bool ContinuationConnector::UpdateConnectStatus(int token, const std::string &deviceId, int status) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (remoteRegisterService_ == nullptr) { - APP_LOGE("ContinuationConnector::UpdateConnectStatus failed, remoteRegisterService_ is nullptr"); + HILOG_ERROR("ContinuationConnector::UpdateConnectStatus failed, remoteRegisterService_ is nullptr"); return false; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return remoteRegisterService_->UpdateConnectStatus(token, deviceId, status); } @@ -208,12 +208,12 @@ bool ContinuationConnector::UpdateConnectStatus(int token, const std::string &de */ bool ContinuationConnector::ShowDeviceList(int token, const AppExecFwk::ExtraParams ¶meter) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (remoteRegisterService_ == nullptr) { - APP_LOGE("ContinuationConnector::ShowDeviceList failed, remoteRegisterService_ is nullptr"); + HILOG_ERROR("ContinuationConnector::ShowDeviceList failed, remoteRegisterService_ is nullptr"); return false; } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return remoteRegisterService_->ShowDeviceList(token, parameter); } @@ -230,25 +230,25 @@ bool ContinuationConnector::ShowDeviceList(int token, const AppExecFwk::ExtraPar int ContinuationConnector::Register(std::weak_ptr &context, std::string bundleName, const AppExecFwk::ExtraParams ¶meter, std::shared_ptr &callback) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::shared_ptr pcontext = context.lock(); if (pcontext == nullptr) { - APP_LOGE("ContinuationConnector::Register failed, pcontext is nullptr"); + HILOG_ERROR("ContinuationConnector::Register failed, pcontext is nullptr"); return -1; } if (remoteRegisterService_ == nullptr) { - APP_LOGE("ContinuationConnector::Register failed, remoteRegisterService_ is nullptr"); + HILOG_ERROR("ContinuationConnector::Register failed, remoteRegisterService_ is nullptr"); return -1; } sptr token = pcontext->GetToken(); if (token == nullptr) { - APP_LOGE("ContinuationConnector::Register failed, token is nullptr"); + HILOG_ERROR("ContinuationConnector::Register failed, token is nullptr"); return -1; } sptr callBackSptr(new (std::nothrow) ContinuationDeviceCallbackProxy(callback)); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return remoteRegisterService_->Register(bundleName, token, parameter, callBackSptr); } @@ -257,17 +257,17 @@ int ContinuationConnector::Register(std::weak_ptr &context, std::string */ void ContinuationConnector::BindRemoteRegisterAbility() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::shared_ptr tmpcontext = context_.lock(); if (tmpcontext == nullptr) { - APP_LOGE("ContinuationConnector::BindRemoteRegisterAbility failed, context_.lock is nullptr"); + HILOG_ERROR("ContinuationConnector::BindRemoteRegisterAbility failed, context_.lock is nullptr"); return; } Want want; want.SetElementName(CONNECTOR_DEVICE_ID, CONNECTOR_BUNDLE_NAME, CONNECTOR_ABILITY_NAME); want.AddFlags(Want::FLAG_NOT_OHOS_COMPONENT); tmpcontext->ConnectAbility(want, this); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } } // namespace AppExecFwk diff --git a/frameworks/kits/ability/native/src/continuation/remote_register_service/continuation_device_callback_proxy.cpp b/frameworks/kits/ability/native/src/continuation/remote_register_service/continuation_device_callback_proxy.cpp index 7c2298659a..3f101cbcde 100644 --- a/frameworks/kits/ability/native/src/continuation/remote_register_service/continuation_device_callback_proxy.cpp +++ b/frameworks/kits/ability/native/src/continuation/remote_register_service/continuation_device_callback_proxy.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "continuation_device_callback_proxy.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { /** @@ -30,28 +30,28 @@ ContinuationDeviceCallbackProxy::~ContinuationDeviceCallbackProxy() {} void ContinuationDeviceCallbackProxy::Connect(const std::string &deviceId, const std::string &deviceType) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::shared_ptr callback = nullptr; callback = callback_.lock(); if (callback == nullptr) { - APP_LOGE("%{public}s callback is null", __func__); + HILOG_ERROR("%{public}s callback is null", __func__); return; } callback->OnDeviceConnectDone(deviceId, deviceType); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } void ContinuationDeviceCallbackProxy::Disconnect(const std::string &deviceId) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::shared_ptr callback = nullptr; callback = callback_.lock(); if (callback == nullptr) { - APP_LOGE("%{public}s callback is null", __func__); + HILOG_ERROR("%{public}s callback is null", __func__); return; } callback->OnDeviceDisconnectDone(deviceId); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file diff --git a/frameworks/kits/ability/native/src/continuation/remote_register_service/continuation_register_manager.cpp b/frameworks/kits/ability/native/src/continuation/remote_register_service/continuation_register_manager.cpp index 392a740ad7..7cb9442c55 100644 --- a/frameworks/kits/ability/native/src/continuation/remote_register_service/continuation_register_manager.cpp +++ b/frameworks/kits/ability/native/src/continuation/remote_register_service/continuation_register_manager.cpp @@ -14,10 +14,10 @@ */ #include "continuation_register_manager.h" -#include "app_log_wrapper.h" #include "continuation_device_callback_interface.h" #include "continuation_register_manager_proxy.h" #include "extra_params.h" +#include "hilog_wrapper.h" #include "request_callback.h" namespace OHOS { @@ -41,12 +41,12 @@ void ContinuationRegisterManager::Register(const std::string &bundleName, const const std::shared_ptr &deviceCallback, const std::shared_ptr &requestCallback) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (continuationRegisterManagerProxy_ != nullptr) { continuationRegisterManagerProxy_->Register(bundleName, parameter, deviceCallback, requestCallback); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } else { - APP_LOGE("%{public}s, ContinuationRegisterManagerProxy is null", __func__); + HILOG_ERROR("%{public}s, ContinuationRegisterManagerProxy is null", __func__); } } @@ -58,12 +58,12 @@ void ContinuationRegisterManager::Register(const std::string &bundleName, const */ void ContinuationRegisterManager::Unregister(int token, const std::shared_ptr &requestCallback) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (continuationRegisterManagerProxy_ != nullptr) { continuationRegisterManagerProxy_->Unregister(token, requestCallback); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } else { - APP_LOGE("%{public}s, ContinuationRegisterManagerProxy is null", __func__); + HILOG_ERROR("%{public}s, ContinuationRegisterManagerProxy is null", __func__); } } @@ -78,12 +78,12 @@ void ContinuationRegisterManager::Unregister(int token, const std::shared_ptr &requestCallback) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (continuationRegisterManagerProxy_ != nullptr) { continuationRegisterManagerProxy_->UpdateConnectStatus(token, deviceId, status, requestCallback); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } else { - APP_LOGE("%{public}s, ContinuationRegisterManagerProxy is null", __func__); + HILOG_ERROR("%{public}s, ContinuationRegisterManagerProxy is null", __func__); } } @@ -97,12 +97,12 @@ void ContinuationRegisterManager::UpdateConnectStatus( void ContinuationRegisterManager::ShowDeviceList( int token, const ExtraParams ¶meter, const std::shared_ptr &requestCallback) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (continuationRegisterManagerProxy_ != nullptr) { continuationRegisterManagerProxy_->ShowDeviceList(token, parameter, requestCallback); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } else { - APP_LOGE("%{public}s, ContinuationRegisterManagerProxy is null", __func__); + HILOG_ERROR("%{public}s, ContinuationRegisterManagerProxy is null", __func__); } } @@ -111,12 +111,12 @@ void ContinuationRegisterManager::ShowDeviceList( */ void ContinuationRegisterManager::Disconnect(void) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (continuationRegisterManagerProxy_ != nullptr) { continuationRegisterManagerProxy_->Disconnect(); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } else { - APP_LOGE("%{public}s, ContinuationRegisterManagerProxy is null", __func__); + HILOG_ERROR("%{public}s, ContinuationRegisterManagerProxy is null", __func__); } } } // namespace AppExecFwk diff --git a/frameworks/kits/ability/native/src/continuation/remote_register_service/continuation_register_manager_proxy.cpp b/frameworks/kits/ability/native/src/continuation/remote_register_service/continuation_register_manager_proxy.cpp index 85e8cd3e49..34ebc8e400 100644 --- a/frameworks/kits/ability/native/src/continuation/remote_register_service/continuation_register_manager_proxy.cpp +++ b/frameworks/kits/ability/native/src/continuation/remote_register_service/continuation_register_manager_proxy.cpp @@ -14,11 +14,11 @@ */ #include "continuation_register_manager_proxy.h" -#include "app_log_wrapper.h" #include "context.h" #include "continuation_connector.h" #include "continuation_device_callback_interface.h" #include "continuation_request.h" +#include "hilog_wrapper.h" #include "request_callback.h" namespace OHOS { @@ -35,16 +35,16 @@ ContinuationRequestRegister::ContinuationRequestRegister(const std::string &bund void ContinuationRequestRegister::Execute(void) { if (continuatinConnector_ == nullptr) { - APP_LOGE("%{public}s called, continuatinConnector is null", __func__); + HILOG_ERROR("%{public}s called, continuatinConnector is null", __func__); return; } int ret = continuatinConnector_->Register(context_, bundleName_, parameter_, deviceCallback_); if (requestCallback_ != nullptr) { requestCallback_->OnResult(ret); - APP_LOGI("%{public}s called, ret=%{public}d", __func__, ret); + HILOG_INFO("%{public}s called, ret=%{public}d", __func__, ret); } else { - APP_LOGE("%{public}s called, requestCallback is null", __func__); + HILOG_ERROR("%{public}s called, requestCallback is null", __func__); } } @@ -56,16 +56,16 @@ ContinuationRequestUnRegister::ContinuationRequestUnRegister(int token) void ContinuationRequestUnRegister::Execute(void) { if (continuatinConnector_ == nullptr) { - APP_LOGE("%{public}s called, continuatinConnector is null", __func__); + HILOG_ERROR("%{public}s called, continuatinConnector is null", __func__); return; } bool ret = continuatinConnector_->Unregister(token_); if (requestCallback_ != nullptr) { requestCallback_->OnResult(ret ? 0 : -1); - APP_LOGI("%{public}s called, ret=%{public}d", __func__, (ret ? 0 : -1)); + HILOG_INFO("%{public}s called, ret=%{public}d", __func__, (ret ? 0 : -1)); } else { - APP_LOGE("%{public}s called, requestCallback is null", __func__); + HILOG_ERROR("%{public}s called, requestCallback is null", __func__); } } @@ -80,16 +80,16 @@ ContinuationRequestUpdateConnectStatus::ContinuationRequestUpdateConnectStatus( void ContinuationRequestUpdateConnectStatus::Execute(void) { if (continuatinConnector_ == nullptr) { - APP_LOGE("%{public}s called, continuatinConnector is null", __func__); + HILOG_ERROR("%{public}s called, continuatinConnector is null", __func__); return; } bool ret = continuatinConnector_->UpdateConnectStatus(token_, deviceId_, status_); if (requestCallback_ != nullptr) { requestCallback_->OnResult(ret ? 0 : -1); - APP_LOGI("%{public}s called, ret=%{public}d", __func__, (ret ? 0 : -1)); + HILOG_INFO("%{public}s called, ret=%{public}d", __func__, (ret ? 0 : -1)); } else { - APP_LOGE("%{public}s called, requestCallback is null", __func__); + HILOG_ERROR("%{public}s called, requestCallback is null", __func__); } } @@ -102,16 +102,16 @@ ContinuationRequestShowDeviceList::ContinuationRequestShowDeviceList(int token, void ContinuationRequestShowDeviceList::Execute(void) { if (continuatinConnector_ == nullptr) { - APP_LOGE("%{public}s called, continuatinConnector is null", __func__); + HILOG_ERROR("%{public}s called, continuatinConnector is null", __func__); return; } bool ret = continuatinConnector_->ShowDeviceList(token_, parameter_); if (requestCallback_ != nullptr) { requestCallback_->OnResult(ret ? 0 : -1); - APP_LOGI("%{public}s called, ret=%{public}d", __func__, (ret ? 0 : -1)); + HILOG_INFO("%{public}s called, ret=%{public}d", __func__, (ret ? 0 : -1)); } else { - APP_LOGE("%{public}s called, requestCallback is null", __func__); + HILOG_ERROR("%{public}s called, requestCallback is null", __func__); } } @@ -142,10 +142,10 @@ void ContinuationRegisterManagerProxy::Register(const std::string &bundleName, c const std::shared_ptr &deviceCallback, const std::shared_ptr &requestCallback) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); if (context_.lock() == nullptr || applicationContext_.lock() == nullptr) { - APP_LOGE("%{public}s context or applicationContext is null", __func__); + HILOG_ERROR("%{public}s context or applicationContext is null", __func__); return; } @@ -160,7 +160,7 @@ void ContinuationRegisterManagerProxy::Register(const std::string &bundleName, c SendRequest(applicationContext_, request); } else { - APP_LOGE("%{public}s Create ContinuationRequestRegister failed", __func__); + HILOG_ERROR("%{public}s Create ContinuationRequestRegister failed", __func__); } } @@ -174,10 +174,10 @@ void ContinuationRegisterManagerProxy::Register(const std::string &bundleName, c */ void ContinuationRegisterManagerProxy::Unregister(int token, const std::shared_ptr &requestCallback) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); if (applicationContext_.lock() == nullptr) { - APP_LOGI("%{public}s Context is null", __func__); + HILOG_INFO("%{public}s Context is null", __func__); return; } @@ -191,7 +191,7 @@ void ContinuationRegisterManagerProxy::Unregister(int token, const std::shared_p SendRequest(applicationContext_, request); } else { - APP_LOGE("%{public}s Create ContinuationRequestUnRegister failed", __func__); + HILOG_ERROR("%{public}s Create ContinuationRequestUnRegister failed", __func__); } } @@ -209,10 +209,10 @@ void ContinuationRegisterManagerProxy::Unregister(int token, const std::shared_p void ContinuationRegisterManagerProxy::UpdateConnectStatus( int token, const std::string &deviceId, int status, const std::shared_ptr &requestCallback) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); if (applicationContext_.lock() == nullptr) { - APP_LOGI("%{public}s Context is null", __func__); + HILOG_INFO("%{public}s Context is null", __func__); return; } @@ -227,7 +227,7 @@ void ContinuationRegisterManagerProxy::UpdateConnectStatus( SendRequest(applicationContext_, request); } else { - APP_LOGE("%{public}s Create ContinuationRequestUpdateConnectStatus failed", __func__); + HILOG_ERROR("%{public}s Create ContinuationRequestUpdateConnectStatus failed", __func__); } } @@ -243,10 +243,10 @@ void ContinuationRegisterManagerProxy::UpdateConnectStatus( void ContinuationRegisterManagerProxy::ShowDeviceList( int token, const ExtraParams ¶meter, const std::shared_ptr &requestCallback) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (applicationContext_.lock() == nullptr) { - APP_LOGI("%{public}s Context is null", __func__); + HILOG_INFO("%{public}s Context is null", __func__); return; } @@ -259,9 +259,9 @@ void ContinuationRegisterManagerProxy::ShowDeviceList( std::shared_ptr request(pContinuationRequestShowDeviceList); SendRequest(applicationContext_, request); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } else { - APP_LOGE("%{public}s Create ContinuationRequestShowDeviceList failed", __func__); + HILOG_ERROR("%{public}s Create ContinuationRequestShowDeviceList failed", __func__); } } @@ -270,20 +270,20 @@ void ContinuationRegisterManagerProxy::ShowDeviceList( */ void ContinuationRegisterManagerProxy::Disconnect(void) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (continuatinConnector_ != nullptr && continuatinConnector_->IsAbilityConnected()) { continuatinConnector_->UnbindRemoteRegisterAbility(); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } void ContinuationRegisterManagerProxy::SendRequest( const std::weak_ptr &context, const std::shared_ptr &request) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (request == nullptr) { - APP_LOGE("%{public}s called, request is null", __func__); + HILOG_ERROR("%{public}s called, request is null", __func__); return; } @@ -296,7 +296,7 @@ void ContinuationRegisterManagerProxy::SendRequest( } else { request->Execute(); } - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } } // namespace AppExecFwk } // namespace OHOS diff --git a/frameworks/kits/ability/native/src/continuation/remote_register_service/remote_register_service_proxy.cpp b/frameworks/kits/ability/native/src/continuation/remote_register_service/remote_register_service_proxy.cpp index 50c8968db0..4362774d1d 100644 --- a/frameworks/kits/ability/native/src/continuation/remote_register_service/remote_register_service_proxy.cpp +++ b/frameworks/kits/ability/native/src/continuation/remote_register_service/remote_register_service_proxy.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "remote_register_service_proxy.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -28,16 +28,16 @@ namespace AppExecFwk { int RemoteRegisterServiceProxy::Register(const std::string &bundleName, const sptr &token, const ExtraParams &extras, const sptr &callback) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); if (bundleName.empty() || token == nullptr || callback == nullptr) { - APP_LOGE("%{public}s param invalid", __func__); + HILOG_ERROR("%{public}s param invalid", __func__); return ERR_INVALID_DATA; } auto remote = Remote(); if (remote == nullptr) { - APP_LOGE("%{public}s remote is null", __func__); + HILOG_ERROR("%{public}s remote is null", __func__); return ERR_NULL_OBJECT; } @@ -45,7 +45,7 @@ int RemoteRegisterServiceProxy::Register(const std::string &bundleName, const sp if (!data.WriteInterfaceToken(IRemoteRegisterService::GetDescriptor()) || !data.WriteString(bundleName) || data.WriteRemoteObject(token) || !data.WriteInt32(1) || !extras.Marshalling(data) || !data.WriteRemoteObject(callback->AsObject())) { - APP_LOGE("%{public}s Failed to write transfer data.", __func__); + HILOG_ERROR("%{public}s Failed to write transfer data.", __func__); return IPC_INVOKER_WRITE_TRANS_ERR; } @@ -53,10 +53,10 @@ int RemoteRegisterServiceProxy::Register(const std::string &bundleName, const sp MessageOption option; int result = remote->SendRequest(COMMAND_REGISTER, data, reply, option); if (result == ERR_NONE) { - APP_LOGI("%{public}s SendRequest ok", __func__); + HILOG_INFO("%{public}s SendRequest ok", __func__); return reply.ReadInt32(); } else { - APP_LOGE("%{public}s SendRequest error, result=%{public}d", __func__, result); + HILOG_ERROR("%{public}s SendRequest error, result=%{public}d", __func__, result); return IPC_INVOKER_TRANSLATE_ERR; } } @@ -68,17 +68,17 @@ int RemoteRegisterServiceProxy::Register(const std::string &bundleName, const sp */ bool RemoteRegisterServiceProxy::Unregister(int registerToken) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); auto remote = Remote(); if (remote == nullptr) { - APP_LOGE("%{public}s remote is null", __func__); + HILOG_ERROR("%{public}s remote is null", __func__); return false; } MessageParcel data; if (!data.WriteInterfaceToken(IRemoteRegisterService::GetDescriptor()) || !data.WriteInt32(registerToken)) { - APP_LOGE("%{public}s Failed to write transfer data.", __func__); + HILOG_ERROR("%{public}s Failed to write transfer data.", __func__); return false; } @@ -86,10 +86,10 @@ bool RemoteRegisterServiceProxy::Unregister(int registerToken) MessageOption option; int32_t result = remote->SendRequest(COMMAND_UNREGISTER, data, reply, option); if (result == ERR_NONE) { - APP_LOGI("%{public}s SendRequest ok", __func__); + HILOG_INFO("%{public}s SendRequest ok", __func__); return reply.ReadInt32() == ERR_NONE; } else { - APP_LOGE("%{public}s SendRequest error, result=%{public}d", __func__, result); + HILOG_ERROR("%{public}s SendRequest error, result=%{public}d", __func__, result); return false; } } @@ -103,18 +103,18 @@ bool RemoteRegisterServiceProxy::Unregister(int registerToken) */ bool RemoteRegisterServiceProxy::UpdateConnectStatus(int registerToken, const std::string &deviceId, int status) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); auto remote = Remote(); if (remote == nullptr) { - APP_LOGE("%{public}s remote is null", __func__); + HILOG_ERROR("%{public}s remote is null", __func__); return false; } MessageParcel data; if (!data.WriteInterfaceToken(IRemoteRegisterService::GetDescriptor()) || !data.WriteInt32(registerToken) || !data.WriteString(deviceId) || !data.WriteInt32(status)) { - APP_LOGE("%{public}s Failed to write transfer data.", __func__); + HILOG_ERROR("%{public}s Failed to write transfer data.", __func__); return false; } @@ -122,10 +122,10 @@ bool RemoteRegisterServiceProxy::UpdateConnectStatus(int registerToken, const st MessageOption option; int32_t result = remote->SendRequest(COMMAND_UPDATE_CONNECT_STATUS, data, reply, option); if (result == ERR_NONE) { - APP_LOGI("%{public}s SendRequest ok", __func__); + HILOG_INFO("%{public}s SendRequest ok", __func__); return reply.ReadInt32() == ERR_NONE; } else { - APP_LOGE("%{public}s SendRequest error, result=%{public}d", __func__, result); + HILOG_ERROR("%{public}s SendRequest error, result=%{public}d", __func__, result); return false; } } @@ -138,18 +138,18 @@ bool RemoteRegisterServiceProxy::UpdateConnectStatus(int registerToken, const st */ bool RemoteRegisterServiceProxy::ShowDeviceList(int registerToken, const ExtraParams &extras) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); auto remote = Remote(); if (remote == nullptr) { - APP_LOGE("%{public}s remote is null", __func__); + HILOG_ERROR("%{public}s remote is null", __func__); return false; } MessageParcel data; if (!data.WriteInterfaceToken(IRemoteRegisterService::GetDescriptor()) || !data.WriteInt32(registerToken) || !data.WriteInt32(1) || !extras.Marshalling(data)) { - APP_LOGE("%{public}s Failed to write transfer data.", __func__); + HILOG_ERROR("%{public}s Failed to write transfer data.", __func__); return false; } @@ -157,10 +157,10 @@ bool RemoteRegisterServiceProxy::ShowDeviceList(int registerToken, const ExtraPa MessageOption option; int32_t result = remote->SendRequest(COMMAND_SHOW_DEVICE_LIST, data, reply, option); if (result == ERR_NONE) { - APP_LOGI("%{public}s SendRequest ok", __func__); + HILOG_INFO("%{public}s SendRequest ok", __func__); return reply.ReadInt32() == ERR_NONE; } else { - APP_LOGE("%{public}s SendRequest error, result=%{public}d", __func__, result); + HILOG_ERROR("%{public}s SendRequest error, result=%{public}d", __func__, result); return false; } } diff --git a/frameworks/kits/ability/native/src/continuation/remote_register_service/remote_register_service_stub.cpp b/frameworks/kits/ability/native/src/continuation/remote_register_service/remote_register_service_stub.cpp index fb51bd01a6..cbe47de85e 100644 --- a/frameworks/kits/ability/native/src/continuation/remote_register_service/remote_register_service_stub.cpp +++ b/frameworks/kits/ability/native/src/continuation/remote_register_service/remote_register_service_stub.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "remote_register_service_stub.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -33,12 +33,12 @@ RemoteRegisterServiceStub::~RemoteRegisterServiceStub() int RemoteRegisterServiceStub::OnRemoteRequest( uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - APP_LOGI("%{public}s called, cmd=%{public}d, flags=%{public}d", __func__, code, option.GetFlags()); + HILOG_INFO("%{public}s called, cmd=%{public}d, flags=%{public}d", __func__, code, option.GetFlags()); std::u16string descriptor = IRemoteRegisterService::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { - APP_LOGI("%{public}s local descriptor is not equal to remote", __func__); + HILOG_INFO("%{public}s local descriptor is not equal to remote", __func__); return ERR_INVALID_STATE; } @@ -50,13 +50,13 @@ int RemoteRegisterServiceStub::OnRemoteRequest( } } - APP_LOGI("%{public}s Not found cmd, need check.", __func__); + HILOG_INFO("%{public}s Not found cmd, need check.", __func__); return IPCObjectStub::OnRemoteRequest(code, data, reply, option); } int RemoteRegisterServiceStub::RegisterInner(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); std::string bundleName = data.ReadString(); sptr token = data.ReadParcelable(); ExtraParams *pExtras = nullptr; @@ -66,7 +66,7 @@ int RemoteRegisterServiceStub::RegisterInner(MessageParcel &data, MessageParcel } if (pExtras == nullptr) { reply.WriteInt32(ERR_INVALID_DATA); - APP_LOGE("%{public}s Failed to read ExtraParams.", __func__); + HILOG_ERROR("%{public}s Failed to read ExtraParams.", __func__); return ERR_INVALID_DATA; } @@ -75,7 +75,7 @@ int RemoteRegisterServiceStub::RegisterInner(MessageParcel &data, MessageParcel delete pExtras; pExtras = nullptr; reply.WriteInt32(ERR_NULL_OBJECT); - APP_LOGE("%{public}s Failed to read IConnectCallback.", __func__); + HILOG_ERROR("%{public}s Failed to read IConnectCallback.", __func__); return ERR_NULL_OBJECT; } @@ -84,35 +84,35 @@ int RemoteRegisterServiceStub::RegisterInner(MessageParcel &data, MessageParcel delete pExtras; pExtras = nullptr; reply.WriteInt32(result); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return NO_ERROR; } int RemoteRegisterServiceStub::UnregisterInner(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); int registerToken = data.ReadInt32(); bool result = Unregister(registerToken); reply.WriteInt32(result ? ERR_NONE : IPC_STUB_ERR); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return NO_ERROR; } int RemoteRegisterServiceStub::UpdateConnectStatusInner(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); int registerToken = data.ReadInt32(registerToken); std::string deviceId = data.ReadString(); int status = data.ReadInt32(); bool result = UpdateConnectStatus(registerToken, deviceId, status); reply.WriteInt32(result ? ERR_NONE : IPC_STUB_ERR); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return NO_ERROR; } int RemoteRegisterServiceStub::ShowDeviceListInner(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); int registerToken = data.ReadInt32(); ExtraParams *pExtras = nullptr; int32_t extraId = data.ReadInt32(); @@ -121,7 +121,7 @@ int RemoteRegisterServiceStub::ShowDeviceListInner(MessageParcel &data, MessageP } if (pExtras == nullptr) { reply.WriteInt32(ERR_INVALID_DATA); - APP_LOGE("%{public}s Failed to read ExtraParams.", __func__); + HILOG_ERROR("%{public}s Failed to read ExtraParams.", __func__); return ERR_INVALID_DATA; } @@ -129,7 +129,7 @@ int RemoteRegisterServiceStub::ShowDeviceListInner(MessageParcel &data, MessageP delete pExtras; pExtras = nullptr; reply.WriteInt32(result ? ERR_NONE : IPC_STUB_ERR); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); return NO_ERROR; } } // namespace AppExecFwk diff --git a/frameworks/kits/ability/native/src/data_ability_helper.cpp b/frameworks/kits/ability/native/src/data_ability_helper.cpp index 278b746074..4a516be3ce 100644 --- a/frameworks/kits/ability/native/src/data_ability_helper.cpp +++ b/frameworks/kits/ability/native/src/data_ability_helper.cpp @@ -18,11 +18,11 @@ #include "ability_scheduler_interface.h" #include "ability_thread.h" #include "abs_shared_result_set.h" -#include "app_log_wrapper.h" #include "data_ability_observer_interface.h" #include "data_ability_operation.h" #include "data_ability_predicates.h" #include "data_ability_result.h" +#include "hilog_wrapper.h" #include "values_bucket.h" namespace OHOS { @@ -34,38 +34,38 @@ using AbilityManagerClient = OHOS::AAFwk::AbilityManagerClient; DataAbilityHelper::DataAbilityHelper(const std::shared_ptr &context, const std::shared_ptr &uri, const sptr &dataAbilityProxy, bool tryBind) { - APP_LOGI("DataAbilityHelper::DataAbilityHelper start"); + HILOG_INFO("DataAbilityHelper::DataAbilityHelper start"); token_ = context->GetToken(); context_ = std::weak_ptr(context); uri_ = uri; tryBind_ = tryBind; dataAbilityProxy_ = dataAbilityProxy; - APP_LOGI("DataAbilityHelper::DataAbilityHelper end"); + HILOG_INFO("DataAbilityHelper::DataAbilityHelper end"); } DataAbilityHelper::DataAbilityHelper(const std::shared_ptr &context, const std::shared_ptr &uri, const sptr &dataAbilityProxy, bool tryBind) -{ - APP_LOGI("DataAbilityHelper::DataAbilityHelper start"); +{ + HILOG_INFO("DataAbilityHelper::DataAbilityHelper start"); token_ = context->GetToken(); - uri_ = uri; - tryBind_ = tryBind; - dataAbilityProxy_ = dataAbilityProxy; - APP_LOGI("DataAbilityHelper::DataAbilityHelper end"); + uri_ = uri; + tryBind_ = tryBind; + dataAbilityProxy_ = dataAbilityProxy; + HILOG_INFO("DataAbilityHelper::DataAbilityHelper end"); } DataAbilityHelper::DataAbilityHelper(const std::shared_ptr &context) { - APP_LOGI("DataAbilityHelper::DataAbilityHelper only with context start"); + HILOG_INFO("DataAbilityHelper::DataAbilityHelper only with context start"); token_ = context->GetToken(); context_ = std::weak_ptr(context); - APP_LOGI("DataAbilityHelper::DataAbilityHelper only with context end"); + HILOG_INFO("DataAbilityHelper::DataAbilityHelper only with context end"); } DataAbilityHelper::DataAbilityHelper(const sptr &token, const std::shared_ptr &uri, const sptr &dataAbilityProxy) { - APP_LOGI("DataAbilityHelper::DataAbilityHelper start"); + HILOG_INFO("DataAbilityHelper::DataAbilityHelper start"); token_ = token; uri_ = uri; tryBind_ = false; @@ -74,22 +74,22 @@ DataAbilityHelper::DataAbilityHelper(const sptr &token, const std if (isSystemCaller_ && dataAbilityProxy_) { AddDataAbilityDeathRecipient(dataAbilityProxy_->AsObject()); } - APP_LOGI("DataAbilityHelper::DataAbilityHelper end"); + HILOG_INFO("DataAbilityHelper::DataAbilityHelper end"); } DataAbilityHelper::DataAbilityHelper(const sptr &token) { - APP_LOGI("DataAbilityHelper::DataAbilityHelper only with token_start"); + HILOG_INFO("DataAbilityHelper::DataAbilityHelper only with token_start"); token_ = token; isSystemCaller_ = true; - APP_LOGI("DataAbilityHelper::DataAbilityHelper only with token end"); + HILOG_INFO("DataAbilityHelper::DataAbilityHelper only with token end"); } void DataAbilityHelper::AddDataAbilityDeathRecipient(const sptr &token) { - APP_LOGI("DataAbilityHelper::AddDataAbilityDeathRecipient start."); + HILOG_INFO("DataAbilityHelper::AddDataAbilityDeathRecipient start."); if (token != nullptr && callerDeathRecipient_ != nullptr) { - APP_LOGI("token RemoveDeathRecipient."); + HILOG_INFO("token RemoveDeathRecipient."); token->RemoveDeathRecipient(callerDeathRecipient_); } if (callerDeathRecipient_ == nullptr) { @@ -97,21 +97,21 @@ void DataAbilityHelper::AddDataAbilityDeathRecipient(const sptr & new DataAbilityDeathRecipient(std::bind(&DataAbilityHelper::OnSchedulerDied, this, std::placeholders::_1)); } if (token != nullptr) { - APP_LOGI("token AddDeathRecipient."); + HILOG_INFO("token AddDeathRecipient."); token->AddDeathRecipient(callerDeathRecipient_); } - APP_LOGI("DataAbilityHelper::AddDataAbilityDeathRecipient end."); + HILOG_INFO("DataAbilityHelper::AddDataAbilityDeathRecipient end."); } void DataAbilityHelper::OnSchedulerDied(const wptr &remote) { - APP_LOGI("'%{public}s start':", __func__); + HILOG_INFO("'%{public}s start':", __func__); std::lock_guard guard(lock_); auto object = remote.promote(); object = nullptr; dataAbilityProxy_ = nullptr; uri_ = nullptr; - APP_LOGI("DataAbilityHelper::OnSchedulerDied end."); + HILOG_INFO("DataAbilityHelper::OnSchedulerDied end."); } /** @@ -123,19 +123,19 @@ void DataAbilityHelper::OnSchedulerDied(const wptr &remote) */ std::shared_ptr DataAbilityHelper::Creator(const std::shared_ptr &context) { - APP_LOGI("DataAbilityHelper::Creator with context start."); + HILOG_INFO("DataAbilityHelper::Creator with context start."); if (context == nullptr) { - APP_LOGE("DataAbilityHelper::Creator (context, uri, tryBind) failed, context == nullptr"); + HILOG_ERROR("DataAbilityHelper::Creator (context, uri, tryBind) failed, context == nullptr"); return nullptr; } DataAbilityHelper *ptrDataAbilityHelper = new (std::nothrow) DataAbilityHelper(context); if (ptrDataAbilityHelper == nullptr) { - APP_LOGE("DataAbilityHelper::Creator (context) failed, create DataAbilityHelper failed"); + HILOG_ERROR("DataAbilityHelper::Creator (context) failed, create DataAbilityHelper failed"); return nullptr; } - APP_LOGI("DataAbilityHelper::Creator with context end."); + HILOG_INFO("DataAbilityHelper::Creator with context end."); return std::shared_ptr(ptrDataAbilityHelper); } @@ -150,23 +150,23 @@ std::shared_ptr DataAbilityHelper::Creator(const std::shared_ std::shared_ptr DataAbilityHelper::Creator( const std::shared_ptr &context, const std::shared_ptr &uri) { - APP_LOGI("DataAbilityHelper::Creator with context uri called."); + HILOG_INFO("DataAbilityHelper::Creator with context uri called."); return DataAbilityHelper::Creator(context, uri, false); } -/** - * @brief Creates a DataAbilityHelper instance with the Uri specified based on the given Context. - * - * @param context Indicates the Context object on OHOS. - * @param uri Indicates the database table or disk file to operate. - * - * @return Returns the created DataAbilityHelper instance with a specified Uri. - */ -std::shared_ptr DataAbilityHelper::Creator( - const std::shared_ptr &context, const std::shared_ptr &uri) -{ - APP_LOGI("DataAbilityHelper::Creator with context uri called."); - return DataAbilityHelper::Creator(context, uri, false); +/** + * @brief Creates a DataAbilityHelper instance with the Uri specified based on the given Context. + * + * @param context Indicates the Context object on OHOS. + * @param uri Indicates the database table or disk file to operate. + * + * @return Returns the created DataAbilityHelper instance with a specified Uri. + */ +std::shared_ptr DataAbilityHelper::Creator( + const std::shared_ptr &context, const std::shared_ptr &uri) +{ + HILOG_INFO("DataAbilityHelper::Creator with context uri called."); + return DataAbilityHelper::Creator(context, uri, false); } /** @@ -184,95 +184,95 @@ std::shared_ptr DataAbilityHelper::Creator( std::shared_ptr DataAbilityHelper::Creator( const std::shared_ptr &context, const std::shared_ptr &uri, const bool tryBind) { - APP_LOGI("DataAbilityHelper::Creator with context uri tryBind called start."); + HILOG_INFO("DataAbilityHelper::Creator with context uri tryBind called start."); if (context == nullptr) { - APP_LOGE("DataAbilityHelper::Creator (context, uri, tryBind) failed, context == nullptr"); + HILOG_ERROR("DataAbilityHelper::Creator (context, uri, tryBind) failed, context == nullptr"); return nullptr; } if (uri == nullptr) { - APP_LOGE("DataAbilityHelper::Creator (context, uri, tryBind) failed, uri == nullptr"); + HILOG_ERROR("DataAbilityHelper::Creator (context, uri, tryBind) failed, uri == nullptr"); return nullptr; } if (uri->GetScheme() != SchemeOhos) { - APP_LOGE("DataAbilityHelper::Creator (context, uri, tryBind) failed, the Scheme is not dataability, Scheme: " + HILOG_ERROR("DataAbilityHelper::Creator (context, uri, tryBind) failed, the Scheme is not dataability, Scheme: " "%{public}s", uri->GetScheme().c_str()); return nullptr; } - APP_LOGI("DataAbilityHelper::Creator before AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::Creator before AcquireDataAbility."); sptr dataAbilityProxy = AbilityManagerClient::GetInstance()->AcquireDataAbility(*uri.get(), tryBind, context->GetToken()); if (dataAbilityProxy == nullptr) { - APP_LOGE("DataAbilityHelper::Creator failed get dataAbilityProxy"); + HILOG_ERROR("DataAbilityHelper::Creator failed get dataAbilityProxy"); return nullptr; } - APP_LOGI("DataAbilityHelper::Creator after AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::Creator after AcquireDataAbility."); DataAbilityHelper *ptrDataAbilityHelper = new (std::nothrow) DataAbilityHelper(context, uri, dataAbilityProxy, tryBind); if (ptrDataAbilityHelper == nullptr) { - APP_LOGE("DataAbilityHelper::Creator (context, uri, tryBind) failed, create DataAbilityHelper failed"); + HILOG_ERROR("DataAbilityHelper::Creator (context, uri, tryBind) failed, create DataAbilityHelper failed"); return nullptr; } - APP_LOGI("DataAbilityHelper::Creator with context uri tryBind called end."); + HILOG_INFO("DataAbilityHelper::Creator with context uri tryBind called end."); return std::shared_ptr(ptrDataAbilityHelper); } -/** - * @brief You can use this method to specify the Uri of the data to operate and set the binding relationship - * between the ability using the Data template (Data ability for short) and the associated client process in - * a DataAbilityHelper instance. - * - * @param context Indicates the Context object on OHOS. - * @param uri Indicates the database table or disk file to operate. - * @param tryBind Specifies whether the exit of the corresponding Data ability process causes the exit of the - * client process. - * - * @return Returns the created DataAbilityHelper instance. - */ -std::shared_ptr DataAbilityHelper::Creator( - const std::shared_ptr &context, const std::shared_ptr &uri, const bool tryBind) -{ - APP_LOGI("DataAbilityHelper::Creator with context uri tryBind called start."); - if (context == nullptr) { - APP_LOGE("DataAbilityHelper::Creator (context, uri, tryBind) failed, context == nullptr"); - return nullptr; - } - - if (uri == nullptr) { - APP_LOGE("DataAbilityHelper::Creator (context, uri, tryBind) failed, uri == nullptr"); - return nullptr; - } - - if (uri->GetScheme() != SchemeOhos) { - APP_LOGE("DataAbilityHelper::Creator (context, uri, tryBind) failed, the Scheme is not dataability, Scheme: " - "%{public}s", - uri->GetScheme().c_str()); - return nullptr; - } - - APP_LOGI("DataAbilityHelper::Creator before AcquireDataAbility."); - sptr dataAbilityProxy = - AbilityManagerClient::GetInstance()->AcquireDataAbility(*uri.get(), tryBind, context->GetToken()); - if (dataAbilityProxy == nullptr) { - APP_LOGE("DataAbilityHelper::Creator failed get dataAbilityProxy"); - return nullptr; - } - APP_LOGI("DataAbilityHelper::Creator after AcquireDataAbility."); - - DataAbilityHelper *ptrDataAbilityHelper = - new (std::nothrow) DataAbilityHelper(context, uri, dataAbilityProxy, tryBind); - if (ptrDataAbilityHelper == nullptr) { - APP_LOGE("DataAbilityHelper::Creator (context, uri, tryBind) failed, create DataAbilityHelper failed"); - return nullptr; - } - - APP_LOGI("DataAbilityHelper::Creator with context uri tryBind called end."); - return std::shared_ptr(ptrDataAbilityHelper); +/** + * @brief You can use this method to specify the Uri of the data to operate and set the binding relationship + * between the ability using the Data template (Data ability for short) and the associated client process in + * a DataAbilityHelper instance. + * + * @param context Indicates the Context object on OHOS. + * @param uri Indicates the database table or disk file to operate. + * @param tryBind Specifies whether the exit of the corresponding Data ability process causes the exit of the + * client process. + * + * @return Returns the created DataAbilityHelper instance. + */ +std::shared_ptr DataAbilityHelper::Creator( + const std::shared_ptr &context, const std::shared_ptr &uri, const bool tryBind) +{ + HILOG_INFO("DataAbilityHelper::Creator with context uri tryBind called start."); + if (context == nullptr) { + HILOG_ERROR("DataAbilityHelper::Creator (context, uri, tryBind) failed, context == nullptr"); + return nullptr; + } + + if (uri == nullptr) { + HILOG_ERROR("DataAbilityHelper::Creator (context, uri, tryBind) failed, uri == nullptr"); + return nullptr; + } + + if (uri->GetScheme() != SchemeOhos) { + HILOG_ERROR("DataAbilityHelper::Creator (context, uri, tryBind) failed, the Scheme is not dataability, Scheme: " + "%{public}s", + uri->GetScheme().c_str()); + return nullptr; + } + + HILOG_INFO("DataAbilityHelper::Creator before AcquireDataAbility."); + sptr dataAbilityProxy = + AbilityManagerClient::GetInstance()->AcquireDataAbility(*uri.get(), tryBind, context->GetToken()); + if (dataAbilityProxy == nullptr) { + HILOG_ERROR("DataAbilityHelper::Creator failed get dataAbilityProxy"); + return nullptr; + } + HILOG_INFO("DataAbilityHelper::Creator after AcquireDataAbility."); + + DataAbilityHelper *ptrDataAbilityHelper = + new (std::nothrow) DataAbilityHelper(context, uri, dataAbilityProxy, tryBind); + if (ptrDataAbilityHelper == nullptr) { + HILOG_ERROR("DataAbilityHelper::Creator (context, uri, tryBind) failed, create DataAbilityHelper failed"); + return nullptr; + } + + HILOG_INFO("DataAbilityHelper::Creator with context uri tryBind called end."); + return std::shared_ptr(ptrDataAbilityHelper); } /** @@ -284,19 +284,19 @@ std::shared_ptr DataAbilityHelper::Creator( */ std::shared_ptr DataAbilityHelper::Creator(const sptr &token) { - APP_LOGI("DataAbilityHelper::Creator with token start."); + HILOG_INFO("DataAbilityHelper::Creator with token start."); if (token == nullptr) { - APP_LOGE("DataAbilityHelper::Creator (token) failed, token == nullptr"); + HILOG_ERROR("DataAbilityHelper::Creator (token) failed, token == nullptr"); return nullptr; } DataAbilityHelper *ptrDataAbilityHelper = new (std::nothrow) DataAbilityHelper(token); if (ptrDataAbilityHelper == nullptr) { - APP_LOGE("DataAbilityHelper::Creator (token) failed, create DataAbilityHelper failed"); + HILOG_ERROR("DataAbilityHelper::Creator (token) failed, create DataAbilityHelper failed"); return nullptr; } - APP_LOGI("DataAbilityHelper::Creator with token end."); + HILOG_INFO("DataAbilityHelper::Creator with token end."); return std::shared_ptr(ptrDataAbilityHelper); } @@ -313,40 +313,40 @@ std::shared_ptr DataAbilityHelper::Creator(const sptr DataAbilityHelper::Creator( const sptr &token, const std::shared_ptr &uri) { - APP_LOGI("DataAbilityHelper::Creator with token uri called start."); + HILOG_INFO("DataAbilityHelper::Creator with token uri called start."); if (token == nullptr) { - APP_LOGE("DataAbilityHelper::Creator (token, uri) failed, token == nullptr"); + HILOG_ERROR("DataAbilityHelper::Creator (token, uri) failed, token == nullptr"); return nullptr; } if (uri == nullptr) { - APP_LOGE("DataAbilityHelper::Creator (token, uri) failed, uri == nullptr"); + HILOG_ERROR("DataAbilityHelper::Creator (token, uri) failed, uri == nullptr"); return nullptr; } if (uri->GetScheme() != SchemeOhos) { - APP_LOGE("DataAbilityHelper::Creator (token, uri) failed, the Scheme is not dataability, Scheme: " + HILOG_ERROR("DataAbilityHelper::Creator (token, uri) failed, the Scheme is not dataability, Scheme: " "%{public}s", uri->GetScheme().c_str()); return nullptr; } - APP_LOGI("DataAbilityHelper::Creator before AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::Creator before AcquireDataAbility."); sptr dataAbilityProxy = AbilityManagerClient::GetInstance()->AcquireDataAbility(*uri.get(), false, token); if (dataAbilityProxy == nullptr) { - APP_LOGE("DataAbilityHelper::Creator failed get dataAbilityProxy"); + HILOG_ERROR("DataAbilityHelper::Creator failed get dataAbilityProxy"); return nullptr; } - APP_LOGI("DataAbilityHelper::Creator after AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::Creator after AcquireDataAbility."); DataAbilityHelper *ptrDataAbilityHelper = new (std::nothrow) DataAbilityHelper(token, uri, dataAbilityProxy); if (ptrDataAbilityHelper == nullptr) { - APP_LOGE("DataAbilityHelper::Creator (token, uri) failed, create DataAbilityHelper failed"); + HILOG_ERROR("DataAbilityHelper::Creator (token, uri) failed, create DataAbilityHelper failed"); return nullptr; } - APP_LOGI("DataAbilityHelper::Creator with token uri called end."); + HILOG_INFO("DataAbilityHelper::Creator with token uri called end."); return std::shared_ptr(ptrDataAbilityHelper); } @@ -358,24 +358,24 @@ std::shared_ptr DataAbilityHelper::Creator( */ bool DataAbilityHelper::Release() { - APP_LOGI("DataAbilityHelper::Release start."); + HILOG_INFO("DataAbilityHelper::Release start."); if (uri_ == nullptr) { - APP_LOGE("DataAbilityHelper::Release failed, uri_ is nullptr"); + HILOG_ERROR("DataAbilityHelper::Release failed, uri_ is nullptr"); return false; } - APP_LOGI("DataAbilityHelper::Release before ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::Release before ReleaseDataAbility."); int err = AbilityManagerClient::GetInstance()->ReleaseDataAbility(dataAbilityProxy_, token_); if (err != ERR_OK) { - APP_LOGE("DataAbilityHelper::Release failed to ReleaseDataAbility err = %{public}d", err); + HILOG_ERROR("DataAbilityHelper::Release failed to ReleaseDataAbility err = %{public}d", err); return false; } - APP_LOGI("DataAbilityHelper::Release after ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::Release after ReleaseDataAbility."); std::lock_guard guard(lock_); dataAbilityProxy_ = nullptr; uri_.reset(); - APP_LOGI("DataAbilityHelper::Release end."); + HILOG_INFO("DataAbilityHelper::Release end."); return true; } @@ -389,20 +389,20 @@ bool DataAbilityHelper::Release() */ std::vector DataAbilityHelper::GetFileTypes(Uri &uri, const std::string &mimeTypeFilter) { - APP_LOGI("DataAbilityHelper::GetFileTypes start."); + HILOG_INFO("DataAbilityHelper::GetFileTypes start."); std::vector matchedMIMEs; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return matchedMIMEs; } sptr dataAbilityProxy = dataAbilityProxy_; if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::GetFileTypes before AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::GetFileTypes before AcquireDataAbility."); dataAbilityProxy = AbilityManagerClient::GetInstance()->AcquireDataAbility(uri, tryBind_, token_); - APP_LOGI("DataAbilityHelper::GetFileTypes after AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::GetFileTypes after AcquireDataAbility."); if (dataAbilityProxy == nullptr) { - APP_LOGE("DataAbilityHelper::GetFileTypes failed dataAbility == nullptr"); + HILOG_ERROR("DataAbilityHelper::GetFileTypes failed dataAbility == nullptr"); return matchedMIMEs; } if (isSystemCaller_) { @@ -410,19 +410,19 @@ std::vector DataAbilityHelper::GetFileTypes(Uri &uri, const std::st } } - APP_LOGI("DataAbilityHelper::GetFileTypes before dataAbilityProxy->GetFileTypes."); + HILOG_INFO("DataAbilityHelper::GetFileTypes before dataAbilityProxy->GetFileTypes."); matchedMIMEs = dataAbilityProxy->GetFileTypes(uri, mimeTypeFilter); - APP_LOGI("DataAbilityHelper::GetFileTypes after dataAbilityProxy->GetFileTypes."); + HILOG_INFO("DataAbilityHelper::GetFileTypes after dataAbilityProxy->GetFileTypes."); if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::GetFileTypes before ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::GetFileTypes before ReleaseDataAbility."); int err = AbilityManagerClient::GetInstance()->ReleaseDataAbility(dataAbilityProxy, token_); - APP_LOGI("DataAbilityHelper::GetFileTypes after ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::GetFileTypes after ReleaseDataAbility."); if (err != ERR_OK) { - APP_LOGE("DataAbilityHelper::GetFileTypes failed to ReleaseDataAbility err = %{public}d", err); + HILOG_ERROR("DataAbilityHelper::GetFileTypes failed to ReleaseDataAbility err = %{public}d", err); } } - APP_LOGI("DataAbilityHelper::GetFileTypes end."); + HILOG_INFO("DataAbilityHelper::GetFileTypes end."); return matchedMIMEs; } @@ -439,20 +439,20 @@ std::vector DataAbilityHelper::GetFileTypes(Uri &uri, const std::st */ int DataAbilityHelper::OpenFile(Uri &uri, const std::string &mode) { - APP_LOGI("DataAbilityHelper::OpenFile start."); + HILOG_INFO("DataAbilityHelper::OpenFile start."); int fd = -1; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return fd; } sptr dataAbilityProxy = dataAbilityProxy_; if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::OpenFile before AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::OpenFile before AcquireDataAbility."); dataAbilityProxy = AbilityManagerClient::GetInstance()->AcquireDataAbility(uri, tryBind_, token_); - APP_LOGI("DataAbilityHelper::OpenFile after AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::OpenFile after AcquireDataAbility."); if (dataAbilityProxy == nullptr) { - APP_LOGE("DataAbilityHelper::OpenFile failed dataAbility == nullptr"); + HILOG_ERROR("DataAbilityHelper::OpenFile failed dataAbility == nullptr"); return fd; } if (isSystemCaller_) { @@ -460,18 +460,18 @@ int DataAbilityHelper::OpenFile(Uri &uri, const std::string &mode) } } - APP_LOGI("DataAbilityHelper::OpenFile before dataAbilityProxy->OpenFile."); + HILOG_INFO("DataAbilityHelper::OpenFile before dataAbilityProxy->OpenFile."); fd = dataAbilityProxy->OpenFile(uri, mode); - APP_LOGI("DataAbilityHelper::OpenFile after dataAbilityProxy->OpenFile."); + HILOG_INFO("DataAbilityHelper::OpenFile after dataAbilityProxy->OpenFile."); if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::OpenFile before ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::OpenFile before ReleaseDataAbility."); int err = AbilityManagerClient::GetInstance()->ReleaseDataAbility(dataAbilityProxy, token_); - APP_LOGI("DataAbilityHelper::OpenFile after ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::OpenFile after ReleaseDataAbility."); if (err != ERR_OK) { - APP_LOGE("DataAbilityHelper::OpenFile failed to ReleaseDataAbility err = %{public}d", err); + HILOG_ERROR("DataAbilityHelper::OpenFile failed to ReleaseDataAbility err = %{public}d", err); } } - APP_LOGI("DataAbilityHelper::OpenFile end."); + HILOG_INFO("DataAbilityHelper::OpenFile end."); return fd; } @@ -489,38 +489,38 @@ int DataAbilityHelper::OpenFile(Uri &uri, const std::string &mode) */ int DataAbilityHelper::OpenRawFile(Uri &uri, const std::string &mode) { - APP_LOGI("DataAbilityHelper::OpenRawFile start."); + HILOG_INFO("DataAbilityHelper::OpenRawFile start."); int fd = -1; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return fd; } sptr dataAbilityProxy = dataAbilityProxy_; if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::OpenRawFile before AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::OpenRawFile before AcquireDataAbility."); dataAbilityProxy = AbilityManagerClient::GetInstance()->AcquireDataAbility(uri, tryBind_, token_); - APP_LOGI("DataAbilityHelper::OpenRawFile after AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::OpenRawFile after AcquireDataAbility."); if (dataAbilityProxy == nullptr) { - APP_LOGE("DataAbilityHelper::OpenRawFile failed dataAbility == nullptr"); + HILOG_ERROR("DataAbilityHelper::OpenRawFile failed dataAbility == nullptr"); return fd; } if (isSystemCaller_) { AddDataAbilityDeathRecipient(dataAbilityProxy->AsObject()); } } - APP_LOGI("DataAbilityHelper::OpenRawFile before dataAbilityProxy->OpenRawFile."); + HILOG_INFO("DataAbilityHelper::OpenRawFile before dataAbilityProxy->OpenRawFile."); fd = dataAbilityProxy->OpenRawFile(uri, mode); - APP_LOGI("DataAbilityHelper::OpenRawFile after dataAbilityProxy->OpenRawFile."); + HILOG_INFO("DataAbilityHelper::OpenRawFile after dataAbilityProxy->OpenRawFile."); if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::OpenRawFile before ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::OpenRawFile before ReleaseDataAbility."); int err = AbilityManagerClient::GetInstance()->ReleaseDataAbility(dataAbilityProxy, token_); - APP_LOGI("DataAbilityHelper::OpenRawFile after ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::OpenRawFile after ReleaseDataAbility."); if (err != ERR_OK) { - APP_LOGE("DataAbilityHelper::OpenRawFile failed to ReleaseDataAbility err = %{public}d", err); + HILOG_ERROR("DataAbilityHelper::OpenRawFile failed to ReleaseDataAbility err = %{public}d", err); } } - APP_LOGI("DataAbilityHelper::OpenRawFile end."); + HILOG_INFO("DataAbilityHelper::OpenRawFile end."); return fd; } @@ -534,38 +534,38 @@ int DataAbilityHelper::OpenRawFile(Uri &uri, const std::string &mode) */ int DataAbilityHelper::Insert(Uri &uri, const NativeRdb::ValuesBucket &value) { - APP_LOGI("DataAbilityHelper::Insert start."); + HILOG_INFO("DataAbilityHelper::Insert start."); int index = -1; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return index; } sptr dataAbilityProxy = dataAbilityProxy_; if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::Insert before AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::Insert before AcquireDataAbility."); dataAbilityProxy = AbilityManagerClient::GetInstance()->AcquireDataAbility(uri, tryBind_, token_); - APP_LOGI("DataAbilityHelper::Insert after AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::Insert after AcquireDataAbility."); if (dataAbilityProxy == nullptr) { - APP_LOGE("DataAbilityHelper::Insert failed dataAbility == nullptr"); + HILOG_ERROR("DataAbilityHelper::Insert failed dataAbility == nullptr"); return index; } if (isSystemCaller_) { AddDataAbilityDeathRecipient(dataAbilityProxy->AsObject()); } } - APP_LOGI("DataAbilityHelper::Insert before dataAbilityProxy->Insert."); + HILOG_INFO("DataAbilityHelper::Insert before dataAbilityProxy->Insert."); index = dataAbilityProxy->Insert(uri, value); - APP_LOGI("DataAbilityHelper::Insert after dataAbilityProxy->Insert."); + HILOG_INFO("DataAbilityHelper::Insert after dataAbilityProxy->Insert."); if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::Insert before ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::Insert before ReleaseDataAbility."); int err = AbilityManagerClient::GetInstance()->ReleaseDataAbility(dataAbilityProxy, token_); - APP_LOGI("DataAbilityHelper::Insert after ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::Insert after ReleaseDataAbility."); if (err != ERR_OK) { - APP_LOGE("DataAbilityHelper::Insert failed to ReleaseDataAbility err = %{public}d", err); + HILOG_ERROR("DataAbilityHelper::Insert failed to ReleaseDataAbility err = %{public}d", err); } } - APP_LOGI("DataAbilityHelper::Insert end."); + HILOG_INFO("DataAbilityHelper::Insert end."); return index; } @@ -581,38 +581,38 @@ int DataAbilityHelper::Insert(Uri &uri, const NativeRdb::ValuesBucket &value) int DataAbilityHelper::Update( Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("DataAbilityHelper::Update start."); + HILOG_INFO("DataAbilityHelper::Update start."); int index = -1; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return index; } sptr dataAbilityProxy = dataAbilityProxy_; if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::Update before AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::Update before AcquireDataAbility."); dataAbilityProxy = AbilityManagerClient::GetInstance()->AcquireDataAbility(uri, tryBind_, token_); - APP_LOGI("DataAbilityHelper::Update after AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::Update after AcquireDataAbility."); if (dataAbilityProxy == nullptr) { - APP_LOGE("DataAbilityHelper::Update failed dataAbility == nullptr"); + HILOG_ERROR("DataAbilityHelper::Update failed dataAbility == nullptr"); return index; } if (isSystemCaller_) { AddDataAbilityDeathRecipient(dataAbilityProxy->AsObject()); } } - APP_LOGI("DataAbilityHelper::Update before dataAbilityProxy->Update."); + HILOG_INFO("DataAbilityHelper::Update before dataAbilityProxy->Update."); index = dataAbilityProxy->Update(uri, value, predicates); - APP_LOGI("DataAbilityHelper::Update after dataAbilityProxy->Update."); + HILOG_INFO("DataAbilityHelper::Update after dataAbilityProxy->Update."); if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::Update before ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::Update before ReleaseDataAbility."); int err = AbilityManagerClient::GetInstance()->ReleaseDataAbility(dataAbilityProxy, token_); - APP_LOGI("DataAbilityHelper::Update after ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::Update after ReleaseDataAbility."); if (err != ERR_OK) { - APP_LOGE("DataAbilityHelper::Update failed to ReleaseDataAbility err = %{public}d", err); + HILOG_ERROR("DataAbilityHelper::Update failed to ReleaseDataAbility err = %{public}d", err); } } - APP_LOGI("DataAbilityHelper::Update end."); + HILOG_INFO("DataAbilityHelper::Update end."); return index; } @@ -626,38 +626,38 @@ int DataAbilityHelper::Update( */ int DataAbilityHelper::Delete(Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("DataAbilityHelper::Delete start."); + HILOG_INFO("DataAbilityHelper::Delete start."); int index = -1; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return index; } sptr dataAbilityProxy = dataAbilityProxy_; if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::Delete before AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::Delete before AcquireDataAbility."); dataAbilityProxy = AbilityManagerClient::GetInstance()->AcquireDataAbility(uri, tryBind_, token_); - APP_LOGI("DataAbilityHelper::Delete after AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::Delete after AcquireDataAbility."); if (dataAbilityProxy == nullptr) { - APP_LOGE("DataAbilityHelper::Delete failed dataAbility == nullptr"); + HILOG_ERROR("DataAbilityHelper::Delete failed dataAbility == nullptr"); return index; } if (isSystemCaller_) { AddDataAbilityDeathRecipient(dataAbilityProxy->AsObject()); } } - APP_LOGI("DataAbilityHelper::Delete before dataAbilityProxy->Delete."); + HILOG_INFO("DataAbilityHelper::Delete before dataAbilityProxy->Delete."); index = dataAbilityProxy->Delete(uri, predicates); - APP_LOGI("DataAbilityHelper::Delete after dataAbilityProxy->Delete."); + HILOG_INFO("DataAbilityHelper::Delete after dataAbilityProxy->Delete."); if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::Delete before ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::Delete before ReleaseDataAbility."); int err = AbilityManagerClient::GetInstance()->ReleaseDataAbility(dataAbilityProxy, token_); - APP_LOGI("DataAbilityHelper::Delete after ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::Delete after ReleaseDataAbility."); if (err != ERR_OK) { - APP_LOGE("DataAbilityHelper::Delete failed to ReleaseDataAbility err = %{public}d", err); + HILOG_ERROR("DataAbilityHelper::Delete failed to ReleaseDataAbility err = %{public}d", err); } } - APP_LOGI("DataAbilityHelper::Delete end."); + HILOG_INFO("DataAbilityHelper::Delete end."); return index; } @@ -673,39 +673,39 @@ int DataAbilityHelper::Delete(Uri &uri, const NativeRdb::DataAbilityPredicates & std::shared_ptr DataAbilityHelper::Query( Uri &uri, std::vector &columns, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("DataAbilityHelper::Query start."); + HILOG_INFO("DataAbilityHelper::Query start."); std::shared_ptr resultset = nullptr; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return resultset; } sptr dataAbilityProxy = dataAbilityProxy_; if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::Query before AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::Query before AcquireDataAbility."); dataAbilityProxy = AbilityManagerClient::GetInstance()->AcquireDataAbility(uri, tryBind_, token_); - APP_LOGI("DataAbilityHelper::Query after AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::Query after AcquireDataAbility."); if (dataAbilityProxy == nullptr) { - APP_LOGE("DataAbilityHelper::Query failed dataAbility == nullptr"); + HILOG_ERROR("DataAbilityHelper::Query failed dataAbility == nullptr"); return resultset; } if (isSystemCaller_) { AddDataAbilityDeathRecipient(dataAbilityProxy->AsObject()); } } - APP_LOGI("DataAbilityHelper::Query before dataAbilityProxy->Query."); + HILOG_INFO("DataAbilityHelper::Query before dataAbilityProxy->Query."); resultset = dataAbilityProxy->Query(uri, columns, predicates); - APP_LOGI("DataAbilityHelper::Query after dataAbilityProxy->Query."); + HILOG_INFO("DataAbilityHelper::Query after dataAbilityProxy->Query."); if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::Query before ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::Query before ReleaseDataAbility."); int err = AbilityManagerClient::GetInstance()->ReleaseDataAbility(dataAbilityProxy, token_); - APP_LOGI("DataAbilityHelper::Query after ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::Query after ReleaseDataAbility."); if (err != ERR_OK) { - APP_LOGE("DataAbilityHelper::Query failed to ReleaseDataAbility err = %{public}d", err); + HILOG_ERROR("DataAbilityHelper::Query failed to ReleaseDataAbility err = %{public}d", err); } } - APP_LOGI("DataAbilityHelper::Query end."); + HILOG_INFO("DataAbilityHelper::Query end."); return resultset; } @@ -719,38 +719,38 @@ std::shared_ptr DataAbilityHelper::Query( */ std::string DataAbilityHelper::GetType(Uri &uri) { - APP_LOGI("DataAbilityHelper::GetType start."); + HILOG_INFO("DataAbilityHelper::GetType start."); std::string type; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return type; } sptr dataAbilityProxy = dataAbilityProxy_; if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::GetType before AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::GetType before AcquireDataAbility."); dataAbilityProxy = AbilityManagerClient::GetInstance()->AcquireDataAbility(uri, tryBind_, token_); - APP_LOGI("DataAbilityHelper::GetType after AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::GetType after AcquireDataAbility."); if (dataAbilityProxy == nullptr) { - APP_LOGE("DataAbilityHelper::GetType failed dataAbility == nullptr"); + HILOG_ERROR("DataAbilityHelper::GetType failed dataAbility == nullptr"); return type; } if (isSystemCaller_) { AddDataAbilityDeathRecipient(dataAbilityProxy->AsObject()); } } - APP_LOGI("DataAbilityHelper::GetType before dataAbilityProxy->GetType."); + HILOG_INFO("DataAbilityHelper::GetType before dataAbilityProxy->GetType."); type = dataAbilityProxy->GetType(uri); - APP_LOGI("DataAbilityHelper::GetType after dataAbilityProxy->GetType."); + HILOG_INFO("DataAbilityHelper::GetType after dataAbilityProxy->GetType."); if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::GetType before ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::GetType before ReleaseDataAbility."); int err = AbilityManagerClient::GetInstance()->ReleaseDataAbility(dataAbilityProxy, token_); - APP_LOGI("DataAbilityHelper::GetType after ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::GetType after ReleaseDataAbility."); if (err != ERR_OK) { - APP_LOGE("DataAbilityHelper::GetType failed to ReleaseDataAbility err = %{public}d", err); + HILOG_ERROR("DataAbilityHelper::GetType failed to ReleaseDataAbility err = %{public}d", err); } } - APP_LOGI("DataAbilityHelper::GetType end."); + HILOG_INFO("DataAbilityHelper::GetType end."); return type; } @@ -766,38 +766,38 @@ std::string DataAbilityHelper::GetType(Uri &uri) */ bool DataAbilityHelper::Reload(Uri &uri, const PacMap &extras) { - APP_LOGI("DataAbilityHelper::Reload start."); + HILOG_INFO("DataAbilityHelper::Reload start."); bool ret = false; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return ret; } sptr dataAbilityProxy = dataAbilityProxy_; if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::Reload before AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::Reload before AcquireDataAbility."); dataAbilityProxy = AbilityManagerClient::GetInstance()->AcquireDataAbility(uri, tryBind_, token_); - APP_LOGI("DataAbilityHelper::Reload after AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::Reload after AcquireDataAbility."); if (dataAbilityProxy == nullptr) { - APP_LOGE("DataAbilityHelper::Reload failed dataAbility == nullptr"); + HILOG_ERROR("DataAbilityHelper::Reload failed dataAbility == nullptr"); return ret; } if (isSystemCaller_) { AddDataAbilityDeathRecipient(dataAbilityProxy->AsObject()); } } - APP_LOGI("DataAbilityHelper::Reload before dataAbilityProxy->Reload."); + HILOG_INFO("DataAbilityHelper::Reload before dataAbilityProxy->Reload."); ret = dataAbilityProxy->Reload(uri, extras); - APP_LOGI("DataAbilityHelper::Reload after dataAbilityProxy->Reload."); + HILOG_INFO("DataAbilityHelper::Reload after dataAbilityProxy->Reload."); if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::Reload before ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::Reload before ReleaseDataAbility."); int err = AbilityManagerClient::GetInstance()->ReleaseDataAbility(dataAbilityProxy, token_); - APP_LOGI("DataAbilityHelper::Reload after ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::Reload after ReleaseDataAbility."); if (err != ERR_OK) { - APP_LOGE("DataAbilityHelper::Reload failed to ReleaseDataAbility err = %{public}d", err); + HILOG_ERROR("DataAbilityHelper::Reload failed to ReleaseDataAbility err = %{public}d", err); } } - APP_LOGI("DataAbilityHelper::Reload end."); + HILOG_INFO("DataAbilityHelper::Reload end."); return ret; } @@ -811,54 +811,54 @@ bool DataAbilityHelper::Reload(Uri &uri, const PacMap &extras) */ int DataAbilityHelper::BatchInsert(Uri &uri, const std::vector &values) { - APP_LOGI("DataAbilityHelper::BatchInsert start."); + HILOG_INFO("DataAbilityHelper::BatchInsert start."); int ret = -1; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return ret; } sptr dataAbilityProxy = dataAbilityProxy_; if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::BatchInsert before AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::BatchInsert before AcquireDataAbility."); dataAbilityProxy = AbilityManagerClient::GetInstance()->AcquireDataAbility(uri, tryBind_, token_); - APP_LOGI("DataAbilityHelper::BatchInsert after AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::BatchInsert after AcquireDataAbility."); if (dataAbilityProxy == nullptr) { - APP_LOGE("DataAbilityHelper::BatchInsert failed dataAbility == nullptr"); + HILOG_ERROR("DataAbilityHelper::BatchInsert failed dataAbility == nullptr"); return ret; } if (isSystemCaller_) { AddDataAbilityDeathRecipient(dataAbilityProxy->AsObject()); } } - APP_LOGI("DataAbilityHelper::BatchInsert before dataAbilityProxy->BatchInsert."); + HILOG_INFO("DataAbilityHelper::BatchInsert before dataAbilityProxy->BatchInsert."); ret = dataAbilityProxy->BatchInsert(uri, values); - APP_LOGI("DataAbilityHelper::BatchInsert after dataAbilityProxy->BatchInsert."); + HILOG_INFO("DataAbilityHelper::BatchInsert after dataAbilityProxy->BatchInsert."); if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::BatchInsert before ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::BatchInsert before ReleaseDataAbility."); int err = AbilityManagerClient::GetInstance()->ReleaseDataAbility(dataAbilityProxy, token_); - APP_LOGI("DataAbilityHelper::BatchInsert after ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::BatchInsert after ReleaseDataAbility."); if (err != ERR_OK) { - APP_LOGE("DataAbilityHelper::BatchInsert failed to ReleaseDataAbility err = %{public}d", err); + HILOG_ERROR("DataAbilityHelper::BatchInsert failed to ReleaseDataAbility err = %{public}d", err); } } - APP_LOGI("DataAbilityHelper::BatchInsert end."); + HILOG_INFO("DataAbilityHelper::BatchInsert end."); return ret; } bool DataAbilityHelper::CheckUriParam(const Uri &uri) { - APP_LOGI("DataAbilityHelper::CheckUriParam start."); + HILOG_INFO("DataAbilityHelper::CheckUriParam start."); Uri checkUri(uri.ToString()); if (!CheckOhosUri(checkUri)) { - APP_LOGE("DataAbilityHelper::CheckUriParam failed. CheckOhosUri uri failed"); + HILOG_ERROR("DataAbilityHelper::CheckUriParam failed. CheckOhosUri uri failed"); return false; } auto uriSp = uri_; // do not directly use uri_ here, otherwise, it will crash. if (uriSp != nullptr) { if (!CheckOhosUri(*uriSp)) { - APP_LOGE("DataAbilityHelper::CheckUriParam failed. CheckOhosUri uriSp failed"); + HILOG_ERROR("DataAbilityHelper::CheckUriParam failed. CheckOhosUri uriSp failed"); return false; } @@ -869,35 +869,36 @@ bool DataAbilityHelper::CheckUriParam(const Uri &uri) uriSp->GetPathSegments(segments); if (checkSegments.empty() || segments.empty() || checkSegments[0] != segments[0]) { - APP_LOGE("DataAbilityHelper::CheckUriParam failed. the dataability in uri doesn't equal the one in uriSp."); + HILOG_ERROR( + "DataAbilityHelper::CheckUriParam failed. the dataability in uri doesn't equal the one in uriSp."); return false; } } - APP_LOGI("DataAbilityHelper::CheckUriParam end."); + HILOG_INFO("DataAbilityHelper::CheckUriParam end."); return true; } bool DataAbilityHelper::CheckOhosUri(const Uri &uri) { - APP_LOGI("DataAbilityHelper::CheckOhosUri start."); + HILOG_INFO("DataAbilityHelper::CheckOhosUri start."); Uri checkUri(uri.ToString()); if (checkUri.GetScheme() != SchemeOhos) { - APP_LOGE("DataAbilityHelper::CheckOhosUri failed. uri is not a dataability one."); + HILOG_ERROR("DataAbilityHelper::CheckOhosUri failed. uri is not a dataability one."); return false; } std::vector segments; checkUri.GetPathSegments(segments); if (segments.empty()) { - APP_LOGE("DataAbilityHelper::CheckOhosUri failed. There is no segments in the uri."); + HILOG_ERROR("DataAbilityHelper::CheckOhosUri failed. There is no segments in the uri."); return false; } if (checkUri.GetPath() == "") { - APP_LOGE("DataAbilityHelper::CheckOhosUri failed. The path in the uri is empty."); + HILOG_ERROR("DataAbilityHelper::CheckOhosUri failed. The path in the uri is empty."); return false; } - APP_LOGI("DataAbilityHelper::CheckOhosUri end."); + HILOG_INFO("DataAbilityHelper::CheckOhosUri end."); return true; } @@ -909,14 +910,14 @@ bool DataAbilityHelper::CheckOhosUri(const Uri &uri) */ void DataAbilityHelper::RegisterObserver(const Uri &uri, const sptr &dataObserver) { - APP_LOGI("DataAbilityHelper::RegisterObserver start."); + HILOG_INFO("DataAbilityHelper::RegisterObserver start."); if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return; } if (dataObserver == nullptr) { - APP_LOGE("%{public}s called. dataObserver is nullptr", __func__); + HILOG_ERROR("%{public}s called. dataObserver is nullptr", __func__); return; } @@ -933,7 +934,7 @@ void DataAbilityHelper::RegisterObserver(const Uri &uri, const sptrsecond != tmpUri.GetPath()) { - APP_LOGE("DataAbilityHelper::RegisterObserver failed input uri's path is not equal the one the " + HILOG_ERROR("DataAbilityHelper::RegisterObserver failed input uri's path is not equal the one the " "observer used"); return; } @@ -944,13 +945,13 @@ void DataAbilityHelper::RegisterObserver(const Uri &uri, const sptrScheduleRegisterObserver(uri, dataObserver); - APP_LOGI("DataAbilityHelper::RegisterObserver end."); + HILOG_INFO("DataAbilityHelper::RegisterObserver end."); } /** @@ -961,14 +962,14 @@ void DataAbilityHelper::RegisterObserver(const Uri &uri, const sptr &dataObserver) { - APP_LOGI("DataAbilityHelper::UnregisterObserver start."); + HILOG_INFO("DataAbilityHelper::UnregisterObserver start."); if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return; } if (dataObserver == nullptr) { - APP_LOGE("%{public}s called. dataObserver is nullptr", __func__); + HILOG_ERROR("%{public}s called. dataObserver is nullptr", __func__); return; } @@ -982,7 +983,7 @@ void DataAbilityHelper::UnregisterObserver(const Uri &uri, const sptrsecond != tmpUri.GetPath()) { - APP_LOGE("DataAbilityHelper::UnregisterObserver failed input uri's path is not equal the one the " + HILOG_ERROR("DataAbilityHelper::UnregisterObserver failed input uri's path is not equal the one the " "observer used"); return; } @@ -992,23 +993,23 @@ void DataAbilityHelper::UnregisterObserver(const Uri &uri, const sptrScheduleUnregisterObserver(uri, dataObserver); if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::UnregisterObserver before ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::UnregisterObserver before ReleaseDataAbility."); int err = AbilityManagerClient::GetInstance()->ReleaseDataAbility(dataAbilityProxy_, token_); - APP_LOGI("DataAbilityHelper::UnregisterObserver after ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::UnregisterObserver after ReleaseDataAbility."); if (err != ERR_OK) { - APP_LOGE("DataAbilityHelper::UnregisterObserver failed to ReleaseDataAbility err = %{public}d", err); + HILOG_ERROR("DataAbilityHelper::UnregisterObserver failed to ReleaseDataAbility err = %{public}d", err); } dataAbilityProxy_ = nullptr; } registerMap_.erase(dataObserver); uriMap_.erase(dataObserver); - APP_LOGI("DataAbilityHelper::UnregisterObserver end."); + HILOG_INFO("DataAbilityHelper::UnregisterObserver end."); } /** @@ -1018,9 +1019,9 @@ void DataAbilityHelper::UnregisterObserver(const Uri &uri, const sptrAcquireDataAbility(uri, tryBind_, token_); if (dataAbilityProxy == nullptr) { - APP_LOGE("DataAbilityHelper::NotifyChange failed dataAbility == nullptr"); + HILOG_ERROR("DataAbilityHelper::NotifyChange failed dataAbility == nullptr"); return; } } @@ -1038,10 +1039,10 @@ void DataAbilityHelper::NotifyChange(const Uri &uri) if (uri_ == nullptr) { int err = AbilityManagerClient::GetInstance()->ReleaseDataAbility(dataAbilityProxy, token_); if (err != ERR_OK) { - APP_LOGE("DataAbilityHelper::NotifyChange failed to ReleaseDataAbility err = %{public}d", err); + HILOG_ERROR("DataAbilityHelper::NotifyChange failed to ReleaseDataAbility err = %{public}d", err); } } - APP_LOGI("DataAbilityHelper::NotifyChange end."); + HILOG_INFO("DataAbilityHelper::NotifyChange end."); } /** @@ -1058,38 +1059,38 @@ void DataAbilityHelper::NotifyChange(const Uri &uri) */ Uri DataAbilityHelper::NormalizeUri(Uri &uri) { - APP_LOGI("DataAbilityHelper::NormalizeUri start."); + HILOG_INFO("DataAbilityHelper::NormalizeUri start."); Uri urivalue(""); if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return urivalue; } sptr dataAbilityProxy = dataAbilityProxy_; if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::NormalizeUri before AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::NormalizeUri before AcquireDataAbility."); dataAbilityProxy = AbilityManagerClient::GetInstance()->AcquireDataAbility(uri, tryBind_, token_); - APP_LOGI("DataAbilityHelper::NormalizeUri after AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::NormalizeUri after AcquireDataAbility."); if (dataAbilityProxy == nullptr) { - APP_LOGE("DataAbilityHelper::NormalizeUri failed dataAbility == nullptr"); + HILOG_ERROR("DataAbilityHelper::NormalizeUri failed dataAbility == nullptr"); return urivalue; } if (isSystemCaller_) { AddDataAbilityDeathRecipient(dataAbilityProxy->AsObject()); } } - APP_LOGI("DataAbilityHelper::NormalizeUri before dataAbilityProxy->NormalizeUri."); + HILOG_INFO("DataAbilityHelper::NormalizeUri before dataAbilityProxy->NormalizeUri."); urivalue = dataAbilityProxy->NormalizeUri(uri); - APP_LOGI("DataAbilityHelper::NormalizeUri after dataAbilityProxy->NormalizeUri."); + HILOG_INFO("DataAbilityHelper::NormalizeUri after dataAbilityProxy->NormalizeUri."); if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::NormalizeUri before ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::NormalizeUri before ReleaseDataAbility."); int err = AbilityManagerClient::GetInstance()->ReleaseDataAbility(dataAbilityProxy, token_); - APP_LOGI("DataAbilityHelper::NormalizeUri after ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::NormalizeUri after ReleaseDataAbility."); if (err != ERR_OK) { - APP_LOGE("DataAbilityHelper::NormalizeUri failed to ReleaseDataAbility err = %{public}d", err); + HILOG_ERROR("DataAbilityHelper::NormalizeUri failed to ReleaseDataAbility err = %{public}d", err); } } - APP_LOGI("DataAbilityHelper::NormalizeUri end."); + HILOG_INFO("DataAbilityHelper::NormalizeUri end."); return urivalue; } @@ -1105,84 +1106,84 @@ Uri DataAbilityHelper::NormalizeUri(Uri &uri) */ Uri DataAbilityHelper::DenormalizeUri(Uri &uri) { - APP_LOGI("DataAbilityHelper::DenormalizeUri start."); + HILOG_INFO("DataAbilityHelper::DenormalizeUri start."); Uri urivalue(""); if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return urivalue; } sptr dataAbilityProxy = dataAbilityProxy_; if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::DenormalizeUri before AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::DenormalizeUri before AcquireDataAbility."); dataAbilityProxy = AbilityManagerClient::GetInstance()->AcquireDataAbility(uri, tryBind_, token_); - APP_LOGI("DataAbilityHelper::DenormalizeUri after AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::DenormalizeUri after AcquireDataAbility."); if (dataAbilityProxy == nullptr) { - APP_LOGE("DataAbilityHelper::DenormalizeUri failed dataAbility == nullptr"); + HILOG_ERROR("DataAbilityHelper::DenormalizeUri failed dataAbility == nullptr"); return urivalue; } if (isSystemCaller_) { AddDataAbilityDeathRecipient(dataAbilityProxy->AsObject()); } } - APP_LOGI("DataAbilityHelper::DenormalizeUri before dataAbilityProxy->DenormalizeUri."); + HILOG_INFO("DataAbilityHelper::DenormalizeUri before dataAbilityProxy->DenormalizeUri."); urivalue = dataAbilityProxy->DenormalizeUri(uri); - APP_LOGI("DataAbilityHelper::DenormalizeUri after dataAbilityProxy->DenormalizeUri."); + HILOG_INFO("DataAbilityHelper::DenormalizeUri after dataAbilityProxy->DenormalizeUri."); if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::DenormalizeUri before ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::DenormalizeUri before ReleaseDataAbility."); int err = AbilityManagerClient::GetInstance()->ReleaseDataAbility(dataAbilityProxy, token_); - APP_LOGI("DataAbilityHelper::DenormalizeUri after ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::DenormalizeUri after ReleaseDataAbility."); if (err != ERR_OK) { - APP_LOGE("DataAbilityHelper::DenormalizeUri failed to ReleaseDataAbility err = %{public}d", err); + HILOG_ERROR("DataAbilityHelper::DenormalizeUri failed to ReleaseDataAbility err = %{public}d", err); } } - APP_LOGI("DataAbilityHelper::DenormalizeUri end."); + HILOG_INFO("DataAbilityHelper::DenormalizeUri end."); return urivalue; } std::vector> DataAbilityHelper::ExecuteBatch( const Uri &uri, const std::vector> &operations) { - APP_LOGI("DataAbilityHelper::ExecuteBatch start"); + HILOG_INFO("DataAbilityHelper::ExecuteBatch start"); std::vector> results; if (!CheckUriParam(uri)) { - APP_LOGE("DataAbilityHelper::ExecuteBatch. CheckUriParam uri failed"); + HILOG_ERROR("DataAbilityHelper::ExecuteBatch. CheckUriParam uri failed"); return results; } sptr dataAbilityProxy = dataAbilityProxy_; if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::ExecuteBatch before AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::ExecuteBatch before AcquireDataAbility."); dataAbilityProxy = AbilityManagerClient::GetInstance()->AcquireDataAbility(uri, tryBind_, token_); - APP_LOGI("DataAbilityHelper::ExecuteBatch after AcquireDataAbility."); + HILOG_INFO("DataAbilityHelper::ExecuteBatch after AcquireDataAbility."); if (dataAbilityProxy == nullptr) { - APP_LOGE("DataAbilityHelper::ExecuteBatch failed dataAbility == nullptr"); + HILOG_ERROR("DataAbilityHelper::ExecuteBatch failed dataAbility == nullptr"); return results; } } - APP_LOGI("DataAbilityHelper::ExecuteBatch before dataAbilityProxy->ExecuteBatch."); + HILOG_INFO("DataAbilityHelper::ExecuteBatch before dataAbilityProxy->ExecuteBatch."); results = dataAbilityProxy->ExecuteBatch(operations); - APP_LOGI("DataAbilityHelper::ExecuteBatch after dataAbilityProxy->ExecuteBatch."); + HILOG_INFO("DataAbilityHelper::ExecuteBatch after dataAbilityProxy->ExecuteBatch."); if (uri_ == nullptr) { - APP_LOGI("DataAbilityHelper::ExecuteBatch before ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::ExecuteBatch before ReleaseDataAbility."); int err = AbilityManagerClient::GetInstance()->ReleaseDataAbility(dataAbilityProxy, token_); - APP_LOGI("DataAbilityHelper::ExecuteBatch after ReleaseDataAbility."); + HILOG_INFO("DataAbilityHelper::ExecuteBatch after ReleaseDataAbility."); if (err != ERR_OK) { - APP_LOGE("DataAbilityHelper::ExecuteBatch failed to ReleaseDataAbility err = %{public}d", err); + HILOG_ERROR("DataAbilityHelper::ExecuteBatch failed to ReleaseDataAbility err = %{public}d", err); } } - APP_LOGI("DataAbilityHelper::ExecuteBatch end"); + HILOG_INFO("DataAbilityHelper::ExecuteBatch end"); return results; } void DataAbilityDeathRecipient::OnRemoteDied(const wptr &remote) { - APP_LOGI("recv DataAbilityDeathRecipient death notice"); + HILOG_INFO("recv DataAbilityDeathRecipient death notice"); if (handler_) { handler_(remote); } - APP_LOGI("DataAbilityHelper::OnRemoteDied end."); + HILOG_INFO("DataAbilityHelper::OnRemoteDied end."); } DataAbilityDeathRecipient::DataAbilityDeathRecipient(RemoteDiedHandler handler) : handler_(handler) diff --git a/frameworks/kits/ability/native/src/data_ability_impl.cpp b/frameworks/kits/ability/native/src/data_ability_impl.cpp index de1b1f69b2..c20646744b 100644 --- a/frameworks/kits/ability/native/src/data_ability_impl.cpp +++ b/frameworks/kits/ability/native/src/data_ability_impl.cpp @@ -16,8 +16,8 @@ #include "data_ability_impl.h" #include "abs_shared_result_set.h" -#include "app_log_wrapper.h" #include "data_ability_predicates.h" +#include "hilog_wrapper.h" #include "values_bucket.h" namespace OHOS { @@ -32,12 +32,12 @@ using AbilityManagerClient = OHOS::AAFwk::AbilityManagerClient; */ void DataAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::LifeCycleStateInfo &targetState) { - APP_LOGI("DataAbilityImpl::sourceState:%{public}d; targetState: %{public}d; isNewWant: %{public}d", + HILOG_INFO("DataAbilityImpl::sourceState:%{public}d; targetState: %{public}d; isNewWant: %{public}d", lifecycleState_, targetState.state, targetState.isNewWant); if ((lifecycleState_ == targetState.state) && !targetState.isNewWant) { - APP_LOGE("Org lifeCycleState equals to Dst lifeCycleState."); + HILOG_ERROR("Org lifeCycleState equals to Dst lifeCycleState."); return; } @@ -53,7 +53,7 @@ void DataAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::Li break; } default: { - APP_LOGE("DataAbilityImpl::HandleAbilityTransaction state is error"); + HILOG_ERROR("DataAbilityImpl::HandleAbilityTransaction state is error"); return; break; } @@ -74,7 +74,7 @@ std::vector DataAbilityImpl::GetFileTypes(const Uri &uri, const std { std::vector types; if (ability_ == nullptr) { - APP_LOGE("DataAbilityImpl::GetFileTypes ability_ is nullptr"); + HILOG_ERROR("DataAbilityImpl::GetFileTypes ability_ is nullptr"); return types; } @@ -97,7 +97,7 @@ int DataAbilityImpl::OpenFile(const Uri &uri, const std::string &mode) { int fd = -1; if (ability_ == nullptr) { - APP_LOGE("DataAbilityImpl::OpenFile ability_ is nullptr"); + HILOG_ERROR("DataAbilityImpl::OpenFile ability_ is nullptr"); return fd; } @@ -121,7 +121,7 @@ int DataAbilityImpl::OpenRawFile(const Uri &uri, const std::string &mode) { int fd = -1; if (ability_ == nullptr) { - APP_LOGE("DataAbilityImpl::OpenRawFile ability_ is nullptr"); + HILOG_ERROR("DataAbilityImpl::OpenRawFile ability_ is nullptr"); return fd; } @@ -141,7 +141,7 @@ int DataAbilityImpl::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value { int index = -1; if (ability_ == nullptr) { - APP_LOGE("DataAbilityImpl::Insert ability_ is nullptr"); + HILOG_ERROR("DataAbilityImpl::Insert ability_ is nullptr"); return index; } @@ -163,7 +163,7 @@ int DataAbilityImpl::Update( { int index = -1; if (ability_ == nullptr) { - APP_LOGE("DataAbilityImpl::Update ability_ is nullptr"); + HILOG_ERROR("DataAbilityImpl::Update ability_ is nullptr"); return index; } @@ -183,7 +183,7 @@ int DataAbilityImpl::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicat { int index = -1; if (ability_ == nullptr) { - APP_LOGE("DataAbilityImpl::Delete ability_ is nullptr"); + HILOG_ERROR("DataAbilityImpl::Delete ability_ is nullptr"); return index; } @@ -204,7 +204,7 @@ std::shared_ptr DataAbilityImpl::Query( const Uri &uri, std::vector &columns, const NativeRdb::DataAbilityPredicates &predicates) { if (ability_ == nullptr) { - APP_LOGE("DataAbilityImpl::Query ability_ is nullptr"); + HILOG_ERROR("DataAbilityImpl::Query ability_ is nullptr"); return nullptr; } @@ -223,7 +223,7 @@ std::string DataAbilityImpl::GetType(const Uri &uri) { std::string type; if (ability_ == nullptr) { - APP_LOGE("DataAbilityImpl::GetType ability_ is nullptr"); + HILOG_ERROR("DataAbilityImpl::GetType ability_ is nullptr"); return type; } type = ability_->GetType(uri); @@ -244,7 +244,7 @@ bool DataAbilityImpl::Reload(const Uri &uri, const PacMap &extras) { bool ret = false; if (ability_ == nullptr) { - APP_LOGE("DataAbilityImpl::Reload ability_ is nullptr"); + HILOG_ERROR("DataAbilityImpl::Reload ability_ is nullptr"); return ret; } ret = ability_->Reload(uri, extras); @@ -263,7 +263,7 @@ int DataAbilityImpl::BatchInsert(const Uri &uri, const std::vectorBatchInsert(uri, values); @@ -285,7 +285,7 @@ Uri DataAbilityImpl::NormalizeUri(const Uri &uri) { Uri urivalue(""); if (ability_ == nullptr) { - APP_LOGE("DataAbilityImpl::NormalizeUri ability_ is nullptr"); + HILOG_ERROR("DataAbilityImpl::NormalizeUri ability_ is nullptr"); return urivalue; } urivalue = ability_->NormalizeUri(uri); @@ -308,7 +308,7 @@ Uri DataAbilityImpl::DenormalizeUri(const Uri &uri) { Uri urivalue(""); if (ability_ == nullptr) { - APP_LOGE("DataAbilityImpl::DenormalizeUri ability_ is nullptr"); + HILOG_ERROR("DataAbilityImpl::DenormalizeUri ability_ is nullptr"); return urivalue; } urivalue = ability_->DenormalizeUri(uri); @@ -318,16 +318,16 @@ Uri DataAbilityImpl::DenormalizeUri(const Uri &uri) std::vector> DataAbilityImpl::ExecuteBatch( const std::vector> &operations) { - APP_LOGI("DataAbilityImpl::ExecuteBatch start"); + HILOG_INFO("DataAbilityImpl::ExecuteBatch start"); std::vector> results; if (ability_ == nullptr) { - APP_LOGE("DataAbilityImpl::ExecuteBatch ability_ is nullptr"); + HILOG_ERROR("DataAbilityImpl::ExecuteBatch ability_ is nullptr"); results.clear(); return results; } results = ability_->ExecuteBatch(operations); - APP_LOGI("DataAbilityImpl::ExecuteBatch end, results size:%{public}zu", results.size()); + HILOG_INFO("DataAbilityImpl::ExecuteBatch end, results size:%{public}zu", results.size()); return results; } diff --git a/frameworks/kits/ability/native/src/data_ability_operation.cpp b/frameworks/kits/ability/native/src/data_ability_operation.cpp index ee0a0a9c3c..13d8f44d51 100644 --- a/frameworks/kits/ability/native/src/data_ability_operation.cpp +++ b/frameworks/kits/ability/native/src/data_ability_operation.cpp @@ -15,7 +15,6 @@ #include "data_ability_operation.h" -#include "app_log_wrapper.h" #include "data_ability_predicates.h" #include "hilog_wrapper.h" #include "values_bucket.h" @@ -141,146 +140,146 @@ DataAbilityOperation &DataAbilityOperation::operator=(const DataAbilityOperation std::shared_ptr DataAbilityOperation::NewInsertBuilder(const std::shared_ptr &uri) { - APP_LOGD("DataAbilityOperation::NewInsertBuilder start"); + HILOG_DEBUG("DataAbilityOperation::NewInsertBuilder start"); if (uri == nullptr) { - APP_LOGE("DataAbilityOperation::NewInsertBuilder uri is nullptr"); + HILOG_ERROR("DataAbilityOperation::NewInsertBuilder uri is nullptr"); return nullptr; } std::shared_ptr builder = std::make_shared(TYPE_INSERT, uri); - APP_LOGD("DataAbilityOperation::NewInsertBuilder end"); + HILOG_DEBUG("DataAbilityOperation::NewInsertBuilder end"); return builder; } std::shared_ptr DataAbilityOperation::NewUpdateBuilder(const std::shared_ptr &uri) { - APP_LOGD("DataAbilityOperation::NewUpdateBuilder start"); + HILOG_DEBUG("DataAbilityOperation::NewUpdateBuilder start"); if (uri == nullptr) { - APP_LOGE("DataAbilityOperation::NewUpdateBuilder uri is nullptr"); + HILOG_ERROR("DataAbilityOperation::NewUpdateBuilder uri is nullptr"); return nullptr; } std::shared_ptr builder = std::make_shared(TYPE_UPDATE, uri); - APP_LOGD("DataAbilityOperation::NewUpdateBuilder end"); + HILOG_DEBUG("DataAbilityOperation::NewUpdateBuilder end"); return builder; } std::shared_ptr DataAbilityOperation::NewDeleteBuilder(const std::shared_ptr &uri) { - APP_LOGD("DataAbilityOperation::NewDeleteBuilder start"); + HILOG_DEBUG("DataAbilityOperation::NewDeleteBuilder start"); if (uri == nullptr) { - APP_LOGE("DataAbilityOperation::NewDeleteBuilder uri is nullptr"); + HILOG_ERROR("DataAbilityOperation::NewDeleteBuilder uri is nullptr"); return nullptr; } std::shared_ptr builder = std::make_shared(TYPE_DELETE, uri); - APP_LOGD("DataAbilityOperation::NewDeleteBuilder end"); + HILOG_DEBUG("DataAbilityOperation::NewDeleteBuilder end"); return builder; } std::shared_ptr DataAbilityOperation::NewAssertBuilder(const std::shared_ptr &uri) { - APP_LOGD("DataAbilityOperation::NewAssertBuilder start"); + HILOG_DEBUG("DataAbilityOperation::NewAssertBuilder start"); if (uri == nullptr) { - APP_LOGE("DataAbilityOperation::NewAssertBuilder uri is nullptr"); + HILOG_ERROR("DataAbilityOperation::NewAssertBuilder uri is nullptr"); return nullptr; } std::shared_ptr builder = std::make_shared(TYPE_ASSERT, uri); - APP_LOGD("DataAbilityOperation::NewAssertBuilder end"); + HILOG_DEBUG("DataAbilityOperation::NewAssertBuilder end"); return builder; } int DataAbilityOperation::GetType() const { - APP_LOGD("DataAbilityOperation::GetType"); + HILOG_DEBUG("DataAbilityOperation::GetType"); return type_; } std::shared_ptr DataAbilityOperation::GetUri() const { - APP_LOGD("DataAbilityOperation::GetUri"); + HILOG_DEBUG("DataAbilityOperation::GetUri"); return uri_; } std::shared_ptr DataAbilityOperation::GetValuesBucket() const { - APP_LOGD("DataAbilityOperation::GetValuesBucket"); + HILOG_DEBUG("DataAbilityOperation::GetValuesBucket"); return valuesBucket_; } int DataAbilityOperation::GetExpectedCount() const { - APP_LOGD("DataAbilityOperation::GetExpectedCount"); + HILOG_DEBUG("DataAbilityOperation::GetExpectedCount"); return expectedCount_; } std::shared_ptr DataAbilityOperation::GetDataAbilityPredicates() const { - APP_LOGD("DataAbilityOperation::GetDataAbilityPredicates"); + HILOG_DEBUG("DataAbilityOperation::GetDataAbilityPredicates"); return dataAbilityPredicates_; } std::shared_ptr DataAbilityOperation::GetValuesBucketReferences() const { - APP_LOGD("DataAbilityOperation::GetValuesBucketReferences"); + HILOG_DEBUG("DataAbilityOperation::GetValuesBucketReferences"); return valuesBucketReferences_; } std::map DataAbilityOperation::GetDataAbilityPredicatesBackReferences() const { - APP_LOGD("DataAbilityOperation::GetDataAbilityPredicatesBackReferences"); + HILOG_DEBUG("DataAbilityOperation::GetDataAbilityPredicatesBackReferences"); return dataAbilityPredicatesBackReferences_; } bool DataAbilityOperation::IsInsertOperation() const { - APP_LOGD("DataAbilityOperation::IsInsertOperation:%d", type_ == TYPE_INSERT); + HILOG_DEBUG("DataAbilityOperation::IsInsertOperation:%d", type_ == TYPE_INSERT); return type_ == TYPE_INSERT; } bool DataAbilityOperation::IsUpdateOperation() const { - APP_LOGD("DataAbilityOperation::IsUpdateOperation:%d", type_ == TYPE_UPDATE); + HILOG_DEBUG("DataAbilityOperation::IsUpdateOperation:%d", type_ == TYPE_UPDATE); return type_ == TYPE_UPDATE; } bool DataAbilityOperation::IsDeleteOperation() const { - APP_LOGD("DataAbilityOperation::IsDeleteOperation:%d", type_ == TYPE_DELETE); + HILOG_DEBUG("DataAbilityOperation::IsDeleteOperation:%d", type_ == TYPE_DELETE); return type_ == TYPE_DELETE; } bool DataAbilityOperation::IsAssertOperation() const { - APP_LOGD("DataAbilityOperation::IsAssertOperation:%d", type_ == TYPE_ASSERT); + HILOG_DEBUG("DataAbilityOperation::IsAssertOperation:%d", type_ == TYPE_ASSERT); return type_ == TYPE_ASSERT; } bool DataAbilityOperation::IsInterruptionAllowed() const { - APP_LOGD("DataAbilityOperation::IsInterruptionAllowed:%d", interrupted_); + HILOG_DEBUG("DataAbilityOperation::IsInterruptionAllowed:%d", interrupted_); return interrupted_; } bool DataAbilityOperation::Marshalling(Parcel &out) const { - APP_LOGD("DataAbilityOperation::Marshalling start"); + HILOG_DEBUG("DataAbilityOperation::Marshalling start"); if (!out.WriteInt32(type_)) { - APP_LOGE("DataAbilityOperation::Marshalling WriteInt32(type_) error"); + HILOG_ERROR("DataAbilityOperation::Marshalling WriteInt32(type_) error"); return false; } if (!out.WriteInt32(expectedCount_)) { - APP_LOGE("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); + HILOG_ERROR("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); return false; } if (!out.WriteBool(interrupted_)) { - APP_LOGE("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); + HILOG_ERROR("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); return false; } if (uri_ != nullptr) { if (!out.WriteInt32(VALUE_OBJECT)) { - APP_LOGE("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); + HILOG_ERROR("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); return false; } if (!out.WriteParcelable(uri_.get())) { - APP_LOGE("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); + HILOG_ERROR("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); return false; } } else { @@ -291,28 +290,28 @@ bool DataAbilityOperation::Marshalling(Parcel &out) const if (valuesBucket_ != nullptr) { if (!out.WriteInt32(VALUE_OBJECT)) { - APP_LOGE("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); + HILOG_ERROR("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); return false; } if (!out.WriteParcelable(valuesBucket_.get())) { - APP_LOGE("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); + HILOG_ERROR("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); return false; } } else { if (!out.WriteInt32(VALUE_NULL)) { - APP_LOGE("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); + HILOG_ERROR("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); return false; } } if (dataAbilityPredicates_ != nullptr) { if (!out.WriteInt32(VALUE_OBJECT)) { - APP_LOGE("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); + HILOG_ERROR("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); return false; } if (!out.WriteParcelable(dataAbilityPredicates_.get())) { - APP_LOGE("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); + HILOG_ERROR("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); return false; } } else { @@ -323,11 +322,11 @@ bool DataAbilityOperation::Marshalling(Parcel &out) const if (valuesBucketReferences_ != nullptr) { if (!out.WriteInt32(VALUE_OBJECT)) { - APP_LOGE("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); + HILOG_ERROR("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); return false; } if (!out.WriteParcelable(valuesBucketReferences_.get())) { - APP_LOGE("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); + HILOG_ERROR("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); return false; } } else { @@ -340,64 +339,64 @@ bool DataAbilityOperation::Marshalling(Parcel &out) const if (!dataAbilityPredicatesBackReferences_.empty()) { referenceSize = dataAbilityPredicatesBackReferences_.size(); if (!out.WriteInt32(referenceSize)) { - APP_LOGE("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); + HILOG_ERROR("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); return false; } if (referenceSize >= REFERENCE_THRESHOLD) { - APP_LOGI("DataAbilityOperation::Marshalling referenceSize >= REFERENCE_THRESHOLD"); + HILOG_INFO("DataAbilityOperation::Marshalling referenceSize >= REFERENCE_THRESHOLD"); return true; } for (auto it = dataAbilityPredicatesBackReferences_.begin(); it != dataAbilityPredicatesBackReferences_.end(); it++) { if (!out.WriteInt32(it->first)) { - APP_LOGE("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); + HILOG_ERROR("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); return false; } if (!out.WriteInt32(it->second)) { - APP_LOGE("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); + HILOG_ERROR("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); return false; } } } else { - APP_LOGD("DataAbilityOperation::Marshalling dataAbilityPredicatesBackReferences_ is empty"); + HILOG_DEBUG("DataAbilityOperation::Marshalling dataAbilityPredicatesBackReferences_ is empty"); if (!out.WriteInt32(referenceSize)) { - APP_LOGE("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); + HILOG_ERROR("DataAbilityOperation::Marshalling WriteInt32(VALUE_OBJECT) error"); return false; } } - APP_LOGD("DataAbilityOperation::Marshalling end"); + HILOG_DEBUG("DataAbilityOperation::Marshalling end"); return true; } DataAbilityOperation *DataAbilityOperation::Unmarshalling(Parcel &in) { - APP_LOGD("DataAbilityOperation::Unmarshalling start"); + HILOG_DEBUG("DataAbilityOperation::Unmarshalling start"); DataAbilityOperation *dataAbilityOperation = new (std::nothrow) DataAbilityOperation(); if (dataAbilityOperation != nullptr && !dataAbilityOperation->ReadFromParcel(in)) { - APP_LOGE("DataAbilityOperation::Unmarshalling dataAbilityOperation(%p) error", dataAbilityOperation); + HILOG_ERROR("DataAbilityOperation::Unmarshalling dataAbilityOperation(%p) error", dataAbilityOperation); delete dataAbilityOperation; dataAbilityOperation = nullptr; } - APP_LOGD("DataAbilityOperation::Unmarshalling end"); + HILOG_DEBUG("DataAbilityOperation::Unmarshalling end"); return dataAbilityOperation; } bool DataAbilityOperation::ReadFromParcel(Parcel &in) { - APP_LOGD("DataAbilityOperation::ReadFromParcel start"); + HILOG_DEBUG("DataAbilityOperation::ReadFromParcel start"); if (!in.ReadInt32(type_)) { - APP_LOGE("DataAbilityOperation::ReadFromParcel ReadInt32(type_) error"); + HILOG_ERROR("DataAbilityOperation::ReadFromParcel ReadInt32(type_) error"); return false; } if (!in.ReadInt32(expectedCount_)) { - APP_LOGE("DataAbilityOperation::ReadFromParcel ReadInt32(empty) error"); + HILOG_ERROR("DataAbilityOperation::ReadFromParcel ReadInt32(empty) error"); return false; } interrupted_ = in.ReadBool(); int empty = VALUE_NULL; if (!in.ReadInt32(empty)) { - APP_LOGE("DataAbilityOperation::ReadFromParcel ReadInt32(empty) error"); + HILOG_ERROR("DataAbilityOperation::ReadFromParcel ReadInt32(empty) error"); return false; } if (empty == VALUE_OBJECT) { @@ -408,10 +407,10 @@ bool DataAbilityOperation::ReadFromParcel(Parcel &in) empty = VALUE_NULL; if (!in.ReadInt32(empty)) { - APP_LOGE("DataAbilityOperation::ReadFromParcel ReadInt32(empty) error"); + HILOG_ERROR("DataAbilityOperation::ReadFromParcel ReadInt32(empty) error"); return false; } - APP_LOGD("DataAbilityOperation::ReadFromParcel empty is %{public}s", + HILOG_DEBUG("DataAbilityOperation::ReadFromParcel empty is %{public}s", empty == VALUE_OBJECT ? "VALUE_OBJECT" : "VALUE_NULL"); if (empty == VALUE_OBJECT) { valuesBucket_.reset(in.ReadParcelable()); @@ -421,10 +420,10 @@ bool DataAbilityOperation::ReadFromParcel(Parcel &in) empty = VALUE_NULL; if (!in.ReadInt32(empty)) { - APP_LOGE("DataAbilityOperation::ReadFromParcel ReadInt32(empty) error"); + HILOG_ERROR("DataAbilityOperation::ReadFromParcel ReadInt32(empty) error"); return false; } - APP_LOGD("DataAbilityOperation::ReadFromParcel empty is %{public}s", + HILOG_DEBUG("DataAbilityOperation::ReadFromParcel empty is %{public}s", empty == VALUE_OBJECT ? "VALUE_OBJECT" : "VALUE_NULL"); if (empty == VALUE_OBJECT) { dataAbilityPredicates_.reset(in.ReadParcelable()); @@ -434,10 +433,10 @@ bool DataAbilityOperation::ReadFromParcel(Parcel &in) empty = VALUE_NULL; if (!in.ReadInt32(empty)) { - APP_LOGE("DataAbilityOperation::ReadFromParcel ReadInt32(empty) error"); + HILOG_ERROR("DataAbilityOperation::ReadFromParcel ReadInt32(empty) error"); return false; } - APP_LOGD("DataAbilityOperation::ReadFromParcel empty is %{public}s", + HILOG_DEBUG("DataAbilityOperation::ReadFromParcel empty is %{public}s", (empty == VALUE_OBJECT) ? "VALUE_OBJECT" : "VALUE_NULL"); if (empty == VALUE_OBJECT) { valuesBucketReferences_.reset(in.ReadParcelable()); @@ -447,11 +446,11 @@ bool DataAbilityOperation::ReadFromParcel(Parcel &in) int referenceSize = 0; if (!in.ReadInt32(referenceSize)) { - APP_LOGE("DataAbilityOperation::ReadFromParcel end"); + HILOG_ERROR("DataAbilityOperation::ReadFromParcel end"); return false; } if (referenceSize >= REFERENCE_THRESHOLD) { - APP_LOGI("DataAbilityOperation::ReadFromParcel referenceSize:%{public}d >= REFERENCE_THRESHOLD:%{public}d", + HILOG_INFO("DataAbilityOperation::ReadFromParcel referenceSize:%{public}d >= REFERENCE_THRESHOLD:%{public}d", referenceSize, REFERENCE_THRESHOLD); return true; } @@ -460,36 +459,36 @@ bool DataAbilityOperation::ReadFromParcel(Parcel &in) int first = 0; int second = 0; if (!in.ReadInt32(first)) { - APP_LOGE("DataAbilityOperation::ReadFromParcel end"); + HILOG_ERROR("DataAbilityOperation::ReadFromParcel end"); return false; } if (!in.ReadInt32(second)) { - APP_LOGE("DataAbilityOperation::ReadFromParcel end"); + HILOG_ERROR("DataAbilityOperation::ReadFromParcel end"); return false; } dataAbilityPredicatesBackReferences_.insert(std::make_pair(first, second)); } - APP_LOGD("DataAbilityOperation::ReadFromParcel end"); + HILOG_DEBUG("DataAbilityOperation::ReadFromParcel end"); return true; } std::shared_ptr DataAbilityOperation::CreateFromParcel(Parcel &in) { - APP_LOGD("DataAbilityOperation::CreateFromParcel start"); + HILOG_DEBUG("DataAbilityOperation::CreateFromParcel start"); std::shared_ptr operation = std::make_shared(in); - APP_LOGD("DataAbilityOperation::CreateFromParcel end"); + HILOG_DEBUG("DataAbilityOperation::CreateFromParcel end"); return operation; } void DataAbilityOperation::PutMap(Parcel &in) { - APP_LOGD("DataAbilityOperation::PutMap start"); + HILOG_DEBUG("DataAbilityOperation::PutMap start"); int count = in.ReadInt32(); if (count > 0 && count < REFERENCE_THRESHOLD) { for (int i = 0; i < count; ++i) { dataAbilityPredicatesBackReferences_.insert(std::make_pair(in.ReadInt32(), in.ReadInt32())); } } - APP_LOGD("DataAbilityOperation::PutMap end"); + HILOG_DEBUG("DataAbilityOperation::PutMap end"); } } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file diff --git a/frameworks/kits/ability/native/src/data_ability_operation_builder.cpp b/frameworks/kits/ability/native/src/data_ability_operation_builder.cpp index 87b8884787..e6b683690a 100644 --- a/frameworks/kits/ability/native/src/data_ability_operation_builder.cpp +++ b/frameworks/kits/ability/native/src/data_ability_operation_builder.cpp @@ -14,8 +14,8 @@ */ #include "data_ability_operation_builder.h" -#include "app_log_wrapper.h" #include "data_ability_predicates.h" +#include "hilog_wrapper.h" #include "values_bucket.h" namespace OHOS { @@ -38,22 +38,23 @@ DataAbilityOperationBuilder::~DataAbilityOperationBuilder() std::shared_ptr DataAbilityOperationBuilder::Build() { - APP_LOGD("DataAbilityOperationBuilder::Build start"); + HILOG_DEBUG("DataAbilityOperationBuilder::Build start"); if (type_ != DataAbilityOperation::TYPE_UPDATE || (valuesBucket_ != nullptr && !valuesBucket_->IsEmpty())) { std::shared_ptr operation = std::make_shared(shared_from_this()); - APP_LOGD("DataAbilityOperationBuilder::Build end"); + HILOG_DEBUG("DataAbilityOperationBuilder::Build end"); return operation; } - APP_LOGE("DataAbilityOperationBuilder::Build return nullptr"); + HILOG_ERROR("DataAbilityOperationBuilder::Build return nullptr"); return nullptr; } std::shared_ptr DataAbilityOperationBuilder::WithValuesBucket( std::shared_ptr &values) { - APP_LOGD("DataAbilityOperationBuilder::WithValuesBucket start"); + HILOG_DEBUG("DataAbilityOperationBuilder::WithValuesBucket start"); if (type_ != DataAbilityOperation::TYPE_INSERT && type_ != DataAbilityOperation::TYPE_UPDATE && type_ != DataAbilityOperation::TYPE_ASSERT) { - APP_LOGE("DataAbilityOperationBuilder::WithValuesBucket only inserts, updates can have values, type=%{public}d", + HILOG_ERROR( + "DataAbilityOperationBuilder::WithValuesBucket only inserts, updates can have values, type=%{public}d", type_); return nullptr; } @@ -62,87 +63,89 @@ std::shared_ptr DataAbilityOperationBuilder::WithVa values->GetAll(valuesMap); valuesBucket_.reset(new (std::nothrow) NativeRdb::ValuesBucket(valuesMap)); - APP_LOGD("DataAbilityOperationBuilder::WithValuesBucket end"); + HILOG_DEBUG("DataAbilityOperationBuilder::WithValuesBucket end"); return shared_from_this(); } std::shared_ptr DataAbilityOperationBuilder::WithPredicates( std::shared_ptr &predicates) { - APP_LOGD("DataAbilityOperationBuilder::WithPredicates start"); + HILOG_DEBUG("DataAbilityOperationBuilder::WithPredicates start"); if (type_ != DataAbilityOperation::TYPE_DELETE && type_ != DataAbilityOperation::TYPE_UPDATE && type_ != DataAbilityOperation::TYPE_ASSERT) { - APP_LOGE( + HILOG_ERROR( "DataAbilityOperationBuilder::withPredicates only deletes and updates can have selections, type=%{public}d", type_); return nullptr; } dataAbilityPredicates_ = predicates; - APP_LOGD("DataAbilityOperationBuilder::WithPredicates end"); + HILOG_DEBUG("DataAbilityOperationBuilder::WithPredicates end"); return shared_from_this(); } std::shared_ptr DataAbilityOperationBuilder::WithExpectedCount(int count) { - APP_LOGD("DataAbilityOperationBuilder::WithExpectedCount start"); - APP_LOGI("DataAbilityOperationBuilder::WithExpectedCount expectedCount:%{public}d", count); + HILOG_DEBUG("DataAbilityOperationBuilder::WithExpectedCount start"); + HILOG_INFO("DataAbilityOperationBuilder::WithExpectedCount expectedCount:%{public}d", count); if (type_ != DataAbilityOperation::TYPE_UPDATE && type_ != DataAbilityOperation::TYPE_DELETE && type_ != DataAbilityOperation::TYPE_ASSERT) { - APP_LOGE("DataAbilityOperationBuilder::withExpectedCount only updates, deletes can have expected counts, " - "type=%{public}d", + HILOG_ERROR("DataAbilityOperationBuilder::withExpectedCount only updates, deletes can have expected counts, " + "type=%{public}d", type_); return nullptr; } expectedCount_ = count; - APP_LOGD("DataAbilityOperationBuilder::WithExpectedCount end"); + HILOG_DEBUG("DataAbilityOperationBuilder::WithExpectedCount end"); return shared_from_this(); } std::shared_ptr DataAbilityOperationBuilder::WithPredicatesBackReference( int requestArgIndex, int previousResult) { - APP_LOGD("DataAbilityOperationBuilder::WithPredicatesBackReference start"); - APP_LOGI("DataAbilityOperationBuilder::WithPredicatesBackReference requestArgIndex:%{public}d, " - "previousResult:%{public}d", + HILOG_DEBUG("DataAbilityOperationBuilder::WithPredicatesBackReference start"); + HILOG_INFO("DataAbilityOperationBuilder::WithPredicatesBackReference requestArgIndex:%{public}d, " + "previousResult:%{public}d", requestArgIndex, previousResult); if (type_ != DataAbilityOperation::TYPE_UPDATE && type_ != DataAbilityOperation::TYPE_DELETE && type_ != DataAbilityOperation::TYPE_ASSERT) { - APP_LOGE("DataAbilityOperationBuilder::withPredicatesBackReference only updates, deletes, and asserts can have " - "select back-references, type=%{public}d", + HILOG_ERROR( + "DataAbilityOperationBuilder::withPredicatesBackReference only updates, deletes, and asserts can have " + "select back-references, type=%{public}d", type_); return nullptr; } dataAbilityPredicatesBackReferences_.insert(std::make_pair(requestArgIndex, previousResult)); - APP_LOGD("DataAbilityOperationBuilder::WithPredicatesBackReference end"); + HILOG_DEBUG("DataAbilityOperationBuilder::WithPredicatesBackReference end"); return shared_from_this(); } std::shared_ptr DataAbilityOperationBuilder::WithValueBackReferences( std::shared_ptr &backReferences) { - APP_LOGD("DataAbilityOperationBuilder::WithValueBackReferences start"); + HILOG_DEBUG("DataAbilityOperationBuilder::WithValueBackReferences start"); if (type_ != DataAbilityOperation::TYPE_INSERT && type_ != DataAbilityOperation::TYPE_UPDATE && type_ != DataAbilityOperation::TYPE_ASSERT) { - APP_LOGE("DataAbilityOperationBuilder::withValueBackReferences only inserts, updates, and asserts can have " - "value back-references, type=%{public}d", + HILOG_ERROR("DataAbilityOperationBuilder::withValueBackReferences only inserts, updates, and asserts can have " + "value back-references, type=%{public}d", type_); return nullptr; } valuesBucketReferences_ = backReferences; - APP_LOGD("DataAbilityOperationBuilder::WithValueBackReferences end"); + HILOG_DEBUG("DataAbilityOperationBuilder::WithValueBackReferences end"); return shared_from_this(); } std::shared_ptr DataAbilityOperationBuilder::WithInterruptionAllowed(bool interrupted) { - APP_LOGD("DataAbilityOperationBuilder::WithInterruptionAllowed start"); - APP_LOGI("DataAbilityOperationBuilder::WithInterruptionAllowed interrupted=%{public}d", interrupted); + HILOG_DEBUG("DataAbilityOperationBuilder::WithInterruptionAllowed start"); + HILOG_INFO("DataAbilityOperationBuilder::WithInterruptionAllowed interrupted=%{public}d", interrupted); if (type_ != DataAbilityOperation::TYPE_INSERT && type_ != DataAbilityOperation::TYPE_UPDATE && type_ != DataAbilityOperation::TYPE_ASSERT && type_ != DataAbilityOperation::TYPE_DELETE) { - APP_LOGE("DataAbilityOperationBuilder::withInterruptionAllowed only inserts, updates, delete, and asserts can " - "have value back-references, type=%{public}d", + HILOG_ERROR( + "DataAbilityOperationBuilder::withInterruptionAllowed only inserts, updates, delete, and asserts can " + "have value back-references, type=%{public}d", type_); return nullptr; } interrupted_ = interrupted; - APP_LOGD("DataAbilityOperationBuilder::WithInterruptionAllowed end"); + HILOG_DEBUG("DataAbilityOperationBuilder::WithInterruptionAllowed end"); return shared_from_this(); } } // namespace AppExecFwk diff --git a/frameworks/kits/ability/native/src/data_ability_result.cpp b/frameworks/kits/ability/native/src/data_ability_result.cpp index d963656911..a6d9afd2b7 100644 --- a/frameworks/kits/ability/native/src/data_ability_result.cpp +++ b/frameworks/kits/ability/native/src/data_ability_result.cpp @@ -17,6 +17,7 @@ #include +#include "hilog_wrapper.h" #include "parcel_macro.h" namespace OHOS { @@ -87,7 +88,7 @@ DataAbilityResult *DataAbilityResult::CreateFromParcel(Parcel &parcel) { DataAbilityResult *dataAbilityResult = new (std::nothrow) DataAbilityResult(parcel); if (dataAbilityResult == nullptr) { - APP_LOGE("DataAbilityResult::CreateFromParcel dataAbilityResult is nullptr"); + HILOG_ERROR("DataAbilityResult::CreateFromParcel dataAbilityResult is nullptr"); } return dataAbilityResult; } diff --git a/frameworks/kits/ability/native/src/datashare_connection.cpp b/frameworks/kits/ability/native/src/datashare_connection.cpp index 11651d9b2c..4806b3b59a 100644 --- a/frameworks/kits/ability/native/src/datashare_connection.cpp +++ b/frameworks/kits/ability/native/src/datashare_connection.cpp @@ -16,8 +16,8 @@ #include "datashare_connection.h" #include "ability_manager_client.h" -#include "app_log_wrapper.h" #include "datashare_proxy.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -52,18 +52,18 @@ sptr DataShareConnection::GetInstance() void DataShareConnection::OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); if (remoteObject == nullptr) { - APP_LOGE("DataShareConnection::OnAbilityConnectDone failed, remote is nullptr"); + HILOG_ERROR("DataShareConnection::OnAbilityConnectDone failed, remote is nullptr"); return; } dataShareProxy_ = iface_cast(remoteObject); if (dataShareProxy_ == nullptr) { - APP_LOGE("DataShareConnection::OnAbilityConnectDone failed, dataShareProxy_ is nullptr"); + HILOG_ERROR("DataShareConnection::OnAbilityConnectDone failed, dataShareProxy_ is nullptr"); return; } isConnected_.store(true); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } /** @@ -77,10 +77,10 @@ void DataShareConnection::OnAbilityConnectDone( */ void DataShareConnection::OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); dataShareProxy_ = nullptr; isConnected_.store(false); - APP_LOGI("%{public}s called end", __func__); + HILOG_INFO("%{public}s called end", __func__); } /** @@ -88,9 +88,9 @@ void DataShareConnection::OnAbilityDisconnectDone(const AppExecFwk::ElementName */ void DataShareConnection::ConnectDataShareExtAbility(const AAFwk::Want &want, const sptr &token) { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); ErrCode ret = AAFwk::AbilityManagerClient::GetInstance()->ConnectAbility(want, this, token); - APP_LOGI("%{public}s called end, ret=%{public}d", __func__, ret); + HILOG_INFO("%{public}s called end, ret=%{public}d", __func__, ret); } /** @@ -98,11 +98,11 @@ void DataShareConnection::ConnectDataShareExtAbility(const AAFwk::Want &want, co */ void DataShareConnection::DisconnectDataShareExtAbility() { - APP_LOGI("%{public}s called begin", __func__); + HILOG_INFO("%{public}s called begin", __func__); dataShareProxy_ = nullptr; isConnected_.store(false); ErrCode ret = AAFwk::AbilityManagerClient::GetInstance()->DisconnectAbility(this); - APP_LOGI("%{public}s called end, ret=%{public}d", __func__, ret); + HILOG_INFO("%{public}s called end, ret=%{public}d", __func__, ret); } /** diff --git a/frameworks/kits/ability/native/src/datashare_helper.cpp b/frameworks/kits/ability/native/src/datashare_helper.cpp index 5635726b05..a5a4a2c4b3 100644 --- a/frameworks/kits/ability/native/src/datashare_helper.cpp +++ b/frameworks/kits/ability/native/src/datashare_helper.cpp @@ -18,11 +18,11 @@ #include "ability_scheduler_interface.h" #include "ability_thread.h" #include "abs_shared_result_set.h" -#include "app_log_wrapper.h" #include "data_ability_observer_interface.h" #include "data_ability_operation.h" #include "data_ability_predicates.h" #include "data_ability_result.h" +#include "hilog_wrapper.h" #include "idatashare.h" #include "values_bucket.h" @@ -37,45 +37,45 @@ std::mutex DataShareHelper::oplock_; DataShareHelper::DataShareHelper(const std::shared_ptr &context, const AAFwk::Want &want) { - APP_LOGI("DataShareHelper::DataShareHelper with context and want start"); + HILOG_INFO("DataShareHelper::DataShareHelper with context and want start"); token_ = context->GetToken(); want_ = want; uri_ = nullptr; dataShareProxy_ = nullptr; dataShareConnection_ = DataShareConnection::GetInstance(); - APP_LOGI("DataShareHelper::DataShareHelper with context and want end"); + HILOG_INFO("DataShareHelper::DataShareHelper with context and want end"); } DataShareHelper::DataShareHelper(const std::shared_ptr &context, const AAFwk::Want &want, const std::shared_ptr &uri, const sptr &dataShareProxy) { - APP_LOGI("DataShareHelper::DataShareHelper start"); + HILOG_INFO("DataShareHelper::DataShareHelper start"); token_ = context->GetToken(); context_ = std::shared_ptr(context); want_ = want; uri_ = uri; dataShareProxy_ = dataShareProxy; dataShareConnection_ = DataShareConnection::GetInstance(); - APP_LOGI("DataShareHelper::DataShareHelper end"); + HILOG_INFO("DataShareHelper::DataShareHelper end"); } DataShareHelper::DataShareHelper(const std::shared_ptr &context, const AAFwk::Want &want, const std::shared_ptr &uri, const sptr &dataShareProxy) { - APP_LOGI("DataShareHelper::DataShareHelper start"); + HILOG_INFO("DataShareHelper::DataShareHelper start"); token_ = context->GetToken(); want_ = want; uri_ = uri; dataShareProxy_ = dataShareProxy; dataShareConnection_ = DataShareConnection::GetInstance(); - APP_LOGI("DataShareHelper::DataShareHelper end"); + HILOG_INFO("DataShareHelper::DataShareHelper end"); } void DataShareHelper::AddDataShareDeathRecipient(const sptr &token) { - APP_LOGI("DataShareHelper::AddDataShareDeathRecipient start."); + HILOG_INFO("DataShareHelper::AddDataShareDeathRecipient start."); if (token != nullptr && callerDeathRecipient_ != nullptr) { - APP_LOGI("token RemoveDeathRecipient."); + HILOG_INFO("token RemoveDeathRecipient."); token->RemoveDeathRecipient(callerDeathRecipient_); } if (callerDeathRecipient_ == nullptr) { @@ -83,20 +83,20 @@ void DataShareHelper::AddDataShareDeathRecipient(const sptr &toke new DataShareDeathRecipient(std::bind(&DataShareHelper::OnSchedulerDied, this, std::placeholders::_1)); } if (token != nullptr) { - APP_LOGI("token AddDeathRecipient."); + HILOG_INFO("token AddDeathRecipient."); token->AddDeathRecipient(callerDeathRecipient_); } - APP_LOGI("DataShareHelper::AddDataShareDeathRecipient end."); + HILOG_INFO("DataShareHelper::AddDataShareDeathRecipient end."); } void DataShareHelper::OnSchedulerDied(const wptr &remote) { - APP_LOGI("'%{public}s start':", __func__); + HILOG_INFO("'%{public}s start':", __func__); auto object = remote.promote(); object = nullptr; dataShareProxy_ = nullptr; uri_ = nullptr; - APP_LOGI("DataShareHelper::OnSchedulerDied end."); + HILOG_INFO("DataShareHelper::OnSchedulerDied end."); } /** @@ -110,26 +110,26 @@ void DataShareHelper::OnSchedulerDied(const wptr &remote) std::shared_ptr DataShareHelper::Creator( const std::shared_ptr &context, const AAFwk::Want &want) { - APP_LOGI("DataShareHelper::Creator with context start."); + HILOG_INFO("DataShareHelper::Creator with context start."); if (context == nullptr) { - APP_LOGE("DataShareHelper::Creator (context) failed, context == nullptr"); + HILOG_ERROR("DataShareHelper::Creator (context) failed, context == nullptr"); return nullptr; } - APP_LOGI("DataShareHelper::Creator before ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Creator before ConnectDataShareExtAbility."); sptr dataShareConnection = DataShareConnection::GetInstance(); if (!dataShareConnection->IsExtAbilityConnected()) { dataShareConnection->ConnectDataShareExtAbility(want, context->GetToken()); } - APP_LOGI("DataShareHelper::Creator after ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Creator after ConnectDataShareExtAbility."); DataShareHelper *ptrDataShareHelper = new (std::nothrow) DataShareHelper(context, want); if (ptrDataShareHelper == nullptr) { - APP_LOGE("DataShareHelper::Creator (context) failed, create DataShareHelper failed"); + HILOG_ERROR("DataShareHelper::Creator (context) failed, create DataShareHelper failed"); return nullptr; } - APP_LOGI("DataShareHelper::Creator with context end."); + HILOG_INFO("DataShareHelper::Creator with context end."); return std::shared_ptr(ptrDataShareHelper); } @@ -147,24 +147,24 @@ std::shared_ptr DataShareHelper::Creator( std::shared_ptr DataShareHelper::Creator( const std::shared_ptr &context, const AAFwk::Want &want, const std::shared_ptr &uri) { - APP_LOGI("DataShareHelper::Creator with context, want and uri called start."); + HILOG_INFO("DataShareHelper::Creator with context, want and uri called start."); if (context == nullptr) { - APP_LOGE("DataShareHelper::Creator failed, context == nullptr"); + HILOG_ERROR("DataShareHelper::Creator failed, context == nullptr"); return nullptr; } if (uri == nullptr) { - APP_LOGE("DataShareHelper::Creator failed, uri == nullptr"); + HILOG_ERROR("DataShareHelper::Creator failed, uri == nullptr"); return nullptr; } if (uri->GetScheme() != SCHEME_DATASHARE) { - APP_LOGE("DataShareHelper::Creator failed, the Scheme is not datashare, Scheme: %{public}s", + HILOG_ERROR("DataShareHelper::Creator failed, the Scheme is not datashare, Scheme: %{public}s", uri->GetScheme().c_str()); return nullptr; } - APP_LOGI("DataShareHelper::Creator before ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Creator before ConnectDataShareExtAbility."); sptr dataShareProxy = nullptr; sptr dataShareConnection = DataShareConnection::GetInstance(); @@ -173,17 +173,17 @@ std::shared_ptr DataShareHelper::Creator( } dataShareProxy = dataShareConnection->GetDataShareProxy(); if (dataShareProxy == nullptr) { - APP_LOGW("DataShareHelper::Creator get invalid dataShareProxy"); + HILOG_WARN("DataShareHelper::Creator get invalid dataShareProxy"); } - APP_LOGI("DataShareHelper::Creator after ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Creator after ConnectDataShareExtAbility."); DataShareHelper *ptrDataShareHelper = new (std::nothrow) DataShareHelper(context, want, uri, dataShareProxy); if (ptrDataShareHelper == nullptr) { - APP_LOGE("DataShareHelper::Creator failed, create DataShareHelper failed"); + HILOG_ERROR("DataShareHelper::Creator failed, create DataShareHelper failed"); return nullptr; } - APP_LOGI("DataShareHelper::Creator with context, want and uri called end."); + HILOG_INFO("DataShareHelper::Creator with context, want and uri called end."); return std::shared_ptr(ptrDataShareHelper); } @@ -202,24 +202,24 @@ std::shared_ptr DataShareHelper::Creator( const std::shared_ptr &context, const AAFwk::Want &want, const std::shared_ptr &uri) { - APP_LOGI("DataShareHelper::Creator with runtime context, want and uri called start."); + HILOG_INFO("DataShareHelper::Creator with runtime context, want and uri called start."); if (context == nullptr) { - APP_LOGE("DataShareHelper::Creator failed, context == nullptr"); + HILOG_ERROR("DataShareHelper::Creator failed, context == nullptr"); return nullptr; } if (uri == nullptr) { - APP_LOGE("DataShareHelper::Creator failed, uri == nullptr"); + HILOG_ERROR("DataShareHelper::Creator failed, uri == nullptr"); return nullptr; } if (uri->GetScheme() != SCHEME_DATASHARE) { - APP_LOGE("DataShareHelper::Creator failed, the Scheme is not datashare, Scheme: %{public}s", + HILOG_ERROR("DataShareHelper::Creator failed, the Scheme is not datashare, Scheme: %{public}s", uri->GetScheme().c_str()); return nullptr; } - APP_LOGI("DataShareHelper::Creator before ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Creator before ConnectDataShareExtAbility."); sptr dataShareProxy = nullptr; sptr dataShareConnection = DataShareConnection::GetInstance(); @@ -228,17 +228,17 @@ std::shared_ptr DataShareHelper::Creator( } dataShareProxy = dataShareConnection->GetDataShareProxy(); if (dataShareProxy == nullptr) { - APP_LOGW("DataShareHelper::Creator get invalid dataShareProxy"); + HILOG_WARN("DataShareHelper::Creator get invalid dataShareProxy"); } - APP_LOGI("DataShareHelper::Creator after ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Creator after ConnectDataShareExtAbility."); DataShareHelper *ptrDataShareHelper = new (std::nothrow) DataShareHelper(context, want, uri, dataShareProxy); if (ptrDataShareHelper == nullptr) { - APP_LOGE("DataShareHelper::Creator failed, create DataShareHelper failed"); + HILOG_ERROR("DataShareHelper::Creator failed, create DataShareHelper failed"); return nullptr; } - APP_LOGI("DataShareHelper::Creator with runtime context, want and uri called end."); + HILOG_INFO("DataShareHelper::Creator with runtime context, want and uri called end."); return std::shared_ptr(ptrDataShareHelper); } @@ -250,20 +250,20 @@ std::shared_ptr DataShareHelper::Creator( */ bool DataShareHelper::Release() { - APP_LOGI("DataShareHelper::Release start."); + HILOG_INFO("DataShareHelper::Release start."); if (uri_ == nullptr) { - APP_LOGE("DataShareHelper::Release failed, uri_ is nullptr"); + HILOG_ERROR("DataShareHelper::Release failed, uri_ is nullptr"); return false; } - APP_LOGI("DataShareHelper::Release before DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Release before DisconnectDataShareExtAbility."); if (dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->DisconnectDataShareExtAbility(); } - APP_LOGI("DataShareHelper::Release after DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Release after DisconnectDataShareExtAbility."); dataShareProxy_ = nullptr; uri_.reset(); - APP_LOGI("DataShareHelper::Release end."); + HILOG_INFO("DataShareHelper::Release end."); return true; } @@ -277,20 +277,20 @@ bool DataShareHelper::Release() */ std::vector DataShareHelper::GetFileTypes(Uri &uri, const std::string &mimeTypeFilter) { - APP_LOGI("DataShareHelper::GetFileTypes start."); + HILOG_INFO("DataShareHelper::GetFileTypes start."); std::vector matchedMIMEs; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return matchedMIMEs; } if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::GetFileTypes before ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::GetFileTypes before ConnectDataShareExtAbility."); if (!dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->ConnectDataShareExtAbility(want_, token_); } dataShareProxy_ = dataShareConnection_->GetDataShareProxy(); - APP_LOGI("DataShareHelper::GetFileTypes after ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::GetFileTypes after ConnectDataShareExtAbility."); if (isSystemCaller_ && dataShareProxy_) { AddDataShareDeathRecipient(dataShareProxy_->AsObject()); } @@ -299,23 +299,23 @@ std::vector DataShareHelper::GetFileTypes(Uri &uri, const std::stri } if (dataShareProxy_ == nullptr) { - APP_LOGE("%{public}s failed with invalid dataShareProxy_", __func__); + HILOG_ERROR("%{public}s failed with invalid dataShareProxy_", __func__); return matchedMIMEs; } - APP_LOGI("DataShareHelper::GetFileTypes before dataShareProxy_->GetFileTypes."); + HILOG_INFO("DataShareHelper::GetFileTypes before dataShareProxy_->GetFileTypes."); matchedMIMEs = dataShareProxy_->GetFileTypes(uri, mimeTypeFilter); - APP_LOGI("DataShareHelper::GetFileTypes after dataShareProxy_->GetFileTypes."); + HILOG_INFO("DataShareHelper::GetFileTypes after dataShareProxy_->GetFileTypes."); if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::GetFileTypes before DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::GetFileTypes before DisconnectDataShareExtAbility."); if (dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->DisconnectDataShareExtAbility(); } - APP_LOGI("DataShareHelper::GetFileTypes after DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::GetFileTypes after DisconnectDataShareExtAbility."); dataShareProxy_ = nullptr; } - APP_LOGI("DataShareHelper::GetFileTypes end."); + HILOG_INFO("DataShareHelper::GetFileTypes end."); return matchedMIMEs; } @@ -332,20 +332,20 @@ std::vector DataShareHelper::GetFileTypes(Uri &uri, const std::stri */ int DataShareHelper::OpenFile(Uri &uri, const std::string &mode) { - APP_LOGI("DataShareHelper::OpenFile start."); + HILOG_INFO("DataShareHelper::OpenFile start."); int fd = INVALID_VALUE; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return fd; } if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::OpenFile before ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::OpenFile before ConnectDataShareExtAbility."); if (!dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->ConnectDataShareExtAbility(want_, token_); } dataShareProxy_ = dataShareConnection_->GetDataShareProxy(); - APP_LOGI("DataShareHelper::OpenFile after ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::OpenFile after ConnectDataShareExtAbility."); if (isSystemCaller_ && dataShareProxy_) { AddDataShareDeathRecipient(dataShareProxy_->AsObject()); } @@ -354,22 +354,22 @@ int DataShareHelper::OpenFile(Uri &uri, const std::string &mode) } if (dataShareProxy_ == nullptr) { - APP_LOGE("%{public}s failed with invalid dataShareProxy_", __func__); + HILOG_ERROR("%{public}s failed with invalid dataShareProxy_", __func__); return fd; } - APP_LOGI("DataShareHelper::OpenFile before dataShareProxy_->OpenFile."); + HILOG_INFO("DataShareHelper::OpenFile before dataShareProxy_->OpenFile."); fd = dataShareProxy_->OpenFile(uri, mode); - APP_LOGI("DataShareHelper::OpenFile after dataShareProxy_->OpenFile."); + HILOG_INFO("DataShareHelper::OpenFile after dataShareProxy_->OpenFile."); if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::OpenFile before DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::OpenFile before DisconnectDataShareExtAbility."); if (dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->DisconnectDataShareExtAbility(); } - APP_LOGI("DataShareHelper::OpenFile after DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::OpenFile after DisconnectDataShareExtAbility."); dataShareProxy_ = nullptr; } - APP_LOGI("DataShareHelper::OpenFile end."); + HILOG_INFO("DataShareHelper::OpenFile end."); return fd; } @@ -387,20 +387,20 @@ int DataShareHelper::OpenFile(Uri &uri, const std::string &mode) */ int DataShareHelper::OpenRawFile(Uri &uri, const std::string &mode) { - APP_LOGI("DataShareHelper::OpenRawFile start."); + HILOG_INFO("DataShareHelper::OpenRawFile start."); int fd = INVALID_VALUE; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return fd; } if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::OpenRawFile before ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::OpenRawFile before ConnectDataShareExtAbility."); if (!dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->ConnectDataShareExtAbility(want_, token_); } dataShareProxy_ = dataShareConnection_->GetDataShareProxy(); - APP_LOGI("DataShareHelper::OpenRawFile after ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::OpenRawFile after ConnectDataShareExtAbility."); if (isSystemCaller_ && dataShareProxy_) { AddDataShareDeathRecipient(dataShareProxy_->AsObject()); } @@ -409,22 +409,22 @@ int DataShareHelper::OpenRawFile(Uri &uri, const std::string &mode) } if (dataShareProxy_ == nullptr) { - APP_LOGE("%{public}s failed with invalid dataShareProxy_", __func__); + HILOG_ERROR("%{public}s failed with invalid dataShareProxy_", __func__); return fd; } - APP_LOGI("DataShareHelper::OpenRawFile before dataShareProxy_->OpenRawFile."); + HILOG_INFO("DataShareHelper::OpenRawFile before dataShareProxy_->OpenRawFile."); fd = dataShareProxy_->OpenRawFile(uri, mode); - APP_LOGI("DataShareHelper::OpenRawFile after dataShareProxy_->OpenRawFile."); + HILOG_INFO("DataShareHelper::OpenRawFile after dataShareProxy_->OpenRawFile."); if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::OpenRawFile before DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::OpenRawFile before DisconnectDataShareExtAbility."); if (dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->DisconnectDataShareExtAbility(); } - APP_LOGI("DataShareHelper::OpenRawFile after DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::OpenRawFile after DisconnectDataShareExtAbility."); dataShareProxy_ = nullptr; } - APP_LOGI("DataShareHelper::OpenRawFile end."); + HILOG_INFO("DataShareHelper::OpenRawFile end."); return fd; } @@ -438,20 +438,20 @@ int DataShareHelper::OpenRawFile(Uri &uri, const std::string &mode) */ int DataShareHelper::Insert(Uri &uri, const NativeRdb::ValuesBucket &value) { - APP_LOGI("DataShareHelper::Insert start."); + HILOG_INFO("DataShareHelper::Insert start."); int index = INVALID_VALUE; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return index; } if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::Insert before ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Insert before ConnectDataShareExtAbility."); if (!dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->ConnectDataShareExtAbility(want_, token_); } dataShareProxy_ = dataShareConnection_->GetDataShareProxy(); - APP_LOGI("DataShareHelper::Insert after ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Insert after ConnectDataShareExtAbility."); if (isSystemCaller_ && dataShareProxy_) { AddDataShareDeathRecipient(dataShareProxy_->AsObject()); } @@ -460,22 +460,22 @@ int DataShareHelper::Insert(Uri &uri, const NativeRdb::ValuesBucket &value) } if (dataShareProxy_ == nullptr) { - APP_LOGE("%{public}s failed with invalid dataShareProxy_", __func__); + HILOG_ERROR("%{public}s failed with invalid dataShareProxy_", __func__); return index; } - APP_LOGI("DataShareHelper::Insert before dataShareProxy_->Insert."); + HILOG_INFO("DataShareHelper::Insert before dataShareProxy_->Insert."); index = dataShareProxy_->Insert(uri, value); - APP_LOGI("DataShareHelper::Insert after dataShareProxy_->Insert."); + HILOG_INFO("DataShareHelper::Insert after dataShareProxy_->Insert."); if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::Insert before DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Insert before DisconnectDataShareExtAbility."); if (dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->DisconnectDataShareExtAbility(); } - APP_LOGI("DataShareHelper::Insert after DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Insert after DisconnectDataShareExtAbility."); dataShareProxy_ = nullptr; } - APP_LOGI("DataShareHelper::Insert end."); + HILOG_INFO("DataShareHelper::Insert end."); return index; } @@ -491,20 +491,20 @@ int DataShareHelper::Insert(Uri &uri, const NativeRdb::ValuesBucket &value) int DataShareHelper::Update( Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("DataShareHelper::Update start."); + HILOG_INFO("DataShareHelper::Update start."); int index = INVALID_VALUE; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return index; } if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::Update before ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Update before ConnectDataShareExtAbility."); if (!dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->ConnectDataShareExtAbility(want_, token_); } dataShareProxy_ = dataShareConnection_->GetDataShareProxy(); - APP_LOGI("DataShareHelper::Update after ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Update after ConnectDataShareExtAbility."); if (isSystemCaller_ && dataShareProxy_) { AddDataShareDeathRecipient(dataShareProxy_->AsObject()); } @@ -513,22 +513,22 @@ int DataShareHelper::Update( } if (dataShareProxy_ == nullptr) { - APP_LOGE("%{public}s failed with invalid dataShareProxy_", __func__); + HILOG_ERROR("%{public}s failed with invalid dataShareProxy_", __func__); return index; } - APP_LOGI("DataShareHelper::Update before dataShareProxy_->Update."); + HILOG_INFO("DataShareHelper::Update before dataShareProxy_->Update."); index = dataShareProxy_->Update(uri, value, predicates); - APP_LOGI("DataShareHelper::Update after dataShareProxy_->Update."); + HILOG_INFO("DataShareHelper::Update after dataShareProxy_->Update."); if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::Update before DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Update before DisconnectDataShareExtAbility."); if (dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->DisconnectDataShareExtAbility(); } - APP_LOGI("DataShareHelper::Update after DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Update after DisconnectDataShareExtAbility."); dataShareProxy_ = nullptr; } - APP_LOGI("DataShareHelper::Update end."); + HILOG_INFO("DataShareHelper::Update end."); return index; } @@ -542,20 +542,20 @@ int DataShareHelper::Update( */ int DataShareHelper::Delete(Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("DataShareHelper::Delete start."); + HILOG_INFO("DataShareHelper::Delete start."); int index = INVALID_VALUE; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return index; } if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::Delete before ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Delete before ConnectDataShareExtAbility."); if (!dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->ConnectDataShareExtAbility(want_, token_); } dataShareProxy_ = dataShareConnection_->GetDataShareProxy(); - APP_LOGI("DataShareHelper::Delete after ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Delete after ConnectDataShareExtAbility."); if (isSystemCaller_ && dataShareProxy_) { AddDataShareDeathRecipient(dataShareProxy_->AsObject()); } @@ -564,22 +564,22 @@ int DataShareHelper::Delete(Uri &uri, const NativeRdb::DataAbilityPredicates &pr } if (dataShareProxy_ == nullptr) { - APP_LOGE("%{public}s failed with invalid dataShareProxy_", __func__); + HILOG_ERROR("%{public}s failed with invalid dataShareProxy_", __func__); return index; } - APP_LOGI("DataShareHelper::Delete before dataShareProxy_->Delete."); + HILOG_INFO("DataShareHelper::Delete before dataShareProxy_->Delete."); index = dataShareProxy_->Delete(uri, predicates); - APP_LOGI("DataShareHelper::Delete after dataShareProxy_->Delete."); + HILOG_INFO("DataShareHelper::Delete after dataShareProxy_->Delete."); if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::Delete before DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Delete before DisconnectDataShareExtAbility."); if (dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->DisconnectDataShareExtAbility(); } - APP_LOGI("DataShareHelper::Delete after DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Delete after DisconnectDataShareExtAbility."); dataShareProxy_ = nullptr; } - APP_LOGI("DataShareHelper::Delete end."); + HILOG_INFO("DataShareHelper::Delete end."); return index; } @@ -595,21 +595,21 @@ int DataShareHelper::Delete(Uri &uri, const NativeRdb::DataAbilityPredicates &pr std::shared_ptr DataShareHelper::Query( Uri &uri, std::vector &columns, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("DataShareHelper::Query start."); + HILOG_INFO("DataShareHelper::Query start."); std::shared_ptr resultset = nullptr; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return resultset; } if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::Query before ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Query before ConnectDataShareExtAbility."); if (!dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->ConnectDataShareExtAbility(want_, token_); } dataShareProxy_ = dataShareConnection_->GetDataShareProxy(); - APP_LOGI("DataShareHelper::Query after ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Query after ConnectDataShareExtAbility."); if (isSystemCaller_ && dataShareProxy_) { AddDataShareDeathRecipient(dataShareProxy_->AsObject()); } @@ -618,22 +618,22 @@ std::shared_ptr DataShareHelper::Query( } if (dataShareProxy_ == nullptr) { - APP_LOGE("%{public}s failed with invalid dataShareProxy_", __func__); + HILOG_ERROR("%{public}s failed with invalid dataShareProxy_", __func__); return resultset; } - APP_LOGI("DataShareHelper::Query before dataShareProxy_->Query."); + HILOG_INFO("DataShareHelper::Query before dataShareProxy_->Query."); resultset = dataShareProxy_->Query(uri, columns, predicates); - APP_LOGI("DataShareHelper::Query after dataShareProxy_->Query."); + HILOG_INFO("DataShareHelper::Query after dataShareProxy_->Query."); if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::Query before DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Query before DisconnectDataShareExtAbility."); if (dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->DisconnectDataShareExtAbility(); } - APP_LOGI("DataShareHelper::Query after DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::Query after DisconnectDataShareExtAbility."); dataShareProxy_ = nullptr; } - APP_LOGI("DataShareHelper::Query end."); + HILOG_INFO("DataShareHelper::Query end."); return resultset; } @@ -647,20 +647,20 @@ std::shared_ptr DataShareHelper::Query( */ std::string DataShareHelper::GetType(Uri &uri) { - APP_LOGI("DataShareHelper::GetType start."); + HILOG_INFO("DataShareHelper::GetType start."); std::string type; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return type; } if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::GetType before ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::GetType before ConnectDataShareExtAbility."); if (!dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->ConnectDataShareExtAbility(want_, token_); } dataShareProxy_ = dataShareConnection_->GetDataShareProxy(); - APP_LOGI("DataShareHelper::GetType after ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::GetType after ConnectDataShareExtAbility."); if (isSystemCaller_ && dataShareProxy_) { AddDataShareDeathRecipient(dataShareProxy_->AsObject()); } @@ -669,22 +669,22 @@ std::string DataShareHelper::GetType(Uri &uri) } if (dataShareProxy_ == nullptr) { - APP_LOGE("%{public}s failed with invalid dataShareProxy_", __func__); + HILOG_ERROR("%{public}s failed with invalid dataShareProxy_", __func__); return type; } - APP_LOGI("DataShareHelper::GetType before dataShareProxy_->GetType."); + HILOG_INFO("DataShareHelper::GetType before dataShareProxy_->GetType."); type = dataShareProxy_->GetType(uri); - APP_LOGI("DataShareHelper::GetType after dataShareProxy_->GetType."); + HILOG_INFO("DataShareHelper::GetType after dataShareProxy_->GetType."); if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::GetType before DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::GetType before DisconnectDataShareExtAbility."); if (dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->DisconnectDataShareExtAbility(); } - APP_LOGI("DataShareHelper::GetType after DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::GetType after DisconnectDataShareExtAbility."); dataShareProxy_ = nullptr; } - APP_LOGI("DataShareHelper::GetType end."); + HILOG_INFO("DataShareHelper::GetType end."); return type; } @@ -698,20 +698,20 @@ std::string DataShareHelper::GetType(Uri &uri) */ int DataShareHelper::BatchInsert(Uri &uri, const std::vector &values) { - APP_LOGI("DataShareHelper::BatchInsert start."); + HILOG_INFO("DataShareHelper::BatchInsert start."); int ret = INVALID_VALUE; if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return ret; } if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::BatchInsert before ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::BatchInsert before ConnectDataShareExtAbility."); if (!dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->ConnectDataShareExtAbility(want_, token_); } dataShareProxy_ = dataShareConnection_->GetDataShareProxy(); - APP_LOGI("DataShareHelper::BatchInsert after ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::BatchInsert after ConnectDataShareExtAbility."); if (isSystemCaller_ && dataShareProxy_) { AddDataShareDeathRecipient(dataShareProxy_->AsObject()); } @@ -720,37 +720,37 @@ int DataShareHelper::BatchInsert(Uri &uri, const std::vectorBatchInsert."); + HILOG_INFO("DataShareHelper::BatchInsert before dataShareProxy_->BatchInsert."); ret = dataShareProxy_->BatchInsert(uri, values); - APP_LOGI("DataShareHelper::BatchInsert after dataShareProxy_->BatchInsert."); + HILOG_INFO("DataShareHelper::BatchInsert after dataShareProxy_->BatchInsert."); if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::BatchInsert before DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::BatchInsert before DisconnectDataShareExtAbility."); if (dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->DisconnectDataShareExtAbility(); } - APP_LOGI("DataShareHelper::BatchInsert after DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::BatchInsert after DisconnectDataShareExtAbility."); dataShareProxy_ = nullptr; } - APP_LOGI("DataShareHelper::BatchInsert end."); + HILOG_INFO("DataShareHelper::BatchInsert end."); return ret; } bool DataShareHelper::CheckUriParam(const Uri &uri) { - APP_LOGI("DataShareHelper::CheckUriParam start."); + HILOG_INFO("DataShareHelper::CheckUriParam start."); Uri checkUri(uri.ToString()); if (!CheckOhosUri(checkUri)) { - APP_LOGE("DataShareHelper::CheckUriParam failed. CheckOhosUri uri failed"); + HILOG_ERROR("DataShareHelper::CheckUriParam failed. CheckOhosUri uri failed"); return false; } if (uri_ != nullptr) { if (!CheckOhosUri(*uri_)) { - APP_LOGE("DataShareHelper::CheckUriParam failed. CheckOhosUri uri_ failed"); + HILOG_ERROR("DataShareHelper::CheckUriParam failed. CheckOhosUri uri_ failed"); return false; } @@ -761,35 +761,35 @@ bool DataShareHelper::CheckUriParam(const Uri &uri) uri_->GetPathSegments(segments); if (checkSegments[0] != segments[0]) { - APP_LOGE("DataShareHelper::CheckUriParam failed. the datashare in uri doesn't equal the one in uri_."); + HILOG_ERROR("DataShareHelper::CheckUriParam failed. the datashare in uri doesn't equal the one in uri_."); return false; } } - APP_LOGI("DataShareHelper::CheckUriParam end."); + HILOG_INFO("DataShareHelper::CheckUriParam end."); return true; } bool DataShareHelper::CheckOhosUri(const Uri &uri) { - APP_LOGI("DataShareHelper::CheckOhosUri start."); + HILOG_INFO("DataShareHelper::CheckOhosUri start."); Uri checkUri(uri.ToString()); if (checkUri.GetScheme() != SCHEME_DATASHARE) { - APP_LOGE("DataShareHelper::CheckOhosUri failed. uri is not a datashare one."); + HILOG_ERROR("DataShareHelper::CheckOhosUri failed. uri is not a datashare one."); return false; } std::vector segments; checkUri.GetPathSegments(segments); if (segments.empty()) { - APP_LOGE("DataShareHelper::CheckOhosUri failed. There is no segments in the uri."); + HILOG_ERROR("DataShareHelper::CheckOhosUri failed. There is no segments in the uri."); return false; } if (checkUri.GetPath() == "") { - APP_LOGE("DataShareHelper::CheckOhosUri failed. The path in the uri is empty."); + HILOG_ERROR("DataShareHelper::CheckOhosUri failed. The path in the uri is empty."); return false; } - APP_LOGI("DataShareHelper::CheckOhosUri end."); + HILOG_INFO("DataShareHelper::CheckOhosUri end."); return true; } @@ -801,14 +801,14 @@ bool DataShareHelper::CheckOhosUri(const Uri &uri) */ void DataShareHelper::RegisterObserver(const Uri &uri, const sptr &dataObserver) { - APP_LOGI("DataShareHelper::RegisterObserver start."); + HILOG_INFO("DataShareHelper::RegisterObserver start."); if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return; } if (dataObserver == nullptr) { - APP_LOGE("%{public}s called. dataObserver is nullptr", __func__); + HILOG_ERROR("%{public}s called. dataObserver is nullptr", __func__); return; } @@ -827,7 +827,7 @@ void DataShareHelper::RegisterObserver(const Uri &uri, const sptrsecond != tmpUri.GetPath()) { - APP_LOGE("DataShareHelper::RegisterObserver failed input uri's path is not equal the one the " + HILOG_ERROR("DataShareHelper::RegisterObserver failed input uri's path is not equal the one the " "observer used"); return; } @@ -838,13 +838,13 @@ void DataShareHelper::RegisterObserver(const Uri &uri, const sptrRegisterObserver(uri, dataObserver); - APP_LOGI("DataShareHelper::RegisterObserver end."); + HILOG_INFO("DataShareHelper::RegisterObserver end."); } /** @@ -855,14 +855,14 @@ void DataShareHelper::RegisterObserver(const Uri &uri, const sptr &dataObserver) { - APP_LOGI("DataShareHelper::UnregisterObserver start."); + HILOG_INFO("DataShareHelper::UnregisterObserver start."); if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return; } if (dataObserver == nullptr) { - APP_LOGE("%{public}s called. dataObserver is nullptr", __func__); + HILOG_ERROR("%{public}s called. dataObserver is nullptr", __func__); return; } @@ -876,7 +876,7 @@ void DataShareHelper::UnregisterObserver(const Uri &uri, const sptrsecond != tmpUri.GetPath()) { - APP_LOGE("DataShareHelper::UnregisterObserver failed input uri's path is not equal the one the " + HILOG_ERROR("DataShareHelper::UnregisterObserver failed input uri's path is not equal the one the " "observer used"); return; } @@ -886,22 +886,22 @@ void DataShareHelper::UnregisterObserver(const Uri &uri, const sptrUnregisterObserver(uri, dataObserver); if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::UnregisterObserver before DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::UnregisterObserver before DisconnectDataShareExtAbility."); if (dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->DisconnectDataShareExtAbility(); } - APP_LOGI("DataShareHelper::UnregisterObserver after DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::UnregisterObserver after DisconnectDataShareExtAbility."); dataShareProxy_ = nullptr; } registerMap_.erase(dataObserver); uriMap_.erase(dataObserver); - APP_LOGI("DataShareHelper::UnregisterObserver end."); + HILOG_INFO("DataShareHelper::UnregisterObserver end."); } /** @@ -911,9 +911,9 @@ void DataShareHelper::UnregisterObserver(const Uri &uri, const sptrIsExtAbilityConnected()) { dataShareConnection_->ConnectDataShareExtAbility(want_, token_); } dataShareProxy_ = dataShareConnection_->GetDataShareProxy(); - APP_LOGI("DataShareHelper::NormalizeUri after ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::NormalizeUri after ConnectDataShareExtAbility."); if (isSystemCaller_ && dataShareProxy_) { AddDataShareDeathRecipient(dataShareProxy_->AsObject()); } @@ -978,22 +978,22 @@ Uri DataShareHelper::NormalizeUri(Uri &uri) } if (dataShareProxy_ == nullptr) { - APP_LOGE("%{public}s failed with invalid dataShareProxy_", __func__); + HILOG_ERROR("%{public}s failed with invalid dataShareProxy_", __func__); return urivalue; } - APP_LOGI("DataShareHelper::NormalizeUri before dataShareProxy_->NormalizeUri."); + HILOG_INFO("DataShareHelper::NormalizeUri before dataShareProxy_->NormalizeUri."); urivalue = dataShareProxy_->NormalizeUri(uri); - APP_LOGI("DataShareHelper::NormalizeUri after dataShareProxy_->NormalizeUri."); + HILOG_INFO("DataShareHelper::NormalizeUri after dataShareProxy_->NormalizeUri."); if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::NormalizeUri before DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::NormalizeUri before DisconnectDataShareExtAbility."); if (dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->DisconnectDataShareExtAbility(); } - APP_LOGI("DataShareHelper::NormalizeUri after DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::NormalizeUri after DisconnectDataShareExtAbility."); dataShareProxy_ = nullptr; } - APP_LOGI("DataShareHelper::NormalizeUri end."); + HILOG_INFO("DataShareHelper::NormalizeUri end."); return urivalue; } @@ -1009,20 +1009,20 @@ Uri DataShareHelper::NormalizeUri(Uri &uri) */ Uri DataShareHelper::DenormalizeUri(Uri &uri) { - APP_LOGI("DataShareHelper::DenormalizeUri start."); + HILOG_INFO("DataShareHelper::DenormalizeUri start."); Uri urivalue(""); if (!CheckUriParam(uri)) { - APP_LOGE("%{public}s called. CheckUriParam uri failed", __func__); + HILOG_ERROR("%{public}s called. CheckUriParam uri failed", __func__); return urivalue; } if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::DenormalizeUri before ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::DenormalizeUri before ConnectDataShareExtAbility."); if (!dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->ConnectDataShareExtAbility(want_, token_); } dataShareProxy_ = dataShareConnection_->GetDataShareProxy(); - APP_LOGI("DataShareHelper::DenormalizeUri after ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::DenormalizeUri after ConnectDataShareExtAbility."); if (isSystemCaller_ && dataShareProxy_) { AddDataShareDeathRecipient(dataShareProxy_->AsObject()); } @@ -1031,32 +1031,32 @@ Uri DataShareHelper::DenormalizeUri(Uri &uri) } if (dataShareProxy_ == nullptr) { - APP_LOGE("%{public}s failed with invalid dataShareProxy_", __func__); + HILOG_ERROR("%{public}s failed with invalid dataShareProxy_", __func__); return urivalue; } - APP_LOGI("DataShareHelper::DenormalizeUri before dataShareProxy_->DenormalizeUri."); + HILOG_INFO("DataShareHelper::DenormalizeUri before dataShareProxy_->DenormalizeUri."); urivalue = dataShareProxy_->DenormalizeUri(uri); - APP_LOGI("DataShareHelper::DenormalizeUri after dataShareProxy_->DenormalizeUri."); + HILOG_INFO("DataShareHelper::DenormalizeUri after dataShareProxy_->DenormalizeUri."); if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::DenormalizeUri before DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::DenormalizeUri before DisconnectDataShareExtAbility."); if (dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->DisconnectDataShareExtAbility(); } - APP_LOGI("DataShareHelper::DenormalizeUri after DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::DenormalizeUri after DisconnectDataShareExtAbility."); dataShareProxy_ = nullptr; } - APP_LOGI("DataShareHelper::DenormalizeUri end."); + HILOG_INFO("DataShareHelper::DenormalizeUri end."); return urivalue; } void DataShareDeathRecipient::OnRemoteDied(const wptr &remote) { - APP_LOGI("recv DataShareDeathRecipient death notice"); + HILOG_INFO("recv DataShareDeathRecipient death notice"); if (handler_) { handler_(remote); } - APP_LOGI("DataShareHelper::OnRemoteDied end."); + HILOG_INFO("DataShareHelper::OnRemoteDied end."); } DataShareDeathRecipient::DataShareDeathRecipient(RemoteDiedHandler handler) : handler_(handler) @@ -1068,21 +1068,21 @@ DataShareDeathRecipient::~DataShareDeathRecipient() std::vector> DataShareHelper::ExecuteBatch( const Uri &uri, const std::vector> &operations) { - APP_LOGI("DataShareHelper::ExecuteBatch start"); + HILOG_INFO("DataShareHelper::ExecuteBatch start"); std::vector> results; if (!CheckUriParam(uri)) { - APP_LOGE("DataShareHelper::ExecuteBatch. CheckUriParam uri failed"); + HILOG_ERROR("DataShareHelper::ExecuteBatch. CheckUriParam uri failed"); return results; } if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::ExecuteBatch before ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::ExecuteBatch before ConnectDataShareExtAbility."); if (!dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->ConnectDataShareExtAbility(want_, token_); } dataShareProxy_ = dataShareConnection_->GetDataShareProxy(); - APP_LOGI("DataShareHelper::ExecuteBatch after ConnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::ExecuteBatch after ConnectDataShareExtAbility."); if (dataShareProxy_ == nullptr) { - APP_LOGE("DataShareHelper::ExecuteBatch failed dataShareProxy_ == nullptr"); + HILOG_ERROR("DataShareHelper::ExecuteBatch failed dataShareProxy_ == nullptr"); return results; } } else { @@ -1090,22 +1090,22 @@ std::vector> DataShareHelper::ExecuteBatch( } if (dataShareProxy_ == nullptr) { - APP_LOGE("%{public}s failed with invalid dataShareProxy_", __func__); + HILOG_ERROR("%{public}s failed with invalid dataShareProxy_", __func__); return results; } - APP_LOGI("DataShareHelper::ExecuteBatch before dataShareProxy_->ExecuteBatch."); + HILOG_INFO("DataShareHelper::ExecuteBatch before dataShareProxy_->ExecuteBatch."); results = dataShareProxy_->ExecuteBatch(operations); - APP_LOGI("DataShareHelper::ExecuteBatch after dataShareProxy_->ExecuteBatch."); + HILOG_INFO("DataShareHelper::ExecuteBatch after dataShareProxy_->ExecuteBatch."); if (uri_ == nullptr) { - APP_LOGI("DataShareHelper::ExecuteBatch before DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::ExecuteBatch before DisconnectDataShareExtAbility."); if (dataShareConnection_->IsExtAbilityConnected()) { dataShareConnection_->DisconnectDataShareExtAbility(); } - APP_LOGI("DataShareHelper::ExecuteBatch after DisconnectDataShareExtAbility."); + HILOG_INFO("DataShareHelper::ExecuteBatch after DisconnectDataShareExtAbility."); dataShareProxy_ = nullptr; } - APP_LOGI("DataShareHelper::ExecuteBatch end"); + HILOG_INFO("DataShareHelper::ExecuteBatch end"); return results; } } // namespace AppExecFwk diff --git a/frameworks/kits/ability/native/src/datashare_proxy.cpp b/frameworks/kits/ability/native/src/datashare_proxy.cpp index 7df5ade41a..79aa25981a 100644 --- a/frameworks/kits/ability/native/src/datashare_proxy.cpp +++ b/frameworks/kits/ability/native/src/datashare_proxy.cpp @@ -19,11 +19,11 @@ #include #include "abs_shared_result_set.h" -#include "app_log_wrapper.h" #include "data_ability_observer_interface.h" #include "data_ability_operation.h" #include "data_ability_predicates.h" #include "data_ability_result.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "ishared_result_set.h" #include "pac_map.h" @@ -33,7 +33,7 @@ namespace OHOS { namespace AppExecFwk { std::vector DataShareProxy::GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); std::vector types; MessageParcel data; @@ -41,50 +41,50 @@ std::vector DataShareProxy::GetFileTypes(const Uri &uri, const std: MessageOption option; if (!data.WriteInterfaceToken(DataShareProxy::GetDescriptor())) { - APP_LOGE("%{public}s WriteInterfaceToken failed", __func__); + HILOG_ERROR("%{public}s WriteInterfaceToken failed", __func__); return types; } if (!data.WriteParcelable(&uri)) { - APP_LOGE("fail to WriteParcelable uri"); + HILOG_ERROR("fail to WriteParcelable uri"); return types; } if (!data.WriteString(mimeTypeFilter)) { - APP_LOGE("fail to WriteString mimeTypeFilter"); + HILOG_ERROR("fail to WriteString mimeTypeFilter"); return types; } int32_t err = Remote()->SendRequest(CMD_GET_FILE_TYPES, data, reply, option); if (err != NO_ERROR) { - APP_LOGE("GetFileTypes fail to SendRequest. err: %d", err); + HILOG_ERROR("GetFileTypes fail to SendRequest. err: %d", err); } if (!reply.ReadStringVector(&types)) { - APP_LOGE("fail to ReadStringVector types"); + HILOG_ERROR("fail to ReadStringVector types"); } - APP_LOGI("%{public}s end successfully.", __func__); + HILOG_INFO("%{public}s end successfully.", __func__); return types; } int DataShareProxy::OpenFile(const Uri &uri, const std::string &mode) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); int fd = -1; MessageParcel data; if (!data.WriteInterfaceToken(DataShareProxy::GetDescriptor())) { - APP_LOGE("%{public}s WriteInterfaceToken failed", __func__); + HILOG_ERROR("%{public}s WriteInterfaceToken failed", __func__); return fd; } if (!data.WriteParcelable(&uri)) { - APP_LOGE("fail to WriteParcelable uri"); + HILOG_ERROR("fail to WriteParcelable uri"); return fd; } if (!data.WriteString(mode)) { - APP_LOGE("fail to WriteString mode"); + HILOG_ERROR("fail to WriteString mode"); return fd; } @@ -92,37 +92,37 @@ int DataShareProxy::OpenFile(const Uri &uri, const std::string &mode) MessageOption option; int32_t err = Remote()->SendRequest(CMD_OPEN_FILE, data, reply, option); if (err != NO_ERROR) { - APP_LOGE("OpenFile fail to SendRequest. err: %d", err); + HILOG_ERROR("OpenFile fail to SendRequest. err: %d", err); return fd; } fd = reply.ReadFileDescriptor(); if (fd == -1) { - APP_LOGE("fail to ReadFileDescriptor fd"); + HILOG_ERROR("fail to ReadFileDescriptor fd"); return fd; } - APP_LOGI("%{public}s end successfully.", __func__); + HILOG_INFO("%{public}s end successfully.", __func__); return fd; } int DataShareProxy::OpenRawFile(const Uri &uri, const std::string &mode) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); int fd = -1; MessageParcel data; if (!data.WriteInterfaceToken(DataShareProxy::GetDescriptor())) { - APP_LOGE("%{public}s WriteInterfaceToken failed", __func__); + HILOG_ERROR("%{public}s WriteInterfaceToken failed", __func__); return fd; } if (!data.WriteParcelable(&uri)) { - APP_LOGE("fail to WriteParcelable uri"); + HILOG_ERROR("fail to WriteParcelable uri"); return fd; } if (!data.WriteString(mode)) { - APP_LOGE("fail to WriteString mode"); + HILOG_ERROR("fail to WriteString mode"); return fd; } @@ -130,36 +130,36 @@ int DataShareProxy::OpenRawFile(const Uri &uri, const std::string &mode) MessageOption option; int32_t err = Remote()->SendRequest(CMD_OPEN_RAW_FILE, data, reply, option); if (err != NO_ERROR) { - APP_LOGE("OpenRawFile fail to SendRequest. err: %d", err); + HILOG_ERROR("OpenRawFile fail to SendRequest. err: %d", err); return fd; } if (!reply.ReadInt32(fd)) { - APP_LOGE("fail to ReadInt32 fd"); + HILOG_ERROR("fail to ReadInt32 fd"); return fd; } - APP_LOGI("%{public}s end successfully.", __func__); + HILOG_INFO("%{public}s end successfully.", __func__); return fd; } int DataShareProxy::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); int index = -1; MessageParcel data; if (!data.WriteInterfaceToken(DataShareProxy::GetDescriptor())) { - APP_LOGE("%{public}s WriteInterfaceToken failed", __func__); + HILOG_ERROR("%{public}s WriteInterfaceToken failed", __func__); return index; } if (!data.WriteParcelable(&uri)) { - APP_LOGE("fail to WriteParcelable uri"); + HILOG_ERROR("fail to WriteParcelable uri"); return index; } if (!data.WriteParcelable(&value)) { - APP_LOGE("fail to WriteParcelable value"); + HILOG_ERROR("fail to WriteParcelable value"); return index; } @@ -167,42 +167,42 @@ int DataShareProxy::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) MessageOption option; int32_t err = Remote()->SendRequest(CMD_INSERT, data, reply, option); if (err != NO_ERROR) { - APP_LOGE("Insert fail to SendRequest. err: %d", err); + HILOG_ERROR("Insert fail to SendRequest. err: %d", err); return index; } if (!reply.ReadInt32(index)) { - APP_LOGE("fail to ReadInt32 index"); + HILOG_ERROR("fail to ReadInt32 index"); return index; } - APP_LOGI("%{public}s end successfully.", __func__); + HILOG_INFO("%{public}s end successfully.", __func__); return index; } int DataShareProxy::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); int index = -1; MessageParcel data; if (!data.WriteInterfaceToken(DataShareProxy::GetDescriptor())) { - APP_LOGE("%{public}s WriteInterfaceToken failed", __func__); + HILOG_ERROR("%{public}s WriteInterfaceToken failed", __func__); return index; } if (!data.WriteParcelable(&uri)) { - APP_LOGE("fail to WriteParcelable uri"); + HILOG_ERROR("fail to WriteParcelable uri"); return index; } if (!data.WriteParcelable(&value)) { - APP_LOGE("fail to WriteParcelable value"); + HILOG_ERROR("fail to WriteParcelable value"); return index; } if (!data.WriteParcelable(&predicates)) { - APP_LOGE("fail to WriteParcelable predicates"); + HILOG_ERROR("fail to WriteParcelable predicates"); return index; } @@ -210,36 +210,36 @@ int DataShareProxy::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, MessageOption option; int32_t err = Remote()->SendRequest(CMD_UPDATE, data, reply, option); if (err != NO_ERROR) { - APP_LOGE("Update fail to SendRequest. err: %d", err); + HILOG_ERROR("Update fail to SendRequest. err: %d", err); return index; } if (!reply.ReadInt32(index)) { - APP_LOGE("fail to ReadInt32 index"); + HILOG_ERROR("fail to ReadInt32 index"); return index; } - APP_LOGI("%{public}s end successfully.", __func__); + HILOG_INFO("%{public}s end successfully.", __func__); return index; } int DataShareProxy::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); int index = -1; MessageParcel data; if (!data.WriteInterfaceToken(DataShareProxy::GetDescriptor())) { - APP_LOGE("%{public}s WriteInterfaceToken failed", __func__); + HILOG_ERROR("%{public}s WriteInterfaceToken failed", __func__); return index; } if (!data.WriteParcelable(&uri)) { - APP_LOGE("fail to WriteParcelable uri"); + HILOG_ERROR("fail to WriteParcelable uri"); return index; } if (!data.WriteParcelable(&predicates)) { - APP_LOGE("fail to WriteParcelable predicates"); + HILOG_ERROR("fail to WriteParcelable predicates"); return index; } @@ -247,41 +247,41 @@ int DataShareProxy::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicate MessageOption option; int32_t err = Remote()->SendRequest(CMD_DELETE, data, reply, option); if (err != NO_ERROR) { - APP_LOGE("Delete fail to SendRequest. err: %d", err); + HILOG_ERROR("Delete fail to SendRequest. err: %d", err); return index; } if (!reply.ReadInt32(index)) { - APP_LOGE("fail to ReadInt32 index"); + HILOG_ERROR("fail to ReadInt32 index"); return index; } - APP_LOGI("%{public}s end successfully.", __func__); + HILOG_INFO("%{public}s end successfully.", __func__); return index; } std::shared_ptr DataShareProxy::Query(const Uri &uri, std::vector &columns, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); MessageParcel data; if (!data.WriteInterfaceToken(DataShareProxy::GetDescriptor())) { - APP_LOGE("%{public}s WriteInterfaceToken failed", __func__); + HILOG_ERROR("%{public}s WriteInterfaceToken failed", __func__); return nullptr; } if (!data.WriteParcelable(&uri)) { - APP_LOGE("fail to WriteParcelable uri"); + HILOG_ERROR("fail to WriteParcelable uri"); return nullptr; } if (!data.WriteStringVector(columns)) { - APP_LOGE("fail to WriteStringVector columns"); + HILOG_ERROR("fail to WriteStringVector columns"); return nullptr; } if (!data.WriteParcelable(&predicates)) { - APP_LOGE("fail to WriteParcelable predicates"); + HILOG_ERROR("fail to WriteParcelable predicates"); return nullptr; } @@ -289,24 +289,24 @@ std::shared_ptr DataShareProxy::Query(const Uri & MessageOption option; int32_t err = Remote()->SendRequest(CMD_QUERY, data, reply, option); if (err != NO_ERROR) { - APP_LOGE("Query fail to SendRequest. err: %d", err); + HILOG_ERROR("Query fail to SendRequest. err: %d", err); return nullptr; } - APP_LOGI("%{public}s end successfully.", __func__); + HILOG_INFO("%{public}s end successfully.", __func__); return OHOS::NativeRdb::ISharedResultSet::ReadFromParcel(reply); } std::string DataShareProxy::GetType(const Uri &uri) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); std::string type; MessageParcel data; if (!data.WriteInterfaceToken(DataShareProxy::GetDescriptor())) { - APP_LOGE("%{public}s WriteInterfaceToken failed", __func__); + HILOG_ERROR("%{public}s WriteInterfaceToken failed", __func__); return type; } if (!data.WriteParcelable(&uri)) { - APP_LOGE("fail to WriteParcelable uri"); + HILOG_ERROR("fail to WriteParcelable uri"); return type; } @@ -314,44 +314,44 @@ std::string DataShareProxy::GetType(const Uri &uri) MessageOption option; int32_t err = Remote()->SendRequest(CMD_GET_TYPE, data, reply, option); if (err != NO_ERROR) { - APP_LOGE("GetFileTypes fail to SendRequest. err: %d", err); + HILOG_ERROR("GetFileTypes fail to SendRequest. err: %d", err); return type; } type = reply.ReadString(); if (type.empty()) { - APP_LOGE("fail to ReadString type"); + HILOG_ERROR("fail to ReadString type"); return type; } - APP_LOGI("%{public}s end successfully.", __func__); + HILOG_INFO("%{public}s end successfully.", __func__); return type; } int DataShareProxy::BatchInsert(const Uri &uri, const std::vector &values) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); int ret = -1; MessageParcel data; if (!data.WriteInterfaceToken(DataShareProxy::GetDescriptor())) { - APP_LOGE("%{public}s WriteInterfaceToken failed", __func__); + HILOG_ERROR("%{public}s WriteInterfaceToken failed", __func__); return ret; } if (!data.WriteParcelable(&uri)) { - APP_LOGE("fail to WriteParcelable uri"); + HILOG_ERROR("fail to WriteParcelable uri"); return ret; } int count = values.size(); if (!data.WriteInt32(count)) { - APP_LOGE("fail to WriteInt32 ret"); + HILOG_ERROR("fail to WriteInt32 ret"); return ret; } for (int i = 0; i < count; i++) { if (!data.WriteParcelable(&values[i])) { - APP_LOGE("fail to WriteParcelable ret, index = %{public}d", i); + HILOG_ERROR("fail to WriteParcelable ret, index = %{public}d", i); return ret; } } @@ -360,35 +360,35 @@ int DataShareProxy::BatchInsert(const Uri &uri, const std::vectorSendRequest(CMD_BATCH_INSERT, data, reply, option); if (err != NO_ERROR) { - APP_LOGE("GetFileTypes fail to SendRequest. err: %d", err); + HILOG_ERROR("GetFileTypes fail to SendRequest. err: %d", err); return ret; } if (!reply.ReadInt32(ret)) { - APP_LOGE("fail to ReadInt32 index"); + HILOG_ERROR("fail to ReadInt32 index"); return ret; } - APP_LOGI("%{public}s end successfully.", __func__); + HILOG_INFO("%{public}s end successfully.", __func__); return ret; } bool DataShareProxy::RegisterObserver(const Uri &uri, const sptr &dataObserver) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); MessageParcel data; if (!data.WriteInterfaceToken(DataShareProxy::GetDescriptor())) { - APP_LOGE("%{public}s WriteInterfaceToken failed", __func__); + HILOG_ERROR("%{public}s WriteInterfaceToken failed", __func__); return false; } if (!data.WriteParcelable(&uri)) { - APP_LOGE("%{public}s failed to WriteParcelable uri ", __func__); + HILOG_ERROR("%{public}s failed to WriteParcelable uri ", __func__); return false; } if (!data.WriteParcelable(dataObserver->AsObject())) { - APP_LOGE("%{public}s failed to WriteParcelable dataObserver ", __func__); + HILOG_ERROR("%{public}s failed to WriteParcelable dataObserver ", __func__); return false; } @@ -396,31 +396,31 @@ bool DataShareProxy::RegisterObserver(const Uri &uri, const sptrSendRequest(CMD_REGISTER_OBSERVER, data, reply, option); if (result == ERR_NONE) { - APP_LOGI("%{public}s SendRequest ok, retval is %{public}d", __func__, reply.ReadInt32()); + HILOG_INFO("%{public}s SendRequest ok, retval is %{public}d", __func__, reply.ReadInt32()); } else { - APP_LOGE("%{public}s SendRequest error, result=%{public}d", __func__, result); + HILOG_ERROR("%{public}s SendRequest error, result=%{public}d", __func__, result); return false; } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return true; } bool DataShareProxy::UnregisterObserver(const Uri &uri, const sptr &dataObserver) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); MessageParcel data; if (!data.WriteInterfaceToken(DataShareProxy::GetDescriptor())) { - APP_LOGE("%{public}s WriteInterfaceToken failed", __func__); + HILOG_ERROR("%{public}s WriteInterfaceToken failed", __func__); return false; } if (!data.WriteParcelable(&uri)) { - APP_LOGE("%{public}s failed to WriteParcelable uri ", __func__); + HILOG_ERROR("%{public}s failed to WriteParcelable uri ", __func__); return false; } if (!data.WriteParcelable(dataObserver->AsObject())) { - APP_LOGE("%{public}s failed to WriteParcelable dataObserver ", __func__); + HILOG_ERROR("%{public}s failed to WriteParcelable dataObserver ", __func__); return false; } @@ -428,26 +428,26 @@ bool DataShareProxy::UnregisterObserver(const Uri &uri, const sptrSendRequest(CMD_UNREGISTER_OBSERVER, data, reply, option); if (result == ERR_NONE) { - APP_LOGI("%{public}s SendRequest ok, retval is %{public}d", __func__, reply.ReadInt32()); + HILOG_INFO("%{public}s SendRequest ok, retval is %{public}d", __func__, reply.ReadInt32()); } else { - APP_LOGE("%{public}s SendRequest error, result=%{public}d", __func__, result); + HILOG_ERROR("%{public}s SendRequest error, result=%{public}d", __func__, result); return false; } - APP_LOGI("%{public}s end successfully.", __func__); + HILOG_INFO("%{public}s end successfully.", __func__); return true; } bool DataShareProxy::NotifyChange(const Uri &uri) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); MessageParcel data; if (!data.WriteInterfaceToken(DataShareProxy::GetDescriptor())) { - APP_LOGE("%{public}s WriteInterfaceToken failed", __func__); + HILOG_ERROR("%{public}s WriteInterfaceToken failed", __func__); return false; } if (!data.WriteParcelable(&uri)) { - APP_LOGE("%{public}s failed to WriteParcelable uri ", __func__); + HILOG_ERROR("%{public}s failed to WriteParcelable uri ", __func__); return false; } @@ -455,27 +455,27 @@ bool DataShareProxy::NotifyChange(const Uri &uri) MessageOption option; int32_t result = Remote()->SendRequest(CMD_NOTIFY_CHANGE, data, reply, option); if (result == ERR_NONE) { - APP_LOGI("%{public}s SendRequest ok, retval is %{public}d", __func__, reply.ReadInt32()); + HILOG_INFO("%{public}s SendRequest ok, retval is %{public}d", __func__, reply.ReadInt32()); } else { - APP_LOGE("%{public}s SendRequest error, result=%{public}d", __func__, result); + HILOG_ERROR("%{public}s SendRequest error, result=%{public}d", __func__, result); return false; } - APP_LOGI("%{public}s end successfully.", __func__); + HILOG_INFO("%{public}s end successfully.", __func__); return true; } Uri DataShareProxy::NormalizeUri(const Uri &uri) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); Uri urivalue(""); MessageParcel data; if (!data.WriteInterfaceToken(DataShareProxy::GetDescriptor())) { - APP_LOGE("%{public}s WriteInterfaceToken failed", __func__); + HILOG_ERROR("%{public}s WriteInterfaceToken failed", __func__); return urivalue; } if (!data.WriteParcelable(&uri)) { - APP_LOGE("fail to WriteParcelable uri"); + HILOG_ERROR("fail to WriteParcelable uri"); return urivalue; } @@ -483,31 +483,31 @@ Uri DataShareProxy::NormalizeUri(const Uri &uri) MessageOption option; int32_t err = Remote()->SendRequest(CMD_NORMALIZE_URI, data, reply, option); if (err != NO_ERROR) { - APP_LOGE("NormalizeUri fail to SendRequest. err: %d", err); + HILOG_ERROR("NormalizeUri fail to SendRequest. err: %d", err); return urivalue; } std::unique_ptr info(reply.ReadParcelable()); if (!info) { - APP_LOGE("ReadParcelable value is nullptr."); + HILOG_ERROR("ReadParcelable value is nullptr."); return urivalue; } - APP_LOGI("%{public}s end successfully.", __func__); + HILOG_INFO("%{public}s end successfully.", __func__); return *info; } Uri DataShareProxy::DenormalizeUri(const Uri &uri) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); Uri urivalue(""); MessageParcel data; if (!data.WriteInterfaceToken(DataShareProxy::GetDescriptor())) { - APP_LOGE("%{public}s WriteInterfaceToken failed", __func__); + HILOG_ERROR("%{public}s WriteInterfaceToken failed", __func__); return urivalue; } if (!data.WriteParcelable(&uri)) { - APP_LOGE("fail to WriteParcelable uri"); + HILOG_ERROR("fail to WriteParcelable uri"); return urivalue; } @@ -515,41 +515,41 @@ Uri DataShareProxy::DenormalizeUri(const Uri &uri) MessageOption option; int32_t err = Remote()->SendRequest(CMD_DENORMALIZE_URI, data, reply, option); if (err != NO_ERROR) { - APP_LOGE("DenormalizeUri fail to SendRequest. err: %d", err); + HILOG_ERROR("DenormalizeUri fail to SendRequest. err: %d", err); return urivalue; } std::unique_ptr info(reply.ReadParcelable()); if (!info) { - APP_LOGE("ReadParcelable value is nullptr."); + HILOG_ERROR("ReadParcelable value is nullptr."); return urivalue; } - APP_LOGI("%{public}s end successfully.", __func__); + HILOG_INFO("%{public}s end successfully.", __func__); return *info; } std::vector> DataShareProxy::ExecuteBatch( const std::vector> &operations) { - APP_LOGI("%{public}s begin.", __func__); + HILOG_INFO("%{public}s begin.", __func__); MessageParcel data; std::vector> results; results.clear(); if (!data.WriteInterfaceToken(DataShareProxy::GetDescriptor())) { - APP_LOGE("%{public}s WriteInterfaceToken failed", __func__); + HILOG_ERROR("%{public}s WriteInterfaceToken failed", __func__); return results; } int count = operations.size(); if (!data.WriteInt32(count)) { - APP_LOGE("fail to WriteInt32 ret"); + HILOG_ERROR("fail to WriteInt32 ret"); return results; } for (int i = 0; i < count; i++) { if (!data.WriteParcelable(operations[i].get())) { - APP_LOGE("fail to WriteParcelable ret, index = %{public}d", i); + HILOG_ERROR("fail to WriteParcelable ret, index = %{public}d", i); return results; } } @@ -558,26 +558,26 @@ std::vector> DataShareProxy::Exec MessageOption option; int32_t err = Remote()->SendRequest(CMD_EXECUTE_BATCH, data, reply, option); if (err != NO_ERROR) { - APP_LOGE("fail to SendRequest. err: %{public}d", err); + HILOG_ERROR("fail to SendRequest. err: %{public}d", err); return results; } int total = 0; if (!reply.ReadInt32(total)) { - APP_LOGE("fail to ReadInt32 count %{public}d", total); + HILOG_ERROR("fail to ReadInt32 count %{public}d", total); return results; } for (int i = 0; i < total; i++) { AppExecFwk::DataAbilityResult *result = reply.ReadParcelable(); if (result == nullptr) { - APP_LOGE("result is nullptr, index = %{public}d", i); + HILOG_ERROR("result is nullptr, index = %{public}d", i); return results; } std::shared_ptr dataAbilityResult(result); results.push_back(dataAbilityResult); } - APP_LOGI("%{public}s end successfully.", __func__); + HILOG_INFO("%{public}s end successfully.", __func__); return results; } } // namespace AAFwk diff --git a/frameworks/kits/ability/native/src/datashare_stub.cpp b/frameworks/kits/ability/native/src/datashare_stub.cpp index 166cf75b67..08179f33e8 100644 --- a/frameworks/kits/ability/native/src/datashare_stub.cpp +++ b/frameworks/kits/ability/native/src/datashare_stub.cpp @@ -15,11 +15,11 @@ #include "datashare_stub.h" -#include "app_log_wrapper.h" #include "data_ability_observer_interface.h" #include "data_ability_operation.h" #include "data_ability_predicates.h" #include "data_ability_result.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "ishared_result_set.h" #include "values_bucket.h" @@ -53,11 +53,11 @@ DataShareStub::~DataShareStub() int DataShareStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) { - APP_LOGI("%{public}s Received stub message: %{public}d", __func__, code); + HILOG_INFO("%{public}s Received stub message: %{public}d", __func__, code); std::u16string descriptor = DataShareStub::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { - APP_LOGI("local descriptor is not equal to remote"); + HILOG_INFO("local descriptor is not equal to remote"); return ERR_INVALID_STATE; } @@ -66,7 +66,7 @@ int DataShareStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessagePa return (this->*(itFunc->second))(data, reply); } - APP_LOGI("%{public}s remote request unhandled: %{public}d", __func__, code); + HILOG_INFO("%{public}s remote request unhandled: %{public}d", __func__, code); return IPCObjectStub::OnRemoteRequest(code, data, reply, option); } @@ -74,17 +74,17 @@ ErrCode DataShareStub::CmdGetFileTypes(MessageParcel &data, MessageParcel &reply { std::shared_ptr uri(data.ReadParcelable()); if (uri == nullptr) { - APP_LOGE("DataShareStub uri is nullptr"); + HILOG_ERROR("DataShareStub uri is nullptr"); return ERR_INVALID_VALUE; } std::string mimeTypeFilter = data.ReadString(); if (mimeTypeFilter.empty()) { - APP_LOGE("DataShareStub mimeTypeFilter is nullptr"); + HILOG_ERROR("DataShareStub mimeTypeFilter is nullptr"); return ERR_INVALID_VALUE; } std::vector types = GetFileTypes(*uri, mimeTypeFilter); if (!reply.WriteStringVector(types)) { - APP_LOGE("fail to WriteStringVector types"); + HILOG_ERROR("fail to WriteStringVector types"); return ERR_INVALID_VALUE; } return NO_ERROR; @@ -94,21 +94,21 @@ ErrCode DataShareStub::CmdOpenFile(MessageParcel &data, MessageParcel &reply) { std::shared_ptr uri(data.ReadParcelable()); if (uri == nullptr) { - APP_LOGE("DataShareStub uri is nullptr"); + HILOG_ERROR("DataShareStub uri is nullptr"); return ERR_INVALID_VALUE; } std::string mode = data.ReadString(); if (mode.empty()) { - APP_LOGE("DataShareStub mode is nullptr"); + HILOG_ERROR("DataShareStub mode is nullptr"); return ERR_INVALID_VALUE; } int fd = OpenFile(*uri, mode); if (fd < 0) { - APP_LOGE("OpenFile fail, fd is %{pubilc}d", fd); + HILOG_ERROR("OpenFile fail, fd is %{pubilc}d", fd); return ERR_INVALID_VALUE; } if (!reply.WriteFileDescriptor(fd)) { - APP_LOGE("fail to WriteFileDescriptor fd"); + HILOG_ERROR("fail to WriteFileDescriptor fd"); return ERR_INVALID_VALUE; } return NO_ERROR; @@ -118,17 +118,17 @@ ErrCode DataShareStub::CmdOpenRawFile(MessageParcel &data, MessageParcel &reply) { std::shared_ptr uri(data.ReadParcelable()); if (uri == nullptr) { - APP_LOGE("DataShareStub uri is nullptr"); + HILOG_ERROR("DataShareStub uri is nullptr"); return ERR_INVALID_VALUE; } std::string mode = data.ReadString(); if (mode.empty()) { - APP_LOGE("DataShareStub mode is nullptr"); + HILOG_ERROR("DataShareStub mode is nullptr"); return ERR_INVALID_VALUE; } int fd = OpenRawFile(*uri, mode); if (!reply.WriteInt32(fd)) { - APP_LOGE("fail to WriteInt32 fd"); + HILOG_ERROR("fail to WriteInt32 fd"); return ERR_INVALID_VALUE; } return NO_ERROR; @@ -138,20 +138,20 @@ ErrCode DataShareStub::CmdInsert(MessageParcel &data, MessageParcel &reply) { std::shared_ptr uri(data.ReadParcelable()); if (uri == nullptr) { - APP_LOGE("DataShareStub uri is nullptr"); + HILOG_ERROR("DataShareStub uri is nullptr"); return ERR_INVALID_VALUE; } std::shared_ptr value(data.ReadParcelable()); if (value == nullptr) { - APP_LOGE("ReadParcelable value is nullptr"); + HILOG_ERROR("ReadParcelable value is nullptr"); return ERR_INVALID_VALUE; } int index = Insert(*uri, *value); if (!reply.WriteInt32(index)) { - APP_LOGE("fail to WriteInt32 index"); + HILOG_ERROR("fail to WriteInt32 index"); return ERR_INVALID_VALUE; } - APP_LOGI("DataShareStub::CmdInsertInner end"); + HILOG_INFO("DataShareStub::CmdInsertInner end"); return NO_ERROR; } @@ -159,23 +159,23 @@ ErrCode DataShareStub::CmdUpdate(MessageParcel &data, MessageParcel &reply) { std::shared_ptr uri(data.ReadParcelable()); if (uri == nullptr) { - APP_LOGE("DataShareStub uri is nullptr"); + HILOG_ERROR("DataShareStub uri is nullptr"); return ERR_INVALID_VALUE; } std::shared_ptr value(data.ReadParcelable()); if (value == nullptr) { - APP_LOGE("ReadParcelable value is nullptr"); + HILOG_ERROR("ReadParcelable value is nullptr"); return ERR_INVALID_VALUE; } std::shared_ptr predicates( data.ReadParcelable()); if (predicates == nullptr) { - APP_LOGE("ReadParcelable predicates is nullptr"); + HILOG_ERROR("ReadParcelable predicates is nullptr"); return ERR_INVALID_VALUE; } int index = Update(*uri, *value, *predicates); if (!reply.WriteInt32(index)) { - APP_LOGE("fail to WriteInt32 index"); + HILOG_ERROR("fail to WriteInt32 index"); return ERR_INVALID_VALUE; } return NO_ERROR; @@ -185,18 +185,18 @@ ErrCode DataShareStub::CmdDelete(MessageParcel &data, MessageParcel &reply) { std::shared_ptr uri(data.ReadParcelable()); if (uri == nullptr) { - APP_LOGE("DataShareStub uri is nullptr"); + HILOG_ERROR("DataShareStub uri is nullptr"); return ERR_INVALID_VALUE; } std::shared_ptr predicates( data.ReadParcelable()); if (predicates == nullptr) { - APP_LOGE("ReadParcelable predicates is nullptr"); + HILOG_ERROR("ReadParcelable predicates is nullptr"); return ERR_INVALID_VALUE; } int index = Delete(*uri, *predicates); if (!reply.WriteInt32(index)) { - APP_LOGE("fail to WriteInt32 index"); + HILOG_ERROR("fail to WriteInt32 index"); return ERR_INVALID_VALUE; } return NO_ERROR; @@ -206,31 +206,31 @@ ErrCode DataShareStub::CmdQuery(MessageParcel &data, MessageParcel &reply) { std::shared_ptr uri(data.ReadParcelable()); if (uri == nullptr) { - APP_LOGE("DataShareStub uri is nullptr"); + HILOG_ERROR("DataShareStub uri is nullptr"); return ERR_INVALID_VALUE; } std::vector columns; if (!data.ReadStringVector(&columns)) { - APP_LOGE("fail to ReadStringVector columns"); + HILOG_ERROR("fail to ReadStringVector columns"); return ERR_INVALID_VALUE; } std::shared_ptr predicates( data.ReadParcelable()); if (predicates == nullptr) { - APP_LOGE("ReadParcelable predicates is nullptr"); + HILOG_ERROR("ReadParcelable predicates is nullptr"); return ERR_INVALID_VALUE; } auto resultSet = Query(*uri, columns, *predicates); if (resultSet == nullptr) { - APP_LOGE("fail to WriteParcelable resultSet"); + HILOG_ERROR("fail to WriteParcelable resultSet"); return ERR_INVALID_VALUE; } auto result = NativeRdb::ISharedResultSet::WriteToParcel(std::move(resultSet), reply); if (result == nullptr) { - APP_LOGE("!resultSet->Marshalling(reply)"); + HILOG_ERROR("!resultSet->Marshalling(reply)"); return ERR_INVALID_VALUE; } - APP_LOGI("DataShareStub::CmdQueryInner end"); + HILOG_INFO("DataShareStub::CmdQueryInner end"); return NO_ERROR; } @@ -238,12 +238,12 @@ ErrCode DataShareStub::CmdGetType(MessageParcel &data, MessageParcel &reply) { std::shared_ptr uri(data.ReadParcelable()); if (uri == nullptr) { - APP_LOGE("DataShareStub uri is nullptr"); + HILOG_ERROR("DataShareStub uri is nullptr"); return ERR_INVALID_VALUE; } std::string type = GetType(*uri); if (!reply.WriteString(type)) { - APP_LOGE("fail to WriteString type"); + HILOG_ERROR("fail to WriteString type"); return ERR_INVALID_VALUE; } return NO_ERROR; @@ -253,13 +253,13 @@ ErrCode DataShareStub::CmdBatchInsert(MessageParcel &data, MessageParcel &reply) { std::shared_ptr uri(data.ReadParcelable()); if (uri == nullptr) { - APP_LOGE("DataShareStub uri is nullptr"); + HILOG_ERROR("DataShareStub uri is nullptr"); return ERR_INVALID_VALUE; } int count = 0; if (!data.ReadInt32(count)) { - APP_LOGE("fail to ReadInt32 index"); + HILOG_ERROR("fail to ReadInt32 index"); return ERR_INVALID_VALUE; } @@ -267,7 +267,7 @@ ErrCode DataShareStub::CmdBatchInsert(MessageParcel &data, MessageParcel &reply) for (int i = 0; i < count; i++) { NativeRdb::ValuesBucket *value = data.ReadParcelable(); if (value == nullptr) { - APP_LOGE("DataShareStub value is nullptr, index = %{public}d", i); + HILOG_ERROR("DataShareStub value is nullptr, index = %{public}d", i); return ERR_INVALID_VALUE; } values.emplace_back(*value); @@ -275,7 +275,7 @@ ErrCode DataShareStub::CmdBatchInsert(MessageParcel &data, MessageParcel &reply) int ret = BatchInsert(*uri, values); if (!reply.WriteInt32(ret)) { - APP_LOGE("fail to WriteInt32 ret"); + HILOG_ERROR("fail to WriteInt32 ret"); return ERR_INVALID_VALUE; } return NO_ERROR; @@ -286,18 +286,18 @@ ErrCode DataShareStub::CmdRegisterObserver(MessageParcel &data, MessageParcel &r { std::shared_ptr uri(data.ReadParcelable()); if (uri == nullptr) { - APP_LOGE("DataShareStub uri is nullptr"); + HILOG_ERROR("DataShareStub uri is nullptr"); return ERR_INVALID_VALUE; } auto obServer = iface_cast(data.ReadParcelable()); if (obServer == nullptr) { - APP_LOGE("DataShareStub obServer is nullptr"); + HILOG_ERROR("DataShareStub obServer is nullptr"); return ERR_INVALID_VALUE; } bool ret = RegisterObserver(*uri, obServer); if (!reply.WriteInt32(ret)) { - APP_LOGE("fail to WriteInt32 ret"); + HILOG_ERROR("fail to WriteInt32 ret"); return ERR_INVALID_VALUE; } return NO_ERROR; @@ -307,18 +307,18 @@ ErrCode DataShareStub::CmdUnregisterObserver(MessageParcel &data, MessageParcel { std::shared_ptr uri(data.ReadParcelable()); if (uri == nullptr) { - APP_LOGE("DataShareStub uri is nullptr"); + HILOG_ERROR("DataShareStub uri is nullptr"); return ERR_INVALID_VALUE; } auto obServer = iface_cast(data.ReadParcelable()); if (obServer == nullptr) { - APP_LOGE("DataShareStub obServer is nullptr"); + HILOG_ERROR("DataShareStub obServer is nullptr"); return ERR_INVALID_VALUE; } bool ret = UnregisterObserver(*uri, obServer); if (!reply.WriteInt32(ret)) { - APP_LOGE("fail to WriteInt32 ret"); + HILOG_ERROR("fail to WriteInt32 ret"); return ERR_INVALID_VALUE; } return NO_ERROR; @@ -328,13 +328,13 @@ ErrCode DataShareStub::CmdNotifyChange(MessageParcel &data, MessageParcel &reply { std::shared_ptr uri(data.ReadParcelable()); if (uri == nullptr) { - APP_LOGE("DataShareStub uri is nullptr"); + HILOG_ERROR("DataShareStub uri is nullptr"); return ERR_INVALID_VALUE; } bool ret = NotifyChange(*uri); if (!reply.WriteInt32(ret)) { - APP_LOGE("fail to WriteInt32 ret"); + HILOG_ERROR("fail to WriteInt32 ret"); return ERR_INVALID_VALUE; } return NO_ERROR; @@ -344,14 +344,14 @@ ErrCode DataShareStub::CmdNormalizeUri(MessageParcel &data, MessageParcel &reply { std::shared_ptr uri(data.ReadParcelable()); if (uri == nullptr) { - APP_LOGE("DataShareStub uri is nullptr"); + HILOG_ERROR("DataShareStub uri is nullptr"); return ERR_INVALID_VALUE; } Uri ret(""); ret = NormalizeUri(*uri); if (!reply.WriteParcelable(&ret)) { - APP_LOGE("fail to WriteParcelable type"); + HILOG_ERROR("fail to WriteParcelable type"); return ERR_INVALID_VALUE; } return NO_ERROR; @@ -361,14 +361,14 @@ ErrCode DataShareStub::CmdDenormalizeUri(MessageParcel &data, MessageParcel &rep { std::shared_ptr uri(data.ReadParcelable()); if (uri == nullptr) { - APP_LOGE("DataShareStub uri is nullptr"); + HILOG_ERROR("DataShareStub uri is nullptr"); return ERR_INVALID_VALUE; } Uri ret(""); ret = DenormalizeUri(*uri); if (!reply.WriteParcelable(&ret)) { - APP_LOGE("fail to WriteParcelable type"); + HILOG_ERROR("fail to WriteParcelable type"); return ERR_INVALID_VALUE; } return NO_ERROR; @@ -376,18 +376,18 @@ ErrCode DataShareStub::CmdDenormalizeUri(MessageParcel &data, MessageParcel &rep ErrCode DataShareStub::CmdExecuteBatch(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("DataShareStub::CmdExecuteBatchInner start"); + HILOG_INFO("DataShareStub::CmdExecuteBatchInner start"); int count = 0; if (!data.ReadInt32(count)) { - APP_LOGE("DataShareStub::CmdExecuteBatchInner fail to ReadInt32 count"); + HILOG_ERROR("DataShareStub::CmdExecuteBatchInner fail to ReadInt32 count"); return ERR_INVALID_VALUE; } - APP_LOGI("DataShareStub::CmdExecuteBatchInner count:%{public}d", count); + HILOG_INFO("DataShareStub::CmdExecuteBatchInner count:%{public}d", count); std::vector> operations; for (int i = 0; i < count; i++) { AppExecFwk::DataAbilityOperation *operation = data.ReadParcelable(); if (operation == nullptr) { - APP_LOGE("DataShareStub::CmdExecuteBatchInner operation is nullptr, index = %{public}d", i); + HILOG_ERROR("DataShareStub::CmdExecuteBatchInner operation is nullptr, index = %{public}d", i); return ERR_INVALID_VALUE; } std::shared_ptr dataAbilityOperation(operation); @@ -397,22 +397,22 @@ ErrCode DataShareStub::CmdExecuteBatch(MessageParcel &data, MessageParcel &reply std::vector> results = ExecuteBatch(operations); int total = results.size(); if (!reply.WriteInt32(total)) { - APP_LOGE("DataShareStub::CmdExecuteBatchInner fail to WriteInt32 ret"); + HILOG_ERROR("DataShareStub::CmdExecuteBatchInner fail to WriteInt32 ret"); return ERR_INVALID_VALUE; } - APP_LOGI("DataShareStub::CmdExecuteBatchInner total:%{public}d", total); + HILOG_INFO("DataShareStub::CmdExecuteBatchInner total:%{public}d", total); for (int i = 0; i < total; i++) { if (results[i] == nullptr) { - APP_LOGE("DataShareStub::CmdExecuteBatchInner results[i] is nullptr, index = %{public}d", i); + HILOG_ERROR("DataShareStub::CmdExecuteBatchInner results[i] is nullptr, index = %{public}d", i); return ERR_INVALID_VALUE; } if (!reply.WriteParcelable(results[i].get())) { - APP_LOGE( + HILOG_ERROR( "DataShareStub::CmdExecuteBatchInner fail to WriteParcelable operation, index = %{public}d", i); return ERR_INVALID_VALUE; } } - APP_LOGI("DataShareStub::CmdExecuteBatchInner end"); + HILOG_INFO("DataShareStub::CmdExecuteBatchInner end"); return NO_ERROR; } } // namespace AAFwk diff --git a/frameworks/kits/ability/native/src/dummy_data_ability_predicates.cpp b/frameworks/kits/ability/native/src/dummy_data_ability_predicates.cpp index ffd3c70106..27da53315c 100644 --- a/frameworks/kits/ability/native/src/dummy_data_ability_predicates.cpp +++ b/frameworks/kits/ability/native/src/dummy_data_ability_predicates.cpp @@ -14,7 +14,7 @@ */ #include "dummy_data_ability_predicates.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "string_ex.h" namespace OHOS { @@ -43,7 +43,7 @@ DataAbilityPredicates *DataAbilityPredicates::Unmarshalling(Parcel &parcel) { DataAbilityPredicates *dataAbilityPredicates = new (std::nothrow) DataAbilityPredicates(); if (dataAbilityPredicates && !dataAbilityPredicates->ReadFromParcel(parcel)) { - APP_LOGE("DataAbilityPredicates::Unmarshalling ReadFromParcel failed"); + HILOG_ERROR("DataAbilityPredicates::Unmarshalling ReadFromParcel failed"); delete dataAbilityPredicates; dataAbilityPredicates = nullptr; } @@ -58,7 +58,7 @@ DataAbilityPredicates *DataAbilityPredicates::Unmarshalling(Parcel &parcel) bool DataAbilityPredicates::Marshalling(Parcel &parcel) const { if (!parcel.WriteString16(Str8ToStr16(testInf_))) { - APP_LOGE("dataAbilityPredicates::Marshalling WriteString16 failed"); + HILOG_ERROR("dataAbilityPredicates::Marshalling WriteString16 failed"); return false; } return true; diff --git a/frameworks/kits/ability/native/src/dummy_result_set.cpp b/frameworks/kits/ability/native/src/dummy_result_set.cpp index cf329d07b0..1a432e4d1b 100644 --- a/frameworks/kits/ability/native/src/dummy_result_set.cpp +++ b/frameworks/kits/ability/native/src/dummy_result_set.cpp @@ -14,7 +14,7 @@ */ #include "dummy_result_set.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "string_ex.h" namespace OHOS { @@ -43,7 +43,7 @@ ResultSet *ResultSet::Unmarshalling(Parcel &parcel) { ResultSet *resultSet = new (std::nothrow) ResultSet(); if (resultSet && !resultSet->ReadFromParcel(parcel)) { - APP_LOGE("ResultSet::Unmarshalling ReadFromParcel failed"); + HILOG_ERROR("ResultSet::Unmarshalling ReadFromParcel failed"); delete resultSet; resultSet = nullptr; } @@ -58,7 +58,7 @@ ResultSet *ResultSet::Unmarshalling(Parcel &parcel) bool ResultSet::Marshalling(Parcel &parcel) const { if (!parcel.WriteString16(Str8ToStr16(testInf_))) { - APP_LOGE("ResultSet::Marshalling WriteString16 failed"); + HILOG_ERROR("ResultSet::Marshalling WriteString16 failed"); return false; } return true; diff --git a/frameworks/kits/ability/native/src/dummy_values_bucket.cpp b/frameworks/kits/ability/native/src/dummy_values_bucket.cpp index a1085fca8b..b52b17ad13 100644 --- a/frameworks/kits/ability/native/src/dummy_values_bucket.cpp +++ b/frameworks/kits/ability/native/src/dummy_values_bucket.cpp @@ -14,7 +14,7 @@ */ #include "dummy_values_bucket.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "string_ex.h" namespace OHOS { @@ -43,7 +43,7 @@ ValuesBucket *ValuesBucket::Unmarshalling(Parcel &parcel) { ValuesBucket *valuesBucket = new (std::nothrow) ValuesBucket(); if (valuesBucket && !valuesBucket->ReadFromParcel(parcel)) { - APP_LOGE("ValuesBucket::Unmarshalling ReadFromParcel failed"); + HILOG_ERROR("ValuesBucket::Unmarshalling ReadFromParcel failed"); delete valuesBucket; valuesBucket = nullptr; } @@ -58,7 +58,7 @@ ValuesBucket *ValuesBucket::Unmarshalling(Parcel &parcel) bool ValuesBucket::Marshalling(Parcel &parcel) const { if (!parcel.WriteString16(Str8ToStr16(testInf_))) { - APP_LOGE("valuesBucket::Marshalling WriteString16 failed"); + HILOG_ERROR("valuesBucket::Marshalling WriteString16 failed"); return false; } return true; diff --git a/frameworks/kits/ability/native/src/form_js_event_handler.cpp b/frameworks/kits/ability/native/src/form_js_event_handler.cpp index 69cc4e5f33..a4bd1bffd8 100644 --- a/frameworks/kits/ability/native/src/form_js_event_handler.cpp +++ b/frameworks/kits/ability/native/src/form_js_event_handler.cpp @@ -13,11 +13,11 @@ * limitations under the License. */ -#include "app_log_wrapper.h" #include "form_constants.h" #include "form_host_client.h" #include "form_js_event_handler.h" #include "form_mgr.h" +#include "hilog_wrapper.h" #include "ipc_skeleton.h" namespace OHOS { @@ -26,7 +26,7 @@ FormJsEventHandler::FormJsEventHandler( const std::shared_ptr &runner, const std::shared_ptr &ability, const FormJsInfo &formJsInfo) : EventHandler(runner), formJsInfo_(formJsInfo), ability_(ability) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); } /** @@ -36,12 +36,12 @@ FormJsEventHandler::FormJsEventHandler( */ void FormJsEventHandler::ProcessEvent(const InnerEvent::Pointer &event) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (!event) { - APP_LOGE("%{public}s, param illegal, event is nullptr", __func__); + HILOG_ERROR("%{public}s, param illegal, event is nullptr", __func__); return; } - APP_LOGD("%{public}s, inner event id obtained: %u.", __func__, event->GetInnerEventId()); + HILOG_DEBUG("%{public}s, inner event id obtained: %u.", __func__, event->GetInnerEventId()); switch (event->GetInnerEventId()) { case FORM_ROUTE_EVENT: { @@ -57,7 +57,7 @@ void FormJsEventHandler::ProcessEvent(const InnerEvent::Pointer &event) break; } default: { - APP_LOGW("unsupported event."); + HILOG_WARN("unsupported event."); break; } } @@ -69,14 +69,14 @@ void FormJsEventHandler::ProcessEvent(const InnerEvent::Pointer &event) */ void FormJsEventHandler::ProcessRouterEvent(Want &want) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (!IsSystemApp()) { - APP_LOGW("%{public}s, not system application, cannot mixture package router", __func__); + HILOG_WARN("%{public}s, not system application, cannot mixture package router", __func__); return; } if (!want.HasParameter(Constants::PARAM_FORM_ABILITY_NAME_KEY)) { - APP_LOGE("%{public}s, param illegal, abilityName is not exist", __func__); + HILOG_ERROR("%{public}s, param illegal, abilityName is not exist", __func__); return; } @@ -91,34 +91,35 @@ void FormJsEventHandler::ProcessRouterEvent(Want &want) */ void FormJsEventHandler::ProcessMessageEvent(const Want &want) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (!want.HasParameter(Constants::PARAM_FORM_IDENTITY_KEY)) { - APP_LOGE("%{public}s, formid is not exist", __func__); + HILOG_ERROR("%{public}s, formid is not exist", __func__); return; } std::string strFormId = want.GetStringParam(Constants::PARAM_FORM_IDENTITY_KEY); int64_t formId = std::stoll(strFormId); if (formId <= 0) { - APP_LOGE("%{public}s error, The passed formid is invalid. Its value must be larger than 0.", __func__); + HILOG_ERROR("%{public}s error, The passed formid is invalid. Its value must be larger than 0.", __func__); return; } if (!want.HasParameter(Constants::PARAM_MESSAGE_KEY)) { - APP_LOGE("%{public}s, message info is not exist", __func__); + HILOG_ERROR("%{public}s, message info is not exist", __func__); return; } if (FormMgr::GetRecoverStatus() == Constants::IN_RECOVERING) { - APP_LOGE("%{public}s error, form is in recover status, can't do action on form.", __func__); + HILOG_ERROR("%{public}s error, form is in recover status, can't do action on form.", __func__); return; } // requestForm request to fms int resultCode = FormMgr::GetInstance().MessageEvent(formId, want, FormHostClient::GetInstance()); if (resultCode != ERR_OK) { - APP_LOGE("%{public}s error, failed to notify the form service that the form user's lifecycle is updated, error " - "code is %{public}d.", + HILOG_ERROR( + "%{public}s error, failed to notify the form service that the form user's lifecycle is updated, error " + "code is %{public}d.", __func__, resultCode); return; @@ -127,17 +128,17 @@ void FormJsEventHandler::ProcessMessageEvent(const Want &want) bool FormJsEventHandler::IsSystemApp() const { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int32_t callingUid = IPCSkeleton::GetCallingUid(); if (callingUid > Constants::MAX_SYSTEM_APP_UID) { - APP_LOGW("%{public}s warn, callingUid is %{public}d, which is larger than %{public}d.", + HILOG_WARN("%{public}s warn, callingUid is %{public}d, which is larger than %{public}d.", __func__, callingUid, Constants::MAX_SYSTEM_APP_UID); return false; } else { - APP_LOGD("%{public}s, callingUid = %{public}d.", __func__, callingUid); + HILOG_DEBUG("%{public}s, callingUid = %{public}d.", __func__, callingUid); return true; } } diff --git a/frameworks/kits/ability/native/src/form_provider_client.cpp b/frameworks/kits/ability/native/src/form_provider_client.cpp index 2755f4bbbb..b2e433148a 100755 --- a/frameworks/kits/ability/native/src/form_provider_client.cpp +++ b/frameworks/kits/ability/native/src/form_provider_client.cpp @@ -17,9 +17,9 @@ #include -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" #include "form_supply_proxy.h" +#include "hilog_wrapper.h" #include "ipc_skeleton.h" #include "permission/permission.h" #include "permission/permission_kit.h" @@ -42,7 +42,7 @@ int FormProviderClient::AcquireProviderFormInfo( const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); Want newWant(want); newWant.SetParam(Constants::ACQUIRE_TYPE, want.GetIntParam(Constants::ACQUIRE_TYPE, 0)); @@ -52,16 +52,16 @@ int FormProviderClient::AcquireProviderFormInfo( newWant.SetParam(Constants::PARAM_FORM_IDENTITY_KEY, std::to_string(formId)); std::shared_ptr ownerAbility = GetOwner(); if (ownerAbility == nullptr) { - APP_LOGE("%{public}s error, ownerAbility is nullptr.", __func__); + HILOG_ERROR("%{public}s error, ownerAbility is nullptr.", __func__); FormProviderInfo formProviderInfo; newWant.SetParam(Constants::PROVIDER_FLAG, ERR_APPEXECFWK_FORM_NO_SUCH_ABILITY); return HandleAcquire(formProviderInfo, newWant, callerToken); } - APP_LOGI("%{public}s come, %{public}s.", __func__, ownerAbility->GetAbilityName().c_str()); + HILOG_INFO("%{public}s come, %{public}s.", __func__, ownerAbility->GetAbilityName().c_str()); if (!CheckIsSystemApp()) { - APP_LOGW("%{public}s warn, AcquireProviderFormInfo caller permission denied.", __func__); + HILOG_WARN("%{public}s warn, AcquireProviderFormInfo caller permission denied.", __func__); FormProviderInfo formProviderInfo; newWant.SetParam(Constants::PROVIDER_FLAG, ERR_APPEXECFWK_FORM_PERMISSION_DENY); return HandleAcquire(formProviderInfo, newWant, callerToken); @@ -73,7 +73,7 @@ int FormProviderClient::AcquireProviderFormInfo( createWant.RemoveParam(Constants::ACQUIRE_TYPE); createWant.RemoveParam(Constants::FORM_SUPPLY_INFO); FormProviderInfo formProviderInfo = ownerAbility->OnCreate(createWant); - APP_LOGD("%{public}s, formId: %{public}" PRId64 ", data: %{public}s", + HILOG_DEBUG("%{public}s, formId: %{public}" PRId64 ", data: %{public}s", __func__, formId, formProviderInfo.GetFormDataString().c_str()); return HandleAcquire(formProviderInfo, newWant, callerToken); } @@ -87,24 +87,24 @@ int FormProviderClient::AcquireProviderFormInfo( */ int FormProviderClient::NotifyFormDelete(const int64_t formId, const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); // The error code for business operation. int errorCode = ERR_OK; do { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::shared_ptr ownerAbility = GetOwner(); if (ownerAbility == nullptr) { - APP_LOGE("%{public}s error, ownerAbility is nullptr.", __func__); + HILOG_ERROR("%{public}s error, ownerAbility is nullptr.", __func__); errorCode = ERR_APPEXECFWK_FORM_NO_SUCH_ABILITY; break; } if (!CheckIsSystemApp()) { - APP_LOGW("%{public}s caller permission denied", __func__); + HILOG_WARN("%{public}s caller permission denied", __func__); errorCode = ERR_APPEXECFWK_FORM_PERMISSION_DENY; break; } - APP_LOGI("%{public}s come, %{public}s", __func__, ownerAbility->GetAbilityName().c_str()); + HILOG_INFO("%{public}s come, %{public}s", __func__, ownerAbility->GetAbilityName().c_str()); ownerAbility->OnDelete(formId); } while (false); @@ -116,7 +116,7 @@ int FormProviderClient::NotifyFormDelete(const int64_t formId, const Want &want, } else { // If errorCode is ERR_OK,return disconnectErrorCode. if (disconnectErrorCode != ERR_OK) { - APP_LOGE("%{public}s, disconnect error.", __func__); + HILOG_ERROR("%{public}s, disconnect error.", __func__); } return disconnectErrorCode; } @@ -134,24 +134,24 @@ int FormProviderClient::NotifyFormsDelete( const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); // The error code for business operation. int errorCode = ERR_OK; do { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::shared_ptr ownerAbility = GetOwner(); if (ownerAbility == nullptr) { - APP_LOGE("%{public}s error, ownerAbility is nullptr.", __func__); + HILOG_ERROR("%{public}s error, ownerAbility is nullptr.", __func__); errorCode = ERR_APPEXECFWK_FORM_NO_SUCH_ABILITY; break; } if (!CheckIsSystemApp()) { - APP_LOGW("%{public}s caller permission denied", __func__); + HILOG_WARN("%{public}s caller permission denied", __func__); errorCode = ERR_APPEXECFWK_FORM_PERMISSION_DENY; break; } - APP_LOGI("%{public}s come,formIds size=%{public}zu, abilityName:%{public}s", + HILOG_INFO("%{public}s come,formIds size=%{public}zu, abilityName:%{public}s", __func__, formIds.size(), ownerAbility->GetAbilityName().c_str()); for (int64_t formId : formIds) { ownerAbility->OnDelete(formId); @@ -166,7 +166,7 @@ int FormProviderClient::NotifyFormsDelete( } else { // If errorCode is ERR_OK,return disconnectErrorCode. if (disconnectErrorCode != ERR_OK) { - APP_LOGE("%{public}s, disconnect error.", __func__); + HILOG_ERROR("%{public}s, disconnect error.", __func__); } return disconnectErrorCode; } @@ -185,25 +185,25 @@ int FormProviderClient::NotifyFormUpdate( const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); // The error code for business operation. int errorCode = ERR_OK; do { std::shared_ptr ownerAbility = GetOwner(); if (ownerAbility == nullptr) { - APP_LOGE("%{public}s error, owner ability is nullptr.", __func__); + HILOG_ERROR("%{public}s error, owner ability is nullptr.", __func__); errorCode = ERR_APPEXECFWK_FORM_NO_SUCH_ABILITY; break; } if (!CheckIsSystemApp()) { - APP_LOGE("%{public}s warn, caller permission denied.", __func__); + HILOG_ERROR("%{public}s warn, caller permission denied.", __func__); errorCode = ERR_APPEXECFWK_FORM_PERMISSION_DENY; break; } - APP_LOGI("%{public}s come, %{public}s.", __func__, ownerAbility->GetAbilityName().c_str()); + HILOG_INFO("%{public}s come, %{public}s.", __func__, ownerAbility->GetAbilityName().c_str()); ownerAbility->OnUpdate(formId); } while (false); @@ -215,7 +215,7 @@ int FormProviderClient::NotifyFormUpdate( } else { // If errorCode is ERR_OK,return disconnectErrorCode. if (disconnectErrorCode != ERR_OK) { - APP_LOGE("%{public}s, disconnect error.", __func__); + HILOG_ERROR("%{public}s, disconnect error.", __func__); } return disconnectErrorCode; } @@ -235,20 +235,20 @@ int FormProviderClient::EventNotify( const int32_t formVisibleType, const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); // The error code for business operation. int errorCode = ERR_OK; do { std::shared_ptr ownerAbility = GetOwner(); if (ownerAbility == nullptr) { - APP_LOGE("%{public}s error, owner ability is nullptr.", __func__); + HILOG_ERROR("%{public}s error, owner ability is nullptr.", __func__); errorCode = ERR_APPEXECFWK_FORM_NO_SUCH_ABILITY; break; } if (!CheckIsSystemApp()) { - APP_LOGW("%{public}s warn, caller permission denied.", __func__); + HILOG_WARN("%{public}s warn, caller permission denied.", __func__); errorCode = ERR_APPEXECFWK_FORM_PERMISSION_DENY; break; } @@ -258,7 +258,7 @@ int FormProviderClient::EventNotify( formEventsMap.insert(std::make_pair(formId, formVisibleType)); } - APP_LOGI("%{public}s come, %{public}s.", __func__, ownerAbility->GetAbilityName().c_str()); + HILOG_INFO("%{public}s come, %{public}s.", __func__, ownerAbility->GetAbilityName().c_str()); ownerAbility->OnVisibilityChanged(formEventsMap); } while (false); @@ -270,7 +270,7 @@ int FormProviderClient::EventNotify( } else { // If errorCode is ERR_OK,return disconnectErrorCode. if (disconnectErrorCode != ERR_OK) { - APP_LOGE("%{public}s, disconnect error.", __func__); + HILOG_ERROR("%{public}s, disconnect error.", __func__); } return disconnectErrorCode; } @@ -288,23 +288,23 @@ int FormProviderClient::NotifyFormCastTempForm( const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); // The error code for business operation. int errorCode = ERR_OK; do { std::shared_ptr ownerAbility = GetOwner(); if (ownerAbility == nullptr) { - APP_LOGE("%{public}s error, ownerAbility is nullptr.", __func__); + HILOG_ERROR("%{public}s error, ownerAbility is nullptr.", __func__); errorCode = ERR_APPEXECFWK_FORM_NO_SUCH_ABILITY; break; } if (!CheckIsSystemApp()) { - APP_LOGW("%{public}s caller permission denied", __func__); + HILOG_WARN("%{public}s caller permission denied", __func__); errorCode = ERR_APPEXECFWK_FORM_PERMISSION_DENY; break; } - APP_LOGI("%{public}s come, %{public}s", __func__, ownerAbility->GetAbilityName().c_str()); + HILOG_INFO("%{public}s come, %{public}s", __func__, ownerAbility->GetAbilityName().c_str()); ownerAbility->OnCastTemptoNormal(formId); } while (false); @@ -316,7 +316,7 @@ int FormProviderClient::NotifyFormCastTempForm( } else { // If errorCode is ERR_OK,return disconnectErrorCode. if (disconnectErrorCode != ERR_OK) { - APP_LOGE("%{public}s, disconnect error.", __func__); + HILOG_ERROR("%{public}s, disconnect error.", __func__); } return disconnectErrorCode; } @@ -335,23 +335,23 @@ int FormProviderClient::FireFormEvent( const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); // The error code for business operation. int errorCode = ERR_OK; do { std::shared_ptr ownerAbility = GetOwner(); if (ownerAbility == nullptr) { - APP_LOGE("%{public}s error, ownerAbility is nullptr.", __func__); + HILOG_ERROR("%{public}s error, ownerAbility is nullptr.", __func__); errorCode = ERR_APPEXECFWK_FORM_NO_SUCH_ABILITY; break; } if (!CheckIsSystemApp()) { - APP_LOGW("%{public}s caller permission denied", __func__); + HILOG_WARN("%{public}s caller permission denied", __func__); errorCode = ERR_APPEXECFWK_FORM_PERMISSION_DENY; break; } - APP_LOGI("%{public}s come, %{public}s", __func__, ownerAbility->GetAbilityName().c_str()); + HILOG_INFO("%{public}s come, %{public}s", __func__, ownerAbility->GetAbilityName().c_str()); ownerAbility->OnTriggerEvent(formId, message); } while (false); @@ -363,7 +363,7 @@ int FormProviderClient::FireFormEvent( } else { // If errorCode is ERR_OK,return disconnectErrorCode. if (disconnectErrorCode != ERR_OK) { - APP_LOGE("%{public}s, disconnect error.", __func__); + HILOG_ERROR("%{public}s, disconnect error.", __func__); } return disconnectErrorCode; } @@ -421,15 +421,15 @@ std::shared_ptr FormProviderClient::GetOwner() bool FormProviderClient::CheckIsSystemApp() const { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int32_t callingUid = IPCSkeleton::GetCallingUid(); if (callingUid > Constants::MAX_SYSTEM_APP_UID) { - APP_LOGW("%{public}s warn, callingUid is %{public}d, which is larger than %{public}d.", __func__, callingUid, + HILOG_WARN("%{public}s warn, callingUid is %{public}d, which is larger than %{public}d.", __func__, callingUid, Constants::MAX_SYSTEM_APP_UID); return false; } else { - APP_LOGD("%{public}s, callingUid = %{public}d.", __func__, callingUid); + HILOG_DEBUG("%{public}s, callingUid = %{public}d.", __func__, callingUid); return true; } } @@ -439,16 +439,16 @@ int FormProviderClient::HandleAcquire( const Want &newWant, const sptr &callerToken) { - APP_LOGI("%{public}s start, image state is %{public}d", + HILOG_INFO("%{public}s start, image state is %{public}d", __func__, formProviderInfo.GetFormData().GetImageDataState()); sptr formSupplyClient = iface_cast(callerToken); if (formSupplyClient == nullptr) { - APP_LOGW("%{public}s warn, IFormSupply is nullptr", __func__); + HILOG_WARN("%{public}s warn, IFormSupply is nullptr", __func__); return ERR_APPEXECFWK_FORM_BIND_PROVIDER_FAILED; } formSupplyClient->OnAcquire(formProviderInfo, newWant); - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return ERR_OK; } @@ -456,11 +456,11 @@ int FormProviderClient::HandleDisconnect(const Want &want, const sptr formSupplyClient = iface_cast(callerToken); if (formSupplyClient == nullptr) { - APP_LOGW("%{public}s warn, IFormSupply is nullptr", __func__); + HILOG_WARN("%{public}s warn, IFormSupply is nullptr", __func__); return ERR_APPEXECFWK_FORM_BIND_PROVIDER_FAILED; } - APP_LOGD("%{public}s come, connectId: %{public}ld.", __func__, + HILOG_DEBUG("%{public}s come, connectId: %{public}ld.", __func__, want.GetLongParam(Constants::FORM_CONNECT_ID, 0L)); formSupplyClient->OnEventHandle(want); diff --git a/frameworks/kits/ability/native/src/form_runtime/form_extension_provider_client.cpp b/frameworks/kits/ability/native/src/form_runtime/form_extension_provider_client.cpp index 5c67e16a9c..9f6333788c 100644 --- a/frameworks/kits/ability/native/src/form_runtime/form_extension_provider_client.cpp +++ b/frameworks/kits/ability/native/src/form_runtime/form_extension_provider_client.cpp @@ -17,12 +17,12 @@ #include "string_ex.h" -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" #include "event_handler.h" #include "event_runner.h" #include "form_extension.h" #include "form_supply_proxy.h" +#include "hilog_wrapper.h" #include "ipc_skeleton.h" #include "permission/permission.h" #include "permission/permission_kit.h" @@ -41,10 +41,10 @@ using namespace OHOS::AppExecFwk; int FormExtensionProviderClient::AcquireProviderFormInfo(const int64_t formId, const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); sptr formSupplyClient = iface_cast(callerToken); if (formSupplyClient == nullptr) { - APP_LOGW("%{public}s warn, IFormSupply is nullptr", __func__); + HILOG_WARN("%{public}s warn, IFormSupply is nullptr", __func__); return ERR_APPEXECFWK_FORM_BIND_PROVIDER_FAILED; } @@ -56,7 +56,7 @@ int FormExtensionProviderClient::AcquireProviderFormInfo(const int64_t formId, c connectWant.SetParam(Constants::PARAM_FORM_IDENTITY_KEY, std::to_string(formId)); if (!FormProviderClient::CheckIsSystemApp()) { - APP_LOGW("%{public}s warn, AcquireProviderFormInfo caller permission denied.", __func__); + HILOG_WARN("%{public}s warn, AcquireProviderFormInfo caller permission denied.", __func__); FormProviderInfo formProviderInfo; connectWant.SetParam(Constants::PROVIDER_FLAG, ERR_APPEXECFWK_FORM_PERMISSION_DENY); return FormProviderClient::HandleAcquire(formProviderInfo, connectWant, callerToken); @@ -74,7 +74,7 @@ int FormExtensionProviderClient::AcquireProviderFormInfo(const int64_t formId, c void FormExtensionProviderClient::AcquireFormExtensionProviderInfo(const int64_t formId, const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); Want connectWant(want); connectWant.SetParam(Constants::ACQUIRE_TYPE, want.GetIntParam(Constants::ACQUIRE_TYPE, 0)); connectWant.SetParam(Constants::FORM_CONNECT_ID, want.GetLongParam(Constants::FORM_CONNECT_ID, 0)); @@ -85,7 +85,7 @@ void FormExtensionProviderClient::AcquireFormExtensionProviderInfo(const int64_t FormProviderInfo formProviderInfo; std::shared_ptr ownerFormExtension = GetOwner(); if (ownerFormExtension == nullptr) { - APP_LOGE("%{public}s error, ownerFormExtension is nullptr.", __func__); + HILOG_ERROR("%{public}s error, ownerFormExtension is nullptr.", __func__); connectWant.SetParam(Constants::PROVIDER_FLAG, ERR_APPEXECFWK_FORM_NO_SUCH_ABILITY); } else { Want createWant(want); @@ -96,17 +96,17 @@ void FormExtensionProviderClient::AcquireFormExtensionProviderInfo(const int64_t createWant.SetElement(want.GetElement()); formProviderInfo = ownerFormExtension->OnCreate(createWant); - APP_LOGD("%{public}s, formId: %{public}s, data: %{public}s", + HILOG_DEBUG("%{public}s, formId: %{public}s, data: %{public}s", __func__, createWant.GetStringParam(Constants::PARAM_FORM_IDENTITY_KEY).c_str(), formProviderInfo.GetFormDataString().c_str()); } int error = FormProviderClient::HandleAcquire(formProviderInfo, connectWant, callerToken); if (error != ERR_OK) { - APP_LOGE("%{public}s HandleAcquire failed", __func__); + HILOG_ERROR("%{public}s HandleAcquire failed", __func__); HandleResultCode(error, connectWant, callerToken); } - APP_LOGI("%{public}s called end.", __func__); + HILOG_INFO("%{public}s called end.", __func__); } /** @@ -119,10 +119,10 @@ void FormExtensionProviderClient::AcquireFormExtensionProviderInfo(const int64_t int FormExtensionProviderClient::NotifyFormDelete(const int64_t formId, const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::pair errorCode = CheckParam(want, callerToken); if (errorCode.first != ERR_OK) { - APP_LOGE("%{public}s CheckParam failed", __func__); + HILOG_ERROR("%{public}s CheckParam failed", __func__); return errorCode.second; } @@ -138,18 +138,18 @@ int FormExtensionProviderClient::NotifyFormDelete(const int64_t formId, const Wa void FormExtensionProviderClient::NotifyFormExtensionDelete(const int64_t formId, const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errorCode = ERR_OK; std::shared_ptr ownerFormExtension = GetOwner(); if (ownerFormExtension == nullptr) { - APP_LOGE("%{public}s error, ownerFormExtension is nullptr.", __func__); + HILOG_ERROR("%{public}s error, ownerFormExtension is nullptr.", __func__); errorCode = ERR_APPEXECFWK_FORM_NO_SUCH_ABILITY; } else { ownerFormExtension->OnDestroy(formId); } HandleResultCode(errorCode, want, callerToken); - APP_LOGI("%{public}s called end.", __func__); + HILOG_INFO("%{public}s called end.", __func__); } /** @@ -163,10 +163,10 @@ void FormExtensionProviderClient::NotifyFormExtensionDelete(const int64_t formId int FormExtensionProviderClient::NotifyFormsDelete(const std::vector &formIds, const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::pair errorCode = CheckParam(want, callerToken); if (errorCode.first != ERR_OK) { - APP_LOGE("%{public}s CheckParam failed", __func__); + HILOG_ERROR("%{public}s CheckParam failed", __func__); return errorCode.second; } @@ -182,11 +182,11 @@ int FormExtensionProviderClient::NotifyFormsDelete(const std::vector &f void FormExtensionProviderClient::NotifyFormExtensionsDelete(const std::vector &formIds, const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errorCode = ERR_OK; std::shared_ptr ownerFormExtension = GetOwner(); if (ownerFormExtension == nullptr) { - APP_LOGE("%{public}s error, ownerFormExtension is nullptr.", __func__); + HILOG_ERROR("%{public}s error, ownerFormExtension is nullptr.", __func__); errorCode = ERR_APPEXECFWK_FORM_NO_SUCH_ABILITY; } else { for (int64_t formId : formIds) { @@ -195,7 +195,7 @@ void FormExtensionProviderClient::NotifyFormExtensionsDelete(const std::vector &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::pair errorCode = CheckParam(want, callerToken); if (errorCode.first != ERR_OK) { - APP_LOGE("%{public}s CheckParam failed", __func__); + HILOG_ERROR("%{public}s CheckParam failed", __func__); return errorCode.second; } @@ -228,18 +228,18 @@ int FormExtensionProviderClient::NotifyFormUpdate(const int64_t formId, const Wa void FormExtensionProviderClient::NotifyFormExtensionUpdate(const int64_t formId, const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errorCode = ERR_OK; std::shared_ptr ownerFormExtension = GetOwner(); if (ownerFormExtension == nullptr) { - APP_LOGE("%{public}s error, ownerFormExtension is nullptr.", __func__); + HILOG_ERROR("%{public}s error, ownerFormExtension is nullptr.", __func__); errorCode = ERR_APPEXECFWK_FORM_NO_SUCH_ABILITY; } else { ownerFormExtension->OnUpdate(formId); } HandleResultCode(errorCode, want, callerToken); - APP_LOGI("%{public}s called end.", __func__); + HILOG_INFO("%{public}s called end.", __func__); } /** @@ -254,10 +254,10 @@ void FormExtensionProviderClient::NotifyFormExtensionUpdate(const int64_t formId int FormExtensionProviderClient::EventNotify(const std::vector &formIds, const int32_t formVisibleType, const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::pair errorCode = CheckParam(want, callerToken); if (errorCode.first != ERR_OK) { - APP_LOGE("%{public}s CheckParam failed", __func__); + HILOG_ERROR("%{public}s CheckParam failed", __func__); return errorCode.second; } @@ -273,11 +273,11 @@ int FormExtensionProviderClient::EventNotify(const std::vector &formIds void FormExtensionProviderClient::EventNotifyExtension(const std::vector &formIds, const int32_t formVisibleType, const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errorCode = ERR_OK; std::shared_ptr ownerFormExtension = GetOwner(); if (ownerFormExtension == nullptr) { - APP_LOGE("%{public}s error, ownerFormExtension is nullptr.", __func__); + HILOG_ERROR("%{public}s error, ownerFormExtension is nullptr.", __func__); errorCode = ERR_APPEXECFWK_FORM_NO_SUCH_ABILITY; } else { std::map formEventsMap; @@ -288,7 +288,7 @@ void FormExtensionProviderClient::EventNotifyExtension(const std::vector &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::pair errorCode = CheckParam(want, callerToken); if (errorCode.first != ERR_OK) { - APP_LOGE("%{public}s CheckParam failed", __func__); + HILOG_ERROR("%{public}s CheckParam failed", __func__); return errorCode.second; } @@ -320,18 +320,18 @@ int FormExtensionProviderClient::NotifyFormCastTempForm(const int64_t formId, co void FormExtensionProviderClient::NotifyFormExtensionCastTempForm(const int64_t formId, const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errorCode = ERR_OK; std::shared_ptr ownerFormExtension = GetOwner(); if (ownerFormExtension == nullptr) { - APP_LOGE("%{public}s error, ownerFormExtension is nullptr.", __func__); + HILOG_ERROR("%{public}s error, ownerFormExtension is nullptr.", __func__); errorCode = ERR_APPEXECFWK_FORM_NO_SUCH_ABILITY; } else { ownerFormExtension->OnCastToNormal(formId); } HandleResultCode(errorCode, want, callerToken); - APP_LOGI("%{public}s called end.", __func__); + HILOG_INFO("%{public}s called end.", __func__); } /** @@ -345,10 +345,10 @@ void FormExtensionProviderClient::NotifyFormExtensionCastTempForm(const int64_t int FormExtensionProviderClient::FireFormEvent(const int64_t formId, const std::string &message, const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::pair errorCode = CheckParam(want, callerToken); if (errorCode.first != ERR_OK) { - APP_LOGE("%{public}s CheckParam failed", __func__); + HILOG_ERROR("%{public}s CheckParam failed", __func__); return errorCode.second; } @@ -364,18 +364,18 @@ int FormExtensionProviderClient::FireFormEvent(const int64_t formId, const std:: void FormExtensionProviderClient::FireFormExtensionEvent(const int64_t formId, const std::string &message, const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errorCode = ERR_OK; std::shared_ptr ownerFormExtension = GetOwner(); if (ownerFormExtension == nullptr) { - APP_LOGE("%{public}s error, ownerFormExtension is nullptr.", __func__); + HILOG_ERROR("%{public}s error, ownerFormExtension is nullptr.", __func__); errorCode = ERR_APPEXECFWK_FORM_NO_SUCH_ABILITY; } else { ownerFormExtension->OnEvent(formId, message); } HandleResultCode(errorCode, want, callerToken); - APP_LOGI("%{public}s called end.", __func__); + HILOG_INFO("%{public}s called end.", __func__); } /** @@ -386,7 +386,7 @@ void FormExtensionProviderClient::FireFormExtensionEvent(const int64_t formId, c void FormExtensionProviderClient::SetOwner(const std::shared_ptr formExtension) { if (formExtension == nullptr) { - APP_LOGE("%{public}s error, SetOwner::formExtension is nullptr.", __func__); + HILOG_ERROR("%{public}s error, SetOwner::formExtension is nullptr.", __func__); return; } @@ -404,7 +404,7 @@ void FormExtensionProviderClient::SetOwner(const std::shared_ptr void FormExtensionProviderClient::ClearOwner(const std::shared_ptr formExtension) { if (formExtension == nullptr) { - APP_LOGE("%{public}s error, ClearOwner::formExtension is nullptr.", __func__); + HILOG_ERROR("%{public}s error, ClearOwner::formExtension is nullptr.", __func__); return; } @@ -438,7 +438,7 @@ int FormExtensionProviderClient::HandleResultCode(int errorCode, const Want &wan } else { // If errorCode is ERR_OK return disconnectErrorCode. if (disconnectErrorCode != ERR_OK) { - APP_LOGE("%{public}s, disconnect error.", __func__); + HILOG_ERROR("%{public}s, disconnect error.", __func__); } return disconnectErrorCode; } @@ -448,11 +448,11 @@ std::pair FormExtensionProviderClient::CheckParam(const Want &want, co { sptr formSupplyClient = iface_cast(callerToken); if (formSupplyClient == nullptr) { - APP_LOGE("%{public}s warn, IFormSupply is nullptr", __func__); + HILOG_ERROR("%{public}s warn, IFormSupply is nullptr", __func__); return std::pair(ERR_APPEXECFWK_FORM_BIND_PROVIDER_FAILED, ERR_APPEXECFWK_FORM_BIND_PROVIDER_FAILED); } if (!FormProviderClient::CheckIsSystemApp()) { - APP_LOGE("%{public}s warn, caller permission denied.", __func__); + HILOG_ERROR("%{public}s warn, caller permission denied.", __func__); int errorCode = HandleResultCode(ERR_APPEXECFWK_FORM_PERMISSION_DENY, want, callerToken); return std::pair(ERR_APPEXECFWK_FORM_PERMISSION_DENY, errorCode); } diff --git a/frameworks/kits/ability/native/src/new_ability_impl.cpp b/frameworks/kits/ability/native/src/new_ability_impl.cpp index 0fc4d7d53f..1e46083a9b 100644 --- a/frameworks/kits/ability/native/src/new_ability_impl.cpp +++ b/frameworks/kits/ability/native/src/new_ability_impl.cpp @@ -14,7 +14,7 @@ */ #include "new_ability_impl.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -29,7 +29,7 @@ using AbilityManagerClient = OHOS::AAFwk::AbilityManagerClient; void NewAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::LifeCycleStateInfo &targetState) { - APP_LOGI("NewAbilityImpl::HandleAbilityTransaction begin sourceState:%{public}d; targetState: %{public}d; " + HILOG_INFO("NewAbilityImpl::HandleAbilityTransaction begin sourceState:%{public}d; targetState: %{public}d; " "isNewWant: %{public}d, sceneFlag: %{public}d", lifecycleState_, targetState.state, @@ -39,7 +39,7 @@ void NewAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::Lif if (ability_ != nullptr && targetState.state == AAFwk::ABILITY_STATE_FOREGROUND_NEW) { ability_->RequsetFocus(want); } - APP_LOGE("Org lifeCycleState equals to Dst lifeCycleState."); + HILOG_ERROR("Org lifeCycleState equals to Dst lifeCycleState."); return; } @@ -58,11 +58,11 @@ void NewAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::Lif bool ret = false; ret = AbilityTransaction(want, targetState); if (ret) { - APP_LOGI("AbilityThread::HandleAbilityTransaction before AbilityManagerClient->AbilityTransitionDone"); + HILOG_INFO("AbilityThread::HandleAbilityTransaction before AbilityManagerClient->AbilityTransitionDone"); AbilityManagerClient::GetInstance()->AbilityTransitionDone(token_, targetState.state, GetRestoreData()); - APP_LOGI("AbilityThread::HandleAbilityTransaction after AbilityManagerClient->AbilityTransitionDone"); + HILOG_INFO("AbilityThread::HandleAbilityTransaction after AbilityManagerClient->AbilityTransitionDone"); } - APP_LOGI("NewAbilityImpl::HandleAbilityTransaction end"); + HILOG_INFO("NewAbilityImpl::HandleAbilityTransaction end"); } /** @@ -76,7 +76,7 @@ void NewAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::Lif */ bool NewAbilityImpl::AbilityTransaction(const Want &want, const AAFwk::LifeCycleStateInfo &targetState) { - APP_LOGI("NewAbilityImpl::AbilityTransaction begin"); + HILOG_INFO("NewAbilityImpl::AbilityTransaction begin"); bool ret = true; switch (targetState.state) { case AAFwk::ABILITY_STATE_INITIAL: { @@ -103,11 +103,11 @@ bool NewAbilityImpl::AbilityTransaction(const Want &want, const AAFwk::LifeCycle } default: { ret = false; - APP_LOGE("NewAbilityImpl::HandleAbilityTransaction state error"); + HILOG_ERROR("NewAbilityImpl::HandleAbilityTransaction state error"); break; } } - APP_LOGI("NewAbilityImpl::AbilityTransaction end: retVal = %{public}d", (int)ret); + HILOG_INFO("NewAbilityImpl::AbilityTransaction end: retVal = %{public}d", (int)ret); return ret; } } // namespace AppExecFwk diff --git a/frameworks/kits/ability/native/src/page_ability_impl.cpp b/frameworks/kits/ability/native/src/page_ability_impl.cpp index 961011ebeb..594c105c23 100644 --- a/frameworks/kits/ability/native/src/page_ability_impl.cpp +++ b/frameworks/kits/ability/native/src/page_ability_impl.cpp @@ -14,7 +14,7 @@ */ #include "page_ability_impl.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -29,7 +29,7 @@ using AbilityManagerClient = OHOS::AAFwk::AbilityManagerClient; void PageAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::LifeCycleStateInfo &targetState) { AbilityImpl::SetUseNewMission(targetState.useNewMission); - APP_LOGI("PageAbilityImpl::HandleAbilityTransaction begin sourceState:%{public}d; targetState: %{public}d; " + HILOG_INFO("PageAbilityImpl::HandleAbilityTransaction begin sourceState:%{public}d; targetState: %{public}d; " "isNewWant: %{public}d, sceneFlag: %{public}d", lifecycleState_, targetState.state, @@ -39,7 +39,7 @@ void PageAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::Li if (ability_ != nullptr && targetState.state == AAFwk::ABILITY_STATE_FOREGROUND_NEW) { ability_->RequsetFocus(want); } - APP_LOGE("Org lifeCycleState equals to Dst lifeCycleState."); + HILOG_ERROR("Org lifeCycleState equals to Dst lifeCycleState."); return; } @@ -70,11 +70,11 @@ void PageAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::Li ret = AbilityTransaction(want, targetState); } if (ret) { - APP_LOGI("AbilityThread::HandleAbilityTransaction before AbilityManagerClient->AbilityTransitionDone"); + HILOG_INFO("AbilityThread::HandleAbilityTransaction before AbilityManagerClient->AbilityTransitionDone"); AbilityManagerClient::GetInstance()->AbilityTransitionDone(token_, targetState.state, GetRestoreData()); - APP_LOGI("AbilityThread::HandleAbilityTransaction after AbilityManagerClient->AbilityTransitionDone"); + HILOG_INFO("AbilityThread::HandleAbilityTransaction after AbilityManagerClient->AbilityTransitionDone"); } - APP_LOGI("PageAbilityImpl::HandleAbilityTransaction end"); + HILOG_INFO("PageAbilityImpl::HandleAbilityTransaction end"); } /** @@ -88,7 +88,7 @@ void PageAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::Li */ bool PageAbilityImpl::AbilityTransaction(const Want &want, const AAFwk::LifeCycleStateInfo &targetState) { - APP_LOGI("PageAbilityImpl::AbilityTransaction begin"); + HILOG_INFO("PageAbilityImpl::AbilityTransaction begin"); bool ret = true; switch (targetState.state) { case AAFwk::ABILITY_STATE_INITIAL: { @@ -124,11 +124,11 @@ bool PageAbilityImpl::AbilityTransaction(const Want &want, const AAFwk::LifeCycl } default: { ret = false; - APP_LOGE("PageAbilityImpl::HandleAbilityTransaction state error"); + HILOG_ERROR("PageAbilityImpl::HandleAbilityTransaction state error"); break; } } - APP_LOGI("PageAbilityImpl::AbilityTransaction end: retVal = %{public}d", (int)ret); + HILOG_INFO("PageAbilityImpl::AbilityTransaction end: retVal = %{public}d", (int)ret); return ret; } @@ -143,7 +143,7 @@ bool PageAbilityImpl::AbilityTransaction(const Want &want, const AAFwk::LifeCycl */ bool PageAbilityImpl::AbilityTransactionNew(const Want &want, const AAFwk::LifeCycleStateInfo &targetState) { - APP_LOGI("PageAbilityImpl::AbilityTransaction begin"); + HILOG_INFO("PageAbilityImpl::AbilityTransaction begin"); bool ret = true; switch (targetState.state) { case AAFwk::ABILITY_STATE_INITIAL: { @@ -175,11 +175,11 @@ bool PageAbilityImpl::AbilityTransactionNew(const Want &want, const AAFwk::LifeC } default: { ret = false; - APP_LOGE("PageAbilityImpl::HandleAbilityTransaction state error"); + HILOG_ERROR("PageAbilityImpl::HandleAbilityTransaction state error"); break; } } - APP_LOGI("PageAbilityImpl::AbilityTransaction end: retVal = %{public}d", (int)ret); + HILOG_INFO("PageAbilityImpl::AbilityTransaction end: retVal = %{public}d", (int)ret); return ret; } @@ -193,18 +193,18 @@ bool PageAbilityImpl::AbilityTransactionNew(const Want &want, const AAFwk::LifeC */ void PageAbilityImpl::DoKeyDown(const std::shared_ptr& keyEvent) { - APP_LOGI("PageAbilityImpl::DoKeyDown begin"); + HILOG_INFO("PageAbilityImpl::DoKeyDown begin"); if (ability_ == nullptr) { - APP_LOGE("PageAbilityImpl::DoKeyDown ability_ == nullptr"); + HILOG_ERROR("PageAbilityImpl::DoKeyDown ability_ == nullptr"); return; } auto abilitInfo = ability_->GetAbilityInfo(); - APP_LOGI("PageAbilityImpl::DoKeyDown called %{public}s And Focus is %{public}s", + HILOG_INFO("PageAbilityImpl::DoKeyDown called %{public}s And Focus is %{public}s", abilitInfo->name.c_str(), ability_->HasWindowFocus() ? "true" : "false"); ability_->OnKeyDown(keyEvent); - APP_LOGI("PageAbilityImpl::DoKeyDown end"); + HILOG_INFO("PageAbilityImpl::DoKeyDown end"); } /** @@ -217,18 +217,18 @@ void PageAbilityImpl::DoKeyDown(const std::shared_ptr& keyEvent) */ void PageAbilityImpl::DoKeyUp(const std::shared_ptr& keyEvent) { - APP_LOGI("PageAbilityImpl::DoKeyUp begin"); + HILOG_INFO("PageAbilityImpl::DoKeyUp begin"); if (ability_ == nullptr) { - APP_LOGE("PageAbilityImpl::DoKeyUp ability_ == nullptr"); + HILOG_ERROR("PageAbilityImpl::DoKeyUp ability_ == nullptr"); return; } auto abilitInfo = ability_->GetAbilityInfo(); - APP_LOGI("PageAbilityImpl::DoKeyUp called %{public}s And Focus is %{public}s", + HILOG_INFO("PageAbilityImpl::DoKeyUp called %{public}s And Focus is %{public}s", abilitInfo->name.c_str(), ability_->HasWindowFocus() ? "true" : "false"); ability_->OnKeyUp(keyEvent); - APP_LOGI("PageAbilityImpl::DoKeyUp end"); + HILOG_INFO("PageAbilityImpl::DoKeyUp end"); } /** @@ -241,18 +241,18 @@ void PageAbilityImpl::DoKeyUp(const std::shared_ptr& keyEvent) */ void PageAbilityImpl::DoPointerEvent(std::shared_ptr& pointerEvent) { - APP_LOGI("PageAbilityImpl::DoPointerEvent begin"); + HILOG_INFO("PageAbilityImpl::DoPointerEvent begin"); if (ability_ == nullptr) { - APP_LOGE("PageAbilityImpl::DoPointerEvent ability_ == nullptr"); + HILOG_ERROR("PageAbilityImpl::DoPointerEvent ability_ == nullptr"); return; } auto abilitInfo = ability_->GetAbilityInfo(); - APP_LOGI("PageAbilityImpl::DoPointerEvent called %{public}s And Focus is %{public}s", + HILOG_INFO("PageAbilityImpl::DoPointerEvent called %{public}s And Focus is %{public}s", abilitInfo->name.c_str(), ability_->HasWindowFocus() ? "true" : "false"); ability_->OnPointerEvent(pointerEvent); - APP_LOGI("PageAbilityImpl::DoPointerEvent end"); + HILOG_INFO("PageAbilityImpl::DoPointerEvent end"); } } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file diff --git a/frameworks/kits/ability/native/src/service_ability_impl.cpp b/frameworks/kits/ability/native/src/service_ability_impl.cpp index edeea0f948..868d5dab78 100644 --- a/frameworks/kits/ability/native/src/service_ability_impl.cpp +++ b/frameworks/kits/ability/native/src/service_ability_impl.cpp @@ -14,7 +14,7 @@ */ #include "service_ability_impl.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -28,13 +28,13 @@ using AbilityManagerClient = OHOS::AAFwk::AbilityManagerClient; */ void ServiceAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::LifeCycleStateInfo &targetState) { - APP_LOGI("ServiceAbilityImpl::HandleAbilityTransaction begin sourceState:%{public}d; targetState: %{public}d; " + HILOG_INFO("ServiceAbilityImpl::HandleAbilityTransaction begin sourceState:%{public}d; targetState: %{public}d; " "isNewWant: %{public}d", lifecycleState_, targetState.state, targetState.isNewWant); if (lifecycleState_ == targetState.state) { - APP_LOGE("Org lifeCycleState equals to Dst lifeCycleState."); + HILOG_ERROR("Org lifeCycleState equals to Dst lifeCycleState."); return; } @@ -58,17 +58,17 @@ void ServiceAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk: } default: { ret = false; - APP_LOGE("ServiceAbilityImpl::HandleAbilityTransaction state is error"); + HILOG_ERROR("ServiceAbilityImpl::HandleAbilityTransaction state is error"); break; } } if (ret) { - APP_LOGI("ServiceAbilityImpl::HandleAbilityTransaction before AbilityManagerClient->AbilityTransitionDone"); + HILOG_INFO("ServiceAbilityImpl::HandleAbilityTransaction before AbilityManagerClient->AbilityTransitionDone"); AbilityManagerClient::GetInstance()->AbilityTransitionDone(token_, targetState.state, GetRestoreData()); - APP_LOGI("ServiceAbilityImpl::HandleAbilityTransaction after AbilityManagerClient->AbilityTransitionDone"); + HILOG_INFO("ServiceAbilityImpl::HandleAbilityTransaction after AbilityManagerClient->AbilityTransitionDone"); } - APP_LOGI("ServiceAbilityImpl::HandleAbilityTransaction end"); + HILOG_INFO("ServiceAbilityImpl::HandleAbilityTransaction end"); } } // namespace AppExecFwk } // namespace OHOS diff --git a/frameworks/kits/ability/native/src/task_handler_client.cpp b/frameworks/kits/ability/native/src/task_handler_client.cpp index ab05faaeef..7d5aecbf09 100644 --- a/frameworks/kits/ability/native/src/task_handler_client.cpp +++ b/frameworks/kits/ability/native/src/task_handler_client.cpp @@ -14,7 +14,6 @@ */ #include "task_handler_client.h" -#include "app_log_wrapper.h" #include "hilog_wrapper.h" namespace OHOS { @@ -41,18 +40,18 @@ TaskHandlerClient::~TaskHandlerClient() bool TaskHandlerClient::PostTask(std::function task, long delayTime) { - APP_LOGI("TaskHandlerClient::PostTask called"); + HILOG_INFO("TaskHandlerClient::PostTask called"); if (taskHandler_ == nullptr) { if (!CreateRunner()) { - APP_LOGE("TaskHandlerClient::PostTask failed, CreateRunner failed"); + HILOG_ERROR("TaskHandlerClient::PostTask failed, CreateRunner failed"); return false; } } bool ret = taskHandler_->PostTask(task, delayTime, EventQueue::Priority::LOW); if (!ret) { - APP_LOGE("TaskHandlerClient::PostTask failed, taskHandler_ PostTask failed"); + HILOG_ERROR("TaskHandlerClient::PostTask failed, taskHandler_ PostTask failed"); } return ret; } @@ -62,12 +61,12 @@ bool TaskHandlerClient::CreateRunner() if (taskHandler_ == nullptr) { std::shared_ptr runner = EventRunner::Create("TaskRunner"); if (runner == nullptr) { - APP_LOGE("TaskHandlerClient::CreateRunner failed, runner is nullptr"); + HILOG_ERROR("TaskHandlerClient::CreateRunner failed, runner is nullptr"); return false; } taskHandler_ = std::make_shared(runner); if (taskHandler_ == nullptr) { - APP_LOGE("TaskHandlerClient::CreateRunner failed, taskHandler_ is nullptr"); + HILOG_ERROR("TaskHandlerClient::CreateRunner failed, taskHandler_ is nullptr"); return false; } } diff --git a/frameworks/kits/ability/native/test/BUILD.gn b/frameworks/kits/ability/native/test/BUILD.gn index e858899b9c..ee461537d5 100644 --- a/frameworks/kits/ability/native/test/BUILD.gn +++ b/frameworks/kits/ability/native/test/BUILD.gn @@ -51,8 +51,8 @@ config("module_private_config") { cflags += [ "-DBINDER_IPC_32BIT" ] } defines = [ - "APP_LOG_TAG = \"AbilityUnitTest\"", - "LOG_DOMAIN = 0xD002201", + "AMS_LOG_TAG = \"AbilityUnitTest\"", + "AMS_LOG_DOMAIN = 0xD002201", ] } @@ -81,8 +81,8 @@ config("module_ability_context_config") { cflags += [ "-DBINDER_IPC_32BIT" ] } defines = [ - "APP_LOG_TAG = \"AbilityUnitTest\"", - "LOG_DOMAIN = 0xD002201", + "AMS_LOG_TAG = \"AbilityUnitTest\"", + "AMS_LOG_DOMAIN = 0xD002201", ] } @@ -533,6 +533,7 @@ ohos_unittest("ability_impl_test") { ] external_deps = [ + "ability_base:configuration", "ability_runtime:runtime", "bundle_framework:appexecfwk_core", "hiviewdfx_hilog_native:libhilog", @@ -861,8 +862,8 @@ config("data_uri_utils_test_config") { cflags += [ "-DBINDER_IPC_32BIT" ] } defines = [ - "APP_LOG_TAG = \"AbilityUnitTest\"", - "LOG_DOMAIN = 0xD002201", + "AMS_LOG_TAG = \"AbilityUnitTest\"", + "AMS_LOG_DOMAIN = 0xD002201", ] } ohos_unittest("data_uri_utils_test") { diff --git a/frameworks/kits/ability/native/test/mock/include/mock_ability.cpp b/frameworks/kits/ability/native/test/mock/include/mock_ability.cpp index 61b0a03e70..d67a31036b 100644 --- a/frameworks/kits/ability/native/test/mock/include/mock_ability.cpp +++ b/frameworks/kits/ability/native/test/mock/include/mock_ability.cpp @@ -16,7 +16,7 @@ #include "ability.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "iservice_registry.h" #include "system_ability_definition.h" @@ -27,7 +27,7 @@ REGISTER_AA(Ability) void Ability::Init(std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("Ability::Init called."); + HILOG_INFO("Ability::Init called."); abilityInfo_ = abilityInfo; handler_ = handler; @@ -143,11 +143,11 @@ void Ability::SetUIContent(int layoutRes, std::shared_ptr &context, int void Ability::SetUIContent(const WindowConfig &config) { if (abilityWindow_ == nullptr) { - APP_LOGE("Ability::SetUIContent abilityWindow_ is nullptr"); + HILOG_ERROR("Ability::SetUIContent abilityWindow_ is nullptr"); return; } - APP_LOGI("Ability::SetUIContent called"); + HILOG_INFO("Ability::SetUIContent called"); abilityWindow_->SetWindowConfig(config); } @@ -158,7 +158,7 @@ void Ability::SetUIContent(const WindowConfig &config) */ std::unique_ptr &Ability::GetWindow(int windowID) { - APP_LOGI("Ability::GetWindow called windowID = %d.", windowID); + HILOG_INFO("Ability::GetWindow called windowID = %d.", windowID); return abilityWindow_->GetWindow(windowID); } @@ -247,17 +247,17 @@ void Ability::OnBackPressed() void Ability::OnNewWant(const Want &want) { - APP_LOGI("Ability::OnNewWant called"); + HILOG_INFO("Ability::OnNewWant called"); } void Ability::OnRestoreAbilityState(const PacMap &inState) { - APP_LOGI("Ability::OnRestoreAbilityState called"); + HILOG_INFO("Ability::OnRestoreAbilityState called"); } void Ability::OnSaveAbilityState(const PacMap &outState) { - APP_LOGI("Ability::OnSaveAbilityState called"); + HILOG_INFO("Ability::OnSaveAbilityState called"); } void Ability::OnEventDispatch() @@ -283,10 +283,10 @@ std::shared_ptr Ability::GetWant() void Ability::SetResult(int resultCode, const Want &resultData) { if (abilityInfo_ == nullptr) { - APP_LOGI("Ability::SetResult nullptr == abilityInfo_"); + HILOG_INFO("Ability::SetResult nullptr == abilityInfo_"); return; } - APP_LOGI("Ability::SetResult called type = %{public}d", abilityInfo_->type); + HILOG_INFO("Ability::SetResult called type = %{public}d", abilityInfo_->type); if (abilityInfo_->type == AppExecFwk::AbilityType::PAGE) { AbilityContext::resultWant_ = resultData; AbilityContext::resultCode_ = resultCode; @@ -387,16 +387,16 @@ std::shared_ptr Ability::DenormalizeUri(const Uri &uri) std::shared_ptr Ability::GetLifecycle() { - APP_LOGI("Ability::GetLifecycle called"); + HILOG_INFO("Ability::GetLifecycle called"); return lifecycle_; } AbilityLifecycleExecutor::LifecycleState Ability::GetState() { - APP_LOGI("Ability::GetState called"); + HILOG_INFO("Ability::GetState called"); if (abilityLifecycleExecutor_ == nullptr) { - APP_LOGI("Ability::GetState error. abilityLifecycleExecutor_ == nullptr."); + HILOG_INFO("Ability::GetState error. abilityLifecycleExecutor_ == nullptr."); return AbilityLifecycleExecutor::LifecycleState::UNINITIALIZED; } @@ -405,13 +405,13 @@ AbilityLifecycleExecutor::LifecycleState Ability::GetState() void Ability::StartAbility(const Want &want) { - APP_LOGI("Ability::StartAbility called"); + HILOG_INFO("Ability::StartAbility called"); AbilityContext::StartAbility(want, -1); } void Ability::TerminateAbility() { - APP_LOGI("Ability::TerminateAbility called"); + HILOG_INFO("Ability::TerminateAbility called"); AbilityContext::TerminateAbility(); } diff --git a/frameworks/kits/ability/native/test/mock/include/mock_ability_manager_client.h b/frameworks/kits/ability/native/test/mock/include/mock_ability_manager_client.h index c5d85822a2..6b5d704320 100755 --- a/frameworks/kits/ability/native/test/mock/include/mock_ability_manager_client.h +++ b/frameworks/kits/ability/native/test/mock/include/mock_ability_manager_client.h @@ -26,7 +26,7 @@ #include "ability_context.h" #include "ability_manager_interface.h" #include "ability_scheduler_interface.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "iremote_object.h" #include "iremote_stub.h" #include "want.h" diff --git a/frameworks/kits/ability/native/test/mock/include/mock_data_ability_impl.cpp b/frameworks/kits/ability/native/test/mock/include/mock_data_ability_impl.cpp index 3c71f4f14a..26cd1b9aeb 100644 --- a/frameworks/kits/ability/native/test/mock/include/mock_data_ability_impl.cpp +++ b/frameworks/kits/ability/native/test/mock/include/mock_data_ability_impl.cpp @@ -18,7 +18,7 @@ #include "values_bucket.h" #include "data_ability_impl.h" #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" const int returnValueOpenfile = 11; const int returnValueInsert = 22; diff --git a/frameworks/kits/ability/native/test/mock/include/mock_form_supply_callback.cpp b/frameworks/kits/ability/native/test/mock/include/mock_form_supply_callback.cpp index f0a0483442..a3df27f246 100644 --- a/frameworks/kits/ability/native/test/mock/include/mock_form_supply_callback.cpp +++ b/frameworks/kits/ability/native/test/mock/include/mock_form_supply_callback.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "mock_form_supply_callback.h" namespace OHOS { @@ -40,7 +40,7 @@ sptr MockFormSupplyCallback::GetInstance() */ int MockFormSupplyCallback::OnAcquire(const FormProviderInfo &formProviderInfo, const Want& want) { - APP_LOGI("MockFormSupplyCallback::OnAcquire called."); + HILOG_INFO("MockFormSupplyCallback::OnAcquire called."); return 1; } @@ -52,7 +52,7 @@ int MockFormSupplyCallback::OnAcquire(const FormProviderInfo &formProviderInfo, */ int MockFormSupplyCallback::OnEventHandle(const Want& want) { - APP_LOGI("MockFormSupplyCallback::OnEventHandle called."); + HILOG_INFO("MockFormSupplyCallback::OnEventHandle called."); return 1; } } // namespace AppExecFwk diff --git a/frameworks/kits/ability/native/test/mock/include/mock_replace_ability_impl.cpp b/frameworks/kits/ability/native/test/mock/include/mock_replace_ability_impl.cpp index 5edeb91b6d..80985695d7 100644 --- a/frameworks/kits/ability/native/test/mock/include/mock_replace_ability_impl.cpp +++ b/frameworks/kits/ability/native/test/mock/include/mock_replace_ability_impl.cpp @@ -16,7 +16,7 @@ #include "ability_impl.h" #include #include "ability_local_record.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -24,35 +24,35 @@ void AbilityImpl::Init(std::shared_ptr &application, const std: std::shared_ptr &ability, std::shared_ptr &handler, const sptr &token, std::shared_ptr &contextDeal) { - APP_LOGI("AbilityImpl::init begin"); + HILOG_INFO("AbilityImpl::init begin"); if (token == nullptr) { - APP_LOGE("AbilityImpl::init failed, token is nullptr"); + HILOG_ERROR("AbilityImpl::init failed, token is nullptr"); return; } if (application == nullptr) { - APP_LOGE("AbilityImpl::init failed, application is nullptr"); + HILOG_ERROR("AbilityImpl::init failed, application is nullptr"); return; } if (record == nullptr) { - APP_LOGE("AbilityImpl::init failed, record is nullptr"); + HILOG_ERROR("AbilityImpl::init failed, record is nullptr"); return; } if (ability == nullptr) { - APP_LOGE("AbilityImpl::init failed, ability is nullptr"); + HILOG_ERROR("AbilityImpl::init failed, ability is nullptr"); return; } if (token == nullptr) { - APP_LOGE("AbilityImpl::init failed, token is nullptr"); + HILOG_ERROR("AbilityImpl::init failed, token is nullptr"); return; } if (contextDeal == nullptr) { - APP_LOGE("AbilityImpl::init failed, contextDeal is nullptr"); + HILOG_ERROR("AbilityImpl::init failed, contextDeal is nullptr"); return; } @@ -63,7 +63,7 @@ void AbilityImpl::Init(std::shared_ptr &application, const std: lifecycleState_ = AAFwk::ABILITY_STATE_INITIAL; abilityLifecycleCallbacks_ = application; contextDeal_ = contextDeal; - APP_LOGI("AbilityImpl::init end"); + HILOG_INFO("AbilityImpl::init end"); } void AbilityImpl::Start(const Want &want) diff --git a/frameworks/kits/ability/native/test/unittest/ability_impl_active_test.cpp b/frameworks/kits/ability/native/test/unittest/ability_impl_active_test.cpp index b87da51fe0..ee3d97f04b 100644 --- a/frameworks/kits/ability/native/test/unittest/ability_impl_active_test.cpp +++ b/frameworks/kits/ability/native/test/unittest/ability_impl_active_test.cpp @@ -19,8 +19,8 @@ #include "ability.h" #include "ability_impl.h" #include "ability_state.h" -#include "app_log_wrapper.h" #include "context_deal.h" +#include "hilog_wrapper.h" #include "mock_ability_token.h" #include "ohos_application.h" #include "page_ability_impl.h" diff --git a/frameworks/kits/ability/native/test/unittest/ability_impl_test.cpp b/frameworks/kits/ability/native/test/unittest/ability_impl_test.cpp index c8e4d431c5..d91b995459 100644 --- a/frameworks/kits/ability/native/test/unittest/ability_impl_test.cpp +++ b/frameworks/kits/ability/native/test/unittest/ability_impl_test.cpp @@ -18,8 +18,8 @@ #include "ability_impl.h" #include "ability.h" #include "ability_state.h" -#include "app_log_wrapper.h" #include "context_deal.h" +#include "hilog_wrapper.h" #include "mock_ability_token.h" #include "mock_page_ability.h" #include "mock_ability_impl.h" diff --git a/frameworks/kits/ability/native/test/unittest/ability_thread_dataability_test.cpp b/frameworks/kits/ability/native/test/unittest/ability_thread_dataability_test.cpp index 125b48e906..67cb35e2cc 100644 --- a/frameworks/kits/ability/native/test/unittest/ability_thread_dataability_test.cpp +++ b/frameworks/kits/ability/native/test/unittest/ability_thread_dataability_test.cpp @@ -18,11 +18,11 @@ #include "ability_thread.h" #include "ability_state.h" #include "ability_loader.h" -#include "app_log_wrapper.h" #include "ability_impl_factory.h" #include "ability_impl.h" #include "ability.h" #include "context_deal.h" +#include "hilog_wrapper.h" #include "mock_page_ability.h" #include "mock_ability_token.h" #include "mock_ability_lifecycle_callbacks.h" diff --git a/frameworks/kits/ability/native/test/unittest/ability_thread_test.cpp b/frameworks/kits/ability/native/test/unittest/ability_thread_test.cpp index 1885f2d216..3d1ff315d5 100644 --- a/frameworks/kits/ability/native/test/unittest/ability_thread_test.cpp +++ b/frameworks/kits/ability/native/test/unittest/ability_thread_test.cpp @@ -18,11 +18,11 @@ #include "ability_thread.h" #include "ability_state.h" #include "ability_loader.h" -#include "app_log_wrapper.h" #include "ability_impl_factory.h" #include "ability.h" #include "ability_impl.h" #include "context_deal.h" +#include "hilog_wrapper.h" #include "mock_page_ability.h" #include "mock_service_ability.h" #include "mock_ability_token.h" diff --git a/frameworks/kits/ability/native/test/unittest/continuation_test.cpp b/frameworks/kits/ability/native/test/unittest/continuation_test.cpp index 2f8a7da2e3..0f6c61cd13 100644 --- a/frameworks/kits/ability/native/test/unittest/continuation_test.cpp +++ b/frameworks/kits/ability/native/test/unittest/continuation_test.cpp @@ -19,7 +19,7 @@ #include "ability_impl.h" #include "ability_state.h" #include "abs_shared_result_set.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "context_deal.h" #include "continuation_manager.h" #include "continuation_handler.h" diff --git a/frameworks/kits/ability/native/test/unittest/data_ability_impl_file_secondpart_test.cpp b/frameworks/kits/ability/native/test/unittest/data_ability_impl_file_secondpart_test.cpp index 667b051680..2d97c59dbe 100644 --- a/frameworks/kits/ability/native/test/unittest/data_ability_impl_file_secondpart_test.cpp +++ b/frameworks/kits/ability/native/test/unittest/data_ability_impl_file_secondpart_test.cpp @@ -15,8 +15,8 @@ #include #include "ability_loader.h" -#include "app_log_wrapper.h" #include "data_ability_impl.h" +#include "hilog_wrapper.h" #include "mock_ability_token.h" #include "mock_data_ability.h" diff --git a/frameworks/kits/ability/native/test/unittest/data_ability_impl_file_test.cpp b/frameworks/kits/ability/native/test/unittest/data_ability_impl_file_test.cpp index c5c1b4174c..97d5a7cc9c 100644 --- a/frameworks/kits/ability/native/test/unittest/data_ability_impl_file_test.cpp +++ b/frameworks/kits/ability/native/test/unittest/data_ability_impl_file_test.cpp @@ -15,8 +15,8 @@ #include #include "ability_loader.h" -#include "app_log_wrapper.h" #include "data_ability_impl.h" +#include "hilog_wrapper.h" #include "mock_ability_token.h" #include "mock_data_ability.h" diff --git a/frameworks/kits/ability/native/test/unittest/data_ability_impl_test.cpp b/frameworks/kits/ability/native/test/unittest/data_ability_impl_test.cpp index e57406e470..d8e9c49409 100644 --- a/frameworks/kits/ability/native/test/unittest/data_ability_impl_test.cpp +++ b/frameworks/kits/ability/native/test/unittest/data_ability_impl_test.cpp @@ -15,8 +15,8 @@ #include #include "ability_loader.h" -#include "app_log_wrapper.h" #include "data_ability_impl.h" +#include "hilog_wrapper.h" #include "mock_ability_token.h" #include "mock_data_ability.h" diff --git a/frameworks/kits/ability/native/test/unittest/service_ability_impl_test.cpp b/frameworks/kits/ability/native/test/unittest/service_ability_impl_test.cpp index bfcf7ba53f..d0a1c94f39 100644 --- a/frameworks/kits/ability/native/test/unittest/service_ability_impl_test.cpp +++ b/frameworks/kits/ability/native/test/unittest/service_ability_impl_test.cpp @@ -14,8 +14,8 @@ */ #include -#include "app_log_wrapper.h" #include "context_deal.h" +#include "hilog_wrapper.h" #include "mock_service_ability.h" #include "mock_ability_token.h" #include "service_ability_impl.h" diff --git a/frameworks/kits/ability/native/test/unittest/task_handler_client_test.cpp b/frameworks/kits/ability/native/test/unittest/task_handler_client_test.cpp index c18b0855c7..7761ed973d 100644 --- a/frameworks/kits/ability/native/test/unittest/task_handler_client_test.cpp +++ b/frameworks/kits/ability/native/test/unittest/task_handler_client_test.cpp @@ -16,7 +16,7 @@ #include #include "task_handler_client.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/frameworks/kits/appkit/BUILD.gn b/frameworks/kits/appkit/BUILD.gn index 897852b7f1..3ec16c9a20 100644 --- a/frameworks/kits/appkit/BUILD.gn +++ b/frameworks/kits/appkit/BUILD.gn @@ -16,20 +16,13 @@ import("//foundation/aafwk/standard/aafwk.gni") config("appkit_config") { defines = [ - "APP_LOG_TAG = \"AppkitNative\"", - "LOG_DOMAIN = 0xD001150", + "AMS_LOG_TAG = \"AppkitNative\"", + "AMS_LOG_DOMAIN = 0xD001150", ] include_dirs = [ - "${aafwk_path}/interfaces/innerkits/intent/include", - "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core/include/bundlemgr", - "${aafwk_path}/interfaces/innerkits/want/include", - "//utils/system/safwk/native/include", - "${aafwk_path}/interfaces/innerkits/app_manager/include/appmgr", "${aafwk_path}/frameworks/kits/ability/native/include", - "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", "//third_party/json/include", - "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", ] } @@ -46,10 +39,9 @@ config("appkit_public_config") { #build bin ohos_executable("appexec") { include_dirs = [ + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${aafwk_path}/interfaces/innerkits/app_manager/include/appmgr", - "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base/include", - "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${aafwk_path}/frameworks/kits/ability/native/include", "${aafwk_path}/interfaces/innerkits/base/include", "${aafwk_path}/interfaces/innerkits/ability_manager/include", @@ -58,9 +50,6 @@ ohos_executable("appexec") { "${aafwk_path}/frameworks/kits/appkit/native/ability_runtime/app", "${aafwk_path}/frameworks/kits/appkit/native/ability_runtime/context", "${aafwk_path}/frameworks/kits/appkit/native/app/include", - "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", - "//utils/native/base/include", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include", ] configs = [ ":appkit_config" ] @@ -73,8 +62,15 @@ ohos_executable("appexec") { ] external_deps = [ + "ability_base:want", + "ability_runtime:app_manager", + "bundle_framework:appexecfwk_base", + "bundle_framework:appexecfwk_core", + "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] install_enable = true @@ -84,13 +80,10 @@ ohos_executable("appexec") { # build so ohos_shared_library("appkit_native") { include_dirs = [ + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include", - "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", - "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base/include", "${aafwk_path}/interfaces/innerkits/app_manager/include/appmgr", "${aafwk_path}/interfaces/innerkits/uri/include", - "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${aafwk_path}/frameworks/kits/appkit/native/app/include", "${aafwk_path}/frameworks/kits/appkit/native/ability_runtime/app", "${aafwk_path}/frameworks/kits/appkit/native/ability_runtime/context", @@ -98,16 +91,12 @@ ohos_shared_library("appkit_native") { "${aafwk_path}/frameworks/kits/ability/native/include", "${aafwk_path}/interfaces/innerkits/ability_manager/include", "${aafwk_path}/services/abilitymgr/include", - "//utils/native/base/include", - "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk_L2/content", "${aafwk_path}/common/task_dispatcher/include/dispatcher", "${aafwk_path}/common/task_dispatcher/include/task", "${aafwk_path}/common/task_dispatcher/include/threading", "${aafwk_path}/frameworks/kits/appkit/native/app/include/task", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common", - "//base/hiviewdfx/faultloggerd/interfaces/innerkits/faultloggerd_client/include", - "//base/hiviewdfx/faultloggerd/interfaces/innerkits/dump_catcher/include", ] configs = [ ":appkit_config" ] @@ -140,21 +129,10 @@ ohos_shared_library("appkit_native") { deps = [ ":appkit_delegator", "${aafwk_path}/common/task_dispatcher:task_dispatcher", - "${aafwk_path}/frameworks/kits/ability/native:abilitykit_native", "${aafwk_path}/frameworks/kits/appkit:app_context", - "${aafwk_path}/interfaces/innerkits/ability_manager:ability_manager", - "${aafwk_path}/interfaces/innerkits/app_manager:app_manager", - "${aafwk_path}/interfaces/innerkits/want:want", "${appexecfwk_path}/common:libappexecfwk_common", - "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base:appexecfwk_base", - "${appexecfwk_path}/interfaces/innerkits/libeventhandler:libeventhandler", "${innerkits_path}/uri_permission:uri_permission_mgr", - "//base/hiviewdfx/faultloggerd/interfaces/innerkits/dump_catcher:lib_dfx_dump_catcher", - "//base/hiviewdfx/faultloggerd/interfaces/innerkits/faultloggerd_client:libfaultloggerd", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//foundation/multimodalinput/input/frameworks/proxy:libmmi-client", "//third_party/icu/icu4c:shared_icuuc", - "//utils/native/base:utils", ] public_deps = [ @@ -163,14 +141,25 @@ ohos_shared_library("appkit_native") { ] external_deps = [ "ability_base:configuration", + "ability_base:want", "ability_base:zuri", + "ability_runtime:ability_manager", + "ability_runtime:abilitykit_native", + "ability_runtime:app_manager", "ability_runtime:runtime", + "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "bytrace_standard:bytrace_core", + "eventhandler:libeventhandler", + "faultloggerd:lib_dfx_dump_catcher", + "faultloggerd:libfaultloggerd", "hisysevent_native:libhisysevent", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "multimodalinput_base:libmmi-client", "napi:ace_napi", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] part_name = "ability_runtime" @@ -179,15 +168,8 @@ ohos_shared_library("appkit_native") { # build so ohos_shared_library("app_context") { include_dirs = [ - "//base/account/os_account/frameworks/common/account_error/include", - "//base/account/os_account/frameworks/common/database/include", - "//base/account/os_account/frameworks/common/log/include", - "//base/account/os_account/interfaces/innerkits/osaccount/native/include", "${aafwk_path}/frameworks/kits/appkit/native/app/include", "${aafwk_path}/frameworks/kits/appkit/native/ability_runtime/context", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include", - "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", - "//utils/system/safwk/native/include", ] configs = [ ":appkit_config" ] @@ -207,17 +189,11 @@ ohos_shared_library("app_context") { } deps = [ "${appexecfwk_path}/common:libappexecfwk_common", - "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base:appexecfwk_base", # "${aafwk_path}/frameworks/kits/ability/native:abilitykit_native", "${aafwk_path}/common/task_dispatcher:task_dispatcher", - "${aafwk_path}/interfaces/innerkits/ability_manager:ability_manager", - "${appexecfwk_path}/interfaces/innerkits/libeventhandler:libeventhandler", "//base/hiviewdfx/hiview/adapter/utility:hiview_adapter_utility", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//foundation/multimodalinput/input/frameworks/proxy:libmmi-client", "//third_party/icu/icu4c:shared_icuuc", - "//utils/native/base:utils", ] public_deps = [ @@ -227,13 +203,22 @@ ohos_shared_library("app_context") { ] external_deps = [ + "ability_base:want", "ability_base:zuri", + "ability_runtime:ability_manager", + "ability_runtime:app_manager", "ability_runtime:runtime", + "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", + "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "multimodalinput_base:libmmi-client", "napi:ace_napi", + "os_account_standard:os_account_innerkits", "resmgr_standard:resmgr_napi_core", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] part_name = "ability_runtime" @@ -242,15 +227,14 @@ ohos_shared_library("app_context") { # build so ohos_shared_library("appkit_delegator") { include_dirs = [ + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", - "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core/include/bundlemgr", "${aafwk_path}/frameworks/kits/appkit/native/ability_runtime/app", "${aafwk_path}/frameworks/kits/appkit/native/ability_runtime/context", "${aafwk_path}/frameworks/kits/appkit/native", "${aafwk_path}/frameworks/kits/ability/native/include", "${aafwk_path}/frameworks/kits/appkit/native/ability_delegator/include", "${aafwk_path}/interfaces/innerkits/ability_manager/include", - "//utils/native/base/include", ] configs = [ ":appkit_config" ] @@ -277,23 +261,25 @@ ohos_shared_library("appkit_delegator") { deps = [ "${aafwk_path}/frameworks/kits/appkit:app_context", - "${aafwk_path}/interfaces/innerkits/ability_manager:ability_manager", - "${aafwk_path}/interfaces/innerkits/app_manager:app_manager", - "${aafwk_path}/interfaces/innerkits/want:want", "${appexecfwk_path}/common:libappexecfwk_common", - "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base:appexecfwk_base", - "${appexecfwk_path}/interfaces/innerkits/libeventhandler:libeventhandler", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", "//third_party/icu/icu4c:shared_icuuc", - "//utils/native/base:utils", ] external_deps = [ + "ability_base:want", + "ability_base:want", + "ability_runtime:ability_manager", + "ability_runtime:app_manager", + "ability_runtime:app_manager", "ability_runtime:runtime", + "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "bytrace_standard:bytrace_core", + "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] public_deps = [ "//foundation/ace/napi:ace_napi" ] diff --git a/frameworks/kits/appkit/native/ability_delegator/src/ability_delegator.cpp b/frameworks/kits/appkit/native/ability_delegator/src/ability_delegator.cpp index a7c828cbf6..4412ac8c88 100644 --- a/frameworks/kits/appkit/native/ability_delegator/src/ability_delegator.cpp +++ b/frameworks/kits/appkit/native/ability_delegator/src/ability_delegator.cpp @@ -15,7 +15,7 @@ #include "ability_delegator.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ohos_application.h" #include "ability_manager_client.h" #include "ability_delegator_registry.h" @@ -34,14 +34,14 @@ AbilityDelegator::~AbilityDelegator() void AbilityDelegator::AddAbilityMonitor(const std::shared_ptr &monitor) { if (!monitor) { - APP_LOGW("Invalid input parameter"); + HILOG_WARN("Invalid input parameter"); return; } std::unique_lock lck(mutexMonitor_); auto pos = std::find(abilityMonitors_.begin(), abilityMonitors_.end(), monitor); if (pos != abilityMonitors_.end()) { - APP_LOGW("Monitor has been added"); + HILOG_WARN("Monitor has been added"); return; } @@ -51,7 +51,7 @@ void AbilityDelegator::AddAbilityMonitor(const std::shared_ptr void AbilityDelegator::RemoveAbilityMonitor(const std::shared_ptr &monitor) { if (!monitor) { - APP_LOGW("Invalid input parameter"); + HILOG_WARN("Invalid input parameter"); return; } @@ -77,7 +77,7 @@ size_t AbilityDelegator::GetMonitorsNum() sptr AbilityDelegator::WaitAbilityMonitor(const std::shared_ptr &monitor) { if (!monitor) { - APP_LOGW("Invalid input parameter"); + HILOG_WARN("Invalid input parameter"); return {}; } @@ -85,7 +85,7 @@ sptr AbilityDelegator::WaitAbilityMonitor(const std::shared_ptrwaitForAbility(); if (!obtainedAbility) { - APP_LOGW("Invalid obtained ability"); + HILOG_WARN("Invalid obtained ability"); return {}; } @@ -96,7 +96,7 @@ sptr AbilityDelegator::WaitAbilityMonitor( const std::shared_ptr &monitor, const int64_t timeoutMs) { if (!monitor) { - APP_LOGW("Invalid input parameter"); + HILOG_WARN("Invalid input parameter"); return {}; } @@ -104,7 +104,7 @@ sptr AbilityDelegator::WaitAbilityMonitor( auto obtainedAbility = monitor->waitForAbility(timeoutMs); if (!obtainedAbility) { - APP_LOGW("Invalid obtained ability"); + HILOG_WARN("Invalid obtained ability"); return {}; } @@ -119,14 +119,14 @@ std::shared_ptr AbilityDelegator::GetAppContext() const AbilityDelegator::AbilityState AbilityDelegator::GetAbilityState(const sptr &token) { if (!token) { - APP_LOGW("Invalid input parameter"); + HILOG_WARN("Invalid input parameter"); return AbilityDelegator::AbilityState::UNINITIALIZED; } std::unique_lock lck(mutexAbilityProperties_); auto existedProperty = DoesPropertyExist(token); if (!existedProperty) { - APP_LOGW("Unknown ability token"); + HILOG_WARN("Unknown ability token"); return AbilityDelegator::AbilityState::UNINITIALIZED; } @@ -137,7 +137,7 @@ sptr AbilityDelegator::GetCurrentTopAbility() { sptr topAbilityToken; if (AAFwk::AbilityManagerClient::GetInstance()->GetCurrentTopAbility(topAbilityToken)) { - APP_LOGE("Failed to get top ability"); + HILOG_ERROR("Failed to get top ability"); return {}; } @@ -151,52 +151,52 @@ std::string AbilityDelegator::GetThreadName() const void AbilityDelegator::Prepare() { - APP_LOGI("Enter"); + HILOG_INFO("Enter"); if (!testRunner_) { - APP_LOGW("Invalid TestRunner"); + HILOG_WARN("Invalid TestRunner"); return; } - APP_LOGI("Call TestRunner::Prepare()"); + HILOG_INFO("Call TestRunner::Prepare()"); testRunner_->Prepare(); if (!delegatorThread_) { delegatorThread_ = std::make_unique(true); if (!delegatorThread_) { - APP_LOGE("Create delegatorThread failed"); + HILOG_ERROR("Create delegatorThread failed"); return; } } auto runTask = [this]() { this->OnRun(); }; if (!delegatorThread_->Run(runTask)) { - APP_LOGE("Run task on delegatorThread failed"); + HILOG_ERROR("Run task on delegatorThread failed"); } } void AbilityDelegator::OnRun() { - APP_LOGI("Enter"); + HILOG_INFO("Enter"); if (!testRunner_) { - APP_LOGW("Invalid TestRunner"); + HILOG_WARN("Invalid TestRunner"); return; } - APP_LOGI("Call TestRunner::Run(), Start run"); + HILOG_INFO("Call TestRunner::Run(), Start run"); testRunner_->Run(); - APP_LOGI("Run finished"); + HILOG_INFO("Run finished"); } bool AbilityDelegator::DoAbilityForeground(const sptr &token) { if (!token) { - APP_LOGW("Invalid input parameter"); + HILOG_WARN("Invalid input parameter"); return false; } auto ret = AAFwk::AbilityManagerClient::GetInstance()->DelegatorDoAbilityForeground(token); if (ret) { - APP_LOGE("Failed to call DelegatorDoAbilityForeground, reson : %{public}d", ret); + HILOG_ERROR("Failed to call DelegatorDoAbilityForeground, reson : %{public}d", ret); return false; } @@ -206,13 +206,13 @@ bool AbilityDelegator::DoAbilityForeground(const sptr &token) bool AbilityDelegator::DoAbilityBackground(const sptr &token) { if (!token) { - APP_LOGW("Invalid input parameter"); + HILOG_WARN("Invalid input parameter"); return false; } auto ret = AAFwk::AbilityManagerClient::GetInstance()->DelegatorDoAbilityBackground(token); if (ret) { - APP_LOGE("Failed to call DelegatorDoAbilityBackground, reson : %{public}d", ret); + HILOG_ERROR("Failed to call DelegatorDoAbilityBackground, reson : %{public}d", ret); return false; } @@ -221,16 +221,16 @@ bool AbilityDelegator::DoAbilityBackground(const sptr &token) std::unique_ptr AbilityDelegator::ExecuteShellCommand(const std::string &cmd, const int64_t timeoutMs) { - APP_LOGI("command : %{public}s, timeout : %{public}" PRId64, cmd.data(), timeoutMs); + HILOG_INFO("command : %{public}s, timeout : %{public}" PRId64, cmd.data(), timeoutMs); if (cmd.empty()) { - APP_LOGE("Invalid cmd"); + HILOG_ERROR("Invalid cmd"); return {}; } auto testObserver = iface_cast(observer_); if (!testObserver) { - APP_LOGW("Invalid testObserver"); + HILOG_WARN("Invalid testObserver"); return {}; } @@ -240,10 +240,10 @@ std::unique_ptr AbilityDelegator::ExecuteShellCommand(const std: void AbilityDelegator::Print(const std::string &msg) { - APP_LOGI("message to print : %{public}s", msg.data()); + HILOG_INFO("message to print : %{public}s", msg.data()); auto testObserver = iface_cast(observer_); if (!testObserver) { - APP_LOGW("Invalid testObserver"); + HILOG_WARN("Invalid testObserver"); return; } @@ -253,7 +253,7 @@ void AbilityDelegator::Print(const std::string &msg) void AbilityDelegator::PostPerformStart(const std::shared_ptr &ability) { if (!ability) { - APP_LOGW("Invalid input parameter"); + HILOG_WARN("Invalid input parameter"); return; } @@ -261,7 +261,7 @@ void AbilityDelegator::PostPerformStart(const std::shared_ptr lck(mutexMonitor_); if (abilityMonitors_.empty()) { - APP_LOGW("Empty abilityMonitors"); + HILOG_WARN("Empty abilityMonitors"); return; } @@ -279,7 +279,7 @@ void AbilityDelegator::PostPerformStart(const std::shared_ptr &ability) { if (!ability) { - APP_LOGW("Invalid input parameter"); + HILOG_WARN("Invalid input parameter"); return; } @@ -287,7 +287,7 @@ void AbilityDelegator::PostPerformScenceCreated(const std::shared_ptr lck(mutexMonitor_); if (abilityMonitors_.empty()) { - APP_LOGW("Empty abilityMonitors"); + HILOG_WARN("Empty abilityMonitors"); return; } @@ -305,7 +305,7 @@ void AbilityDelegator::PostPerformScenceCreated(const std::shared_ptr &ability) { if (!ability) { - APP_LOGW("Invalid input parameter"); + HILOG_WARN("Invalid input parameter"); return; } @@ -313,7 +313,7 @@ void AbilityDelegator::PostPerformScenceRestored(const std::shared_ptr lck(mutexMonitor_); if (abilityMonitors_.empty()) { - APP_LOGW("Empty abilityMonitors"); + HILOG_WARN("Empty abilityMonitors"); return; } @@ -331,7 +331,7 @@ void AbilityDelegator::PostPerformScenceRestored(const std::shared_ptr &ability) { if (!ability) { - APP_LOGW("Invalid input parameter"); + HILOG_WARN("Invalid input parameter"); return; } @@ -339,7 +339,7 @@ void AbilityDelegator::PostPerformScenceDestroyed(const std::shared_ptr lck(mutexMonitor_); if (abilityMonitors_.empty()) { - APP_LOGW("Empty abilityMonitors"); + HILOG_WARN("Empty abilityMonitors"); return; } @@ -357,7 +357,7 @@ void AbilityDelegator::PostPerformScenceDestroyed(const std::shared_ptr &ability) { if (!ability) { - APP_LOGW("Invalid input parameter"); + HILOG_WARN("Invalid input parameter"); return; } @@ -365,7 +365,7 @@ void AbilityDelegator::PostPerformForeground(const std::shared_ptr lck(mutexMonitor_); if (abilityMonitors_.empty()) { - APP_LOGW("Empty abilityMonitors"); + HILOG_WARN("Empty abilityMonitors"); return; } @@ -383,7 +383,7 @@ void AbilityDelegator::PostPerformForeground(const std::shared_ptr &ability) { if (!ability) { - APP_LOGW("Invalid input parameter"); + HILOG_WARN("Invalid input parameter"); return; } @@ -391,7 +391,7 @@ void AbilityDelegator::PostPerformBackground(const std::shared_ptr lck(mutexMonitor_); if (abilityMonitors_.empty()) { - APP_LOGW("Empty abilityMonitors"); + HILOG_WARN("Empty abilityMonitors"); return; } @@ -409,7 +409,7 @@ void AbilityDelegator::PostPerformBackground(const std::shared_ptr &ability) { if (!ability) { - APP_LOGW("Invalid input parameter"); + HILOG_WARN("Invalid input parameter"); return; } @@ -417,7 +417,7 @@ void AbilityDelegator::PostPerformStop(const std::shared_ptr lck(mutexMonitor_); if (abilityMonitors_.empty()) { - APP_LOGW("Empty abilityMonitors"); + HILOG_WARN("Empty abilityMonitors"); return; } @@ -450,7 +450,7 @@ AbilityDelegator::AbilityState AbilityDelegator::ConvertAbilityState( abilityState = AbilityDelegator::AbilityState::STOPPED; break; default: - APP_LOGE("Unknown lifecycleState"); + HILOG_ERROR("Unknown lifecycleState"); break; } @@ -460,11 +460,11 @@ AbilityDelegator::AbilityState AbilityDelegator::ConvertAbilityState( void AbilityDelegator::ProcessAbilityProperties(const std::shared_ptr &ability) { if (!ability) { - APP_LOGW("Invalid ability property"); + HILOG_WARN("Invalid ability property"); return; } - APP_LOGW("ability property : name : %{public}s, state : %{public}d", + HILOG_WARN("ability property : name : %{public}s, state : %{public}d", ability->name_.data(), ability->lifecycleState_); std::unique_lock lck(mutexAbilityProperties_); @@ -481,18 +481,18 @@ void AbilityDelegator::ProcessAbilityProperties(const std::shared_ptr AbilityDelegator::DoesPropertyExist(const sptr &token) { if (!token) { - APP_LOGW("Invalid input parameter"); + HILOG_WARN("Invalid input parameter"); return {}; } for (auto &it : abilityProperties_) { if (!it) { - APP_LOGW("Invalid ability property"); + HILOG_WARN("Invalid ability property"); continue; } if (token == it->token_) { - APP_LOGI("Porperty exists"); + HILOG_INFO("Porperty exists"); return it; } } @@ -502,23 +502,23 @@ std::shared_ptr AbilityDelegator::DoesPropertyExist(c void AbilityDelegator::FinishUserTest(const std::string &msg, const int32_t resultCode) { - APP_LOGI("Enter"); + HILOG_INFO("Enter"); if (!observer_) { - APP_LOGE("Invalid observer"); + HILOG_ERROR("Invalid observer"); return; } auto delegatorArgs = AbilityDelegatorRegistry::GetArguments(); if (!delegatorArgs) { - APP_LOGE("Invalid delegator args"); + HILOG_ERROR("Invalid delegator args"); return; } const auto &bundleName = delegatorArgs->GetTestBundleName(); auto err = AAFwk::AbilityManagerClient::GetInstance()->FinishUserTest(msg, resultCode, bundleName); if (err) { - APP_LOGE("MainThread::FinishUserTest is failed %{public}d", err); + HILOG_ERROR("MainThread::FinishUserTest is failed %{public}d", err); } } } // namespace AppExecFwk diff --git a/frameworks/kits/appkit/native/ability_delegator/src/delegator_thread.cpp b/frameworks/kits/appkit/native/ability_delegator/src/delegator_thread.cpp index 6685dafe88..f93f8450f1 100644 --- a/frameworks/kits/appkit/native/ability_delegator/src/delegator_thread.cpp +++ b/frameworks/kits/appkit/native/ability_delegator/src/delegator_thread.cpp @@ -14,7 +14,7 @@ */ #include "delegator_thread.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -32,12 +32,12 @@ DelegatorThread::DelegatorThread(bool isMain) bool DelegatorThread::Run(const DTask &task) { if (!task) { - APP_LOGW("Invalid input parameter"); + HILOG_WARN("Invalid input parameter"); return false; } if (!handler_) { - APP_LOGW("Invalid EventHandler"); + HILOG_WARN("Invalid EventHandler"); return false; } diff --git a/frameworks/kits/appkit/native/ability_delegator/src/iability_monitor.cpp b/frameworks/kits/appkit/native/ability_delegator/src/iability_monitor.cpp index 1e52a05eb8..394c5548e6 100644 --- a/frameworks/kits/appkit/native/ability_delegator/src/iability_monitor.cpp +++ b/frameworks/kits/appkit/native/ability_delegator/src/iability_monitor.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "iability_monitor.h" using namespace std::chrono_literals; @@ -26,27 +26,27 @@ IAbilityMonitor::IAbilityMonitor(const std::string &abilityName) : abilityName_( bool IAbilityMonitor::Match(const std::shared_ptr &ability, bool isNotify) { if (!ability) { - APP_LOGW("Invalid ability property"); + HILOG_WARN("Invalid ability property"); return false; } const auto &aName = ability->name_; if (abilityName_.empty() || aName.empty()) { - APP_LOGW("Invalid name"); + HILOG_WARN("Invalid name"); return false; } if (abilityName_.compare(aName)) { - APP_LOGW("Different name"); + HILOG_WARN("Different name"); return false; } - APP_LOGI("Matched : ability name : %{public}s, isNotify : %{public}s", + HILOG_INFO("Matched : ability name : %{public}s, isNotify : %{public}s", abilityName_.data(), (isNotify ? "true" : "false")); if (isNotify) { - APP_LOGI("Matched : notify ability matched"); + HILOG_INFO("Matched : notify ability matched"); { std::lock_guard matchLock(mMatch_); matchedAbility_ = ability; @@ -66,7 +66,7 @@ std::shared_ptr IAbilityMonitor::waitForAbility(const { auto realTime = timeoutMs; if (timeoutMs <= 0) { - APP_LOGW("Timeout should be a positive number"); + HILOG_WARN("Timeout should be a positive number"); realTime = MAX_TIME_OUT; } @@ -74,7 +74,7 @@ std::shared_ptr IAbilityMonitor::waitForAbility(const auto condition = [this] { return this->matchedAbility_ != nullptr; }; if (!cvMatch_.wait_for(matchLock, realTime * 1ms, condition)) { - APP_LOGW("Wait ability timeout"); + HILOG_WARN("Wait ability timeout"); } return matchedAbility_; diff --git a/frameworks/kits/appkit/native/ability_delegator/src/runner_runtime/js_test_runner.cpp b/frameworks/kits/appkit/native/ability_delegator/src/runner_runtime/js_test_runner.cpp index 0145f6f043..03546804da 100755 --- a/frameworks/kits/appkit/native/ability_delegator/src/runner_runtime/js_test_runner.cpp +++ b/frameworks/kits/appkit/native/ability_delegator/src/runner_runtime/js_test_runner.cpp @@ -14,7 +14,7 @@ */ #include "ability_delegator_registry.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "js_runtime_utils.h" #include "runner_runtime/js_test_runner.h" @@ -24,13 +24,13 @@ std::unique_ptr JsTestRunner::Create(const std::unique_ptr const std::shared_ptr &args, const AppExecFwk::BundleInfo &bundleInfo) { if (!args) { - APP_LOGE("Invalid ability delegator args"); + HILOG_ERROR("Invalid ability delegator args"); return nullptr; } auto pTestRunner = new (std::nothrow) JsTestRunner(static_cast(*runtime), args, bundleInfo); if (!pTestRunner) { - APP_LOGE("Failed to create test runner"); + HILOG_ERROR("Failed to create test runner"); return nullptr; } @@ -62,7 +62,7 @@ JsTestRunner::JsTestRunner( srcPath.append(testRunnerName); srcPath.append(".abc"); - APP_LOGI("JsTestRunner srcPath is %{public}s", srcPath.c_str()); + HILOG_INFO("JsTestRunner srcPath is %{public}s", srcPath.c_str()); std::string moduleName; jsTestRunnerObj_ = jsRuntime_.LoadModule(moduleName, srcPath); @@ -72,26 +72,26 @@ JsTestRunner::~JsTestRunner() = default; void JsTestRunner::Prepare() { - APP_LOGI("Enter"); + HILOG_INFO("Enter"); TestRunner::Prepare(); CallObjectMethod("onPrepare"); - APP_LOGI("End"); + HILOG_INFO("End"); } void JsTestRunner::Run() { - APP_LOGI("Enter"); + HILOG_INFO("Enter"); TestRunner::Run(); CallObjectMethod("onRun"); - APP_LOGI("End"); + HILOG_INFO("End"); } void JsTestRunner::CallObjectMethod(const char *name, NativeValue *const *argv, size_t argc) { - APP_LOGI("JsTestRunner::CallObjectMethod(%{public}s)", name); + HILOG_INFO("JsTestRunner::CallObjectMethod(%{public}s)", name); if (!jsTestRunnerObj_) { - APP_LOGE("Not found test_runner.js"); + HILOG_ERROR("Not found test_runner.js"); ReportFinished("Not found test_runner.js"); return; } @@ -102,14 +102,14 @@ void JsTestRunner::CallObjectMethod(const char *name, NativeValue *const *argv, NativeValue *value = jsTestRunnerObj_->Get(); NativeObject *obj = ConvertNativeValueTo(value); if (obj == nullptr) { - APP_LOGE("Failed to get Test Runner object"); + HILOG_ERROR("Failed to get Test Runner object"); ReportFinished("Failed to get Test Runner object"); return; } NativeValue *methodOnCreate = obj->GetProperty(name); if (methodOnCreate == nullptr) { - APP_LOGE("Failed to get '%{public}s' from Test Runner object", name); + HILOG_ERROR("Failed to get '%{public}s' from Test Runner object", name); ReportStatus("Failed to get " + std::string(name) + " from Test Runner object"); return; } @@ -118,10 +118,10 @@ void JsTestRunner::CallObjectMethod(const char *name, NativeValue *const *argv, void JsTestRunner::ReportFinished(const std::string &msg) { - APP_LOGI("Enter"); + HILOG_INFO("Enter"); auto delegator = AbilityDelegatorRegistry::GetAbilityDelegator(); if (!delegator) { - APP_LOGE("delegator is null"); + HILOG_ERROR("delegator is null"); return; } @@ -130,10 +130,10 @@ void JsTestRunner::ReportFinished(const std::string &msg) void JsTestRunner::ReportStatus(const std::string &msg) { - APP_LOGI("Enter"); + HILOG_INFO("Enter"); auto delegator = AbilityDelegatorRegistry::GetAbilityDelegator(); if (!delegator) { - APP_LOGE("delegator is null"); + HILOG_ERROR("delegator is null"); return; } diff --git a/frameworks/kits/appkit/native/ability_delegator/src/test_runner.cpp b/frameworks/kits/appkit/native/ability_delegator/src/test_runner.cpp index d95a7de6b3..da92d95df2 100644 --- a/frameworks/kits/appkit/native/ability_delegator/src/test_runner.cpp +++ b/frameworks/kits/appkit/native/ability_delegator/src/test_runner.cpp @@ -14,7 +14,7 @@ */ #include "test_runner.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "bundle_mgr_interface.h" #include "runtime.h" #include "runner_runtime/js_test_runner.h" @@ -37,24 +37,24 @@ std::unique_ptr TestRunner::Create( auto bundleObj = OHOS::DelayedSingleton::GetInstance()->GetSystemAbility(BUNDLE_MGR_SERVICE_SYS_ABILITY_ID); if (!bundleObj) { - APP_LOGE("Failed to get bundle manager service"); + HILOG_ERROR("Failed to get bundle manager service"); return nullptr; } auto bms = iface_cast(bundleObj); if (!bms) { - APP_LOGE("Cannot convert to IBundleMgr"); + HILOG_ERROR("Cannot convert to IBundleMgr"); return nullptr; } if (!args) { - APP_LOGE("Invalid ability delegator args"); + HILOG_ERROR("Invalid ability delegator args"); return nullptr; } BundleInfo bundleInfo; if (!bms->GetBundleInfo(args->GetTestBundleName(), BundleFlag::GET_BUNDLE_DEFAULT, bundleInfo, UNSPECIFIED_USER)) { - APP_LOGE("Failed to GetBundleInfo"); + HILOG_ERROR("Failed to GetBundleInfo"); return nullptr; } diff --git a/frameworks/kits/appkit/native/app/src/ability_manager.cpp b/frameworks/kits/appkit/native/app/src/ability_manager.cpp index ced6666e18..ea52d070e6 100644 --- a/frameworks/kits/appkit/native/app/src/ability_manager.cpp +++ b/frameworks/kits/appkit/native/app/src/ability_manager.cpp @@ -14,7 +14,7 @@ */ #include "ability_manager.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "singleton.h" #include "sys_mgr_client.h" #include "system_ability_definition.h" @@ -29,29 +29,29 @@ AbilityManager &AbilityManager::GetInstance() void AbilityManager::StartAbility(const Want &want, int requestCode = -1) { - APP_LOGD("%s, %d", __func__, __LINE__); + HILOG_DEBUG("%s, %d", __func__, __LINE__); ErrCode error = AAFwk::AbilityManagerClient::GetInstance()->StartAbility(want, requestCode); if (error != ERR_OK) { - APP_LOGE("%s failed, error : %d", __func__, error); + HILOG_ERROR("%s failed, error : %d", __func__, error); } } void AbilityManager::MoveMissionToTop(int missionId) { - APP_LOGD("%s, %d", __func__, __LINE__); + HILOG_DEBUG("%s, %d", __func__, __LINE__); ErrCode error = AAFwk::AbilityManagerClient::GetInstance()->MoveMissionToTop(missionId); if (error != ERR_OK) { - APP_LOGE("%s failed, error : %d", __func__, error); + HILOG_ERROR("%s failed, error : %d", __func__, error); } } StackInfo AbilityManager::GetAllStackInfo() const { - APP_LOGD("%s, %d", __func__, __LINE__); + HILOG_DEBUG("%s, %d", __func__, __LINE__); StackInfo info; ErrCode error = AAFwk::AbilityManagerClient::GetInstance()->GetAllStackInfo(info); if (error != ERR_OK) { - APP_LOGE("%s failed, error : %d", __func__, error); + HILOG_ERROR("%s failed, error : %d", __func__, error); } return info; @@ -59,11 +59,11 @@ StackInfo AbilityManager::GetAllStackInfo() const std::vector AbilityManager::QueryRecentAbilityMissionInfo(int numMax, int flags) const { - APP_LOGD("%s, %d", __func__, __LINE__); + HILOG_DEBUG("%s, %d", __func__, __LINE__); std::vector info; ErrCode error = AAFwk::AbilityManagerClient::GetInstance()->GetRecentMissions(numMax, flags, info); if (error != ERR_OK) { - APP_LOGE("%s failed, error : %d", __func__, error); + HILOG_ERROR("%s failed, error : %d", __func__, error); } return info; @@ -71,12 +71,12 @@ std::vector AbilityManager::QueryRecentAbilityMissionInfo(in std::vector AbilityManager::QueryRunningAbilityMissionInfo(int numMax) const { - APP_LOGD("%s, %d", __func__, __LINE__); + HILOG_DEBUG("%s, %d", __func__, __LINE__); std::vector info; ErrCode error = AAFwk::AbilityManagerClient::GetInstance()->GetRecentMissions(numMax, RECENT_IGNORE_UNAVAILABLE, info); if (error != ERR_OK) { - APP_LOGE("%s failed, error : %d", __func__, error); + HILOG_ERROR("%s failed, error : %d", __func__, error); } return info; @@ -84,20 +84,20 @@ std::vector AbilityManager::QueryRunningAbilityMissionInfo(i void AbilityManager::RemoveMissions(const std::vector &missionId) { - APP_LOGD("%s, %d", __func__, __LINE__); + HILOG_DEBUG("%s, %d", __func__, __LINE__); ErrCode error = AAFwk::AbilityManagerClient::GetInstance()->RemoveMissions(missionId); if (error != ERR_OK) { - APP_LOGE("%s failed, error : %d", __func__, error); + HILOG_ERROR("%s failed, error : %d", __func__, error); } } int32_t AbilityManager::ClearUpApplicationData(const std::string &bundleName) { - APP_LOGD("%s, %d", __func__, __LINE__); + HILOG_DEBUG("%s, %d", __func__, __LINE__); auto object = OHOS::DelayedSingleton::GetInstance()->GetSystemAbility(APP_MGR_SERVICE_ID); sptr appMgr_ = iface_cast(object); if (appMgr_ == nullptr) { - APP_LOGE("%s, appMgr_ is nullptr", __func__); + HILOG_ERROR("%s, appMgr_ is nullptr", __func__); return ERR_NULL_OBJECT; } @@ -106,12 +106,12 @@ int32_t AbilityManager::ClearUpApplicationData(const std::string &bundleName) std::vector AbilityManager::GetAllRunningProcesses() { - APP_LOGD("%s, %d", __func__, __LINE__); + HILOG_DEBUG("%s, %d", __func__, __LINE__); auto object = OHOS::DelayedSingleton::GetInstance()->GetSystemAbility(APP_MGR_SERVICE_ID); sptr appMgr_ = iface_cast(object); std::vector info; if (appMgr_ == nullptr) { - APP_LOGE("%s, appMgr_ is nullptr", __func__); + HILOG_ERROR("%s, appMgr_ is nullptr", __func__); return info; } @@ -121,10 +121,10 @@ std::vector AbilityManager::GetAllRunningProcesses() int AbilityManager::KillProcessesByBundleName(const std::string &bundleName) { - APP_LOGD("%s, %d", __func__, __LINE__); + HILOG_DEBUG("%s, %d", __func__, __LINE__); ErrCode error = AAFwk::AbilityManagerClient::GetInstance()->KillProcess(bundleName); if (error != ERR_OK) { - APP_LOGE("%s failed, error : %d", __func__, error); + HILOG_ERROR("%s failed, error : %d", __func__, error); return error; } return ERR_OK; diff --git a/frameworks/kits/appkit/native/app/src/ability_record_mgr.cpp b/frameworks/kits/appkit/native/app/src/ability_record_mgr.cpp index 6fde2f7671..9879d3594c 100644 --- a/frameworks/kits/appkit/native/app/src/ability_record_mgr.cpp +++ b/frameworks/kits/appkit/native/app/src/ability_record_mgr.cpp @@ -14,7 +14,7 @@ */ #include "ability_record_mgr.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -36,7 +36,7 @@ sptr AbilityRecordMgr::GetToken() const void AbilityRecordMgr::SetToken(const sptr &token) { if (token == nullptr) { - APP_LOGE("AbilityRecordMgr::SetToken failed, application is nullptr"); + HILOG_ERROR("AbilityRecordMgr::SetToken failed, application is nullptr"); return; } tokens_ = token; @@ -51,12 +51,12 @@ void AbilityRecordMgr::SetToken(const sptr &token) void AbilityRecordMgr::SetEventRunner(const std::shared_ptr &eventRunner) { if (eventRunner == nullptr) { - APP_LOGE("AbilityRecordMgr::SetEventRunner failed, eventRunner is nullptr"); + HILOG_ERROR("AbilityRecordMgr::SetEventRunner failed, eventRunner is nullptr"); return; } sptr token = GetToken(); if (token == nullptr) { - APP_LOGE("AbilityRecordMgr::SetEventRunner failed, token is nullptr"); + HILOG_ERROR("AbilityRecordMgr::SetEventRunner failed, token is nullptr"); return; } @@ -64,7 +64,7 @@ void AbilityRecordMgr::SetEventRunner(const std::shared_ptr &eventR if (abilityInstance != nullptr) { abilityInstance->SetEventRunner(eventRunner); } else { - APP_LOGW("AbilityRecordMgr::setEventRunner failed, ability record is not exists"); + HILOG_WARN("AbilityRecordMgr::setEventRunner failed, ability record is not exists"); } } @@ -79,12 +79,12 @@ void AbilityRecordMgr::AddAbilityRecord( const sptr &token, const std::shared_ptr &abilityRecord) { if (token == nullptr) { - APP_LOGE("AbilityRecordMgr::AddAbilityRecord failed, token is nullptr"); + HILOG_ERROR("AbilityRecordMgr::AddAbilityRecord failed, token is nullptr"); return; } if (abilityRecord == nullptr) { - APP_LOGE("AbilityRecordMgr::AddAbilityRecord failed, abilityRecord is nullptr"); + HILOG_ERROR("AbilityRecordMgr::AddAbilityRecord failed, abilityRecord is nullptr"); return; } @@ -100,7 +100,7 @@ void AbilityRecordMgr::AddAbilityRecord( void AbilityRecordMgr::RemoveAbilityRecord(const sptr &token) { if (token == nullptr) { - APP_LOGE("AbilityRecordMgr::RemoveAbilityRecord failed, token is nullptr"); + HILOG_ERROR("AbilityRecordMgr::RemoveAbilityRecord failed, token is nullptr"); return; } abilityRecords_.erase(token); @@ -126,16 +126,16 @@ int AbilityRecordMgr::GetRecordCount() const std::shared_ptr AbilityRecordMgr::GetAbilityItem(const sptr &token) const { if (token == nullptr) { - APP_LOGE("AbilityRecordMgr::GetAbilityItem failed, token is nullptr"); + HILOG_ERROR("AbilityRecordMgr::GetAbilityItem failed, token is nullptr"); return nullptr; } const auto &iter = abilityRecords_.find(token); if (iter != abilityRecords_.end()) { - APP_LOGI("AbilityRecordMgr::GetAbilityItem : the ability found"); + HILOG_INFO("AbilityRecordMgr::GetAbilityItem : the ability found"); return iter->second; } - APP_LOGI("AbilityRecordMgr::GetAbilityItem : the ability not found"); + HILOG_INFO("AbilityRecordMgr::GetAbilityItem : the ability not found"); return nullptr; } diff --git a/frameworks/kits/appkit/native/app/src/app_loader.cpp b/frameworks/kits/appkit/native/app/src/app_loader.cpp index c6a9d550bd..62d50838fb 100644 --- a/frameworks/kits/appkit/native/app/src/app_loader.cpp +++ b/frameworks/kits/appkit/native/app/src/app_loader.cpp @@ -14,7 +14,7 @@ */ #include "app_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -38,7 +38,7 @@ ApplicationLoader &ApplicationLoader::GetInstance() void ApplicationLoader::RegisterApplication(const std::string &bundleName, const CreateApplication &createFunc) { applications_.emplace(bundleName, createFunc); - APP_LOGD("ApplicationLoader::RegisterApplication:%{public}s", bundleName.c_str()); + HILOG_DEBUG("ApplicationLoader::RegisterApplication:%{public}s", bundleName.c_str()); } /** @@ -49,7 +49,7 @@ OHOSApplication *ApplicationLoader::GetApplicationByName() { auto it = applications_.find("OHOSApplication"); if (it == applications_.end()) { - APP_LOGE("ApplicationLoader::GetApplicationByName failed:OHOSApplication"); + HILOG_ERROR("ApplicationLoader::GetApplicationByName failed:OHOSApplication"); } else { return it->second(); } diff --git a/frameworks/kits/appkit/native/app/src/application_context.cpp b/frameworks/kits/appkit/native/app/src/application_context.cpp index 1f44256711..a28783a9ff 100755 --- a/frameworks/kits/appkit/native/app/src/application_context.cpp +++ b/frameworks/kits/appkit/native/app/src/application_context.cpp @@ -14,7 +14,7 @@ */ #include "application_context.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "task_dispatcher_context.h" namespace OHOS { @@ -213,22 +213,22 @@ int ApplicationContext::GetMissionId() std::shared_ptr ApplicationContext::CreateParallelTaskDispatcher( const std::string &name, const TaskPriority &priority) { - APP_LOGI("ApplicationContext::CreateParallelTaskDispatcher begin"); + HILOG_INFO("ApplicationContext::CreateParallelTaskDispatcher begin"); if (taskDispatcherContext_ == nullptr) { std::lock_guard lock_l(mutex_); if (taskDispatcherContext_ == nullptr) { taskDispatcherContext_ = std::make_shared(); - APP_LOGI("ApplicationContext::CreateParallelTaskDispatcher threadpool create"); + HILOG_INFO("ApplicationContext::CreateParallelTaskDispatcher threadpool create"); } if (taskDispatcherContext_ == nullptr) { - APP_LOGE("ApplicationContext::CreateParallelTaskDispatcher taskDispatcherContext_ is nullptr"); + HILOG_ERROR("ApplicationContext::CreateParallelTaskDispatcher taskDispatcherContext_ is nullptr"); return nullptr; } } std::shared_ptr task = taskDispatcherContext_->CreateParallelDispatcher(name, priority); - APP_LOGI("ApplicationContext::CreateParallelTaskDispatcher end"); + HILOG_INFO("ApplicationContext::CreateParallelTaskDispatcher end"); return task; } @@ -243,22 +243,22 @@ std::shared_ptr ApplicationContext::CreateParallelTaskDispatcher std::shared_ptr ApplicationContext::CreateSerialTaskDispatcher( const std::string &name, const TaskPriority &priority) { - APP_LOGI("ApplicationContext::CreateSerialTaskDispatcher begin"); + HILOG_INFO("ApplicationContext::CreateSerialTaskDispatcher begin"); if (taskDispatcherContext_ == nullptr) { std::lock_guard lock_l(mutex_); if (taskDispatcherContext_ == nullptr) { taskDispatcherContext_ = std::make_shared(); - APP_LOGI("ApplicationContext::CreateSerialTaskDispatcher threadpool create"); + HILOG_INFO("ApplicationContext::CreateSerialTaskDispatcher threadpool create"); } if (taskDispatcherContext_ == nullptr) { - APP_LOGE("ApplicationContext::CreateSerialTaskDispatcher taskDispatcherContext_ is nullptr"); + HILOG_ERROR("ApplicationContext::CreateSerialTaskDispatcher taskDispatcherContext_ is nullptr"); return nullptr; } } std::shared_ptr task = taskDispatcherContext_->CreateSerialDispatcher(name, priority); - APP_LOGI("ApplicationContext::CreateSerialTaskDispatcher end"); + HILOG_INFO("ApplicationContext::CreateSerialTaskDispatcher end"); return task; } @@ -271,22 +271,22 @@ std::shared_ptr ApplicationContext::CreateSerialTaskDispatcher( */ std::shared_ptr ApplicationContext::GetGlobalTaskDispatcher(const TaskPriority &priority) { - APP_LOGI("ApplicationContext::GetGlobalTaskDispatcher begin"); + HILOG_INFO("ApplicationContext::GetGlobalTaskDispatcher begin"); if (taskDispatcherContext_ == nullptr) { std::lock_guard lock_l(mutex_); if (taskDispatcherContext_ == nullptr) { taskDispatcherContext_ = std::make_shared(); - APP_LOGI("ApplicationContext::GetGlobalTaskDispatcher threadpool create"); + HILOG_INFO("ApplicationContext::GetGlobalTaskDispatcher threadpool create"); } if (taskDispatcherContext_ == nullptr) { - APP_LOGE("ApplicationContext::GetGlobalTaskDispatcher taskDispatcherContext_ is nullptr"); + HILOG_ERROR("ApplicationContext::GetGlobalTaskDispatcher taskDispatcherContext_ is nullptr"); return nullptr; } } std::shared_ptr task = taskDispatcherContext_->GetGlobalTaskDispatcher(priority); - APP_LOGI("ApplicationContext::GetGlobalTaskDispatcher end"); + HILOG_INFO("ApplicationContext::GetGlobalTaskDispatcher end"); return task; } } // namespace AppExecFwk diff --git a/frameworks/kits/appkit/native/app/src/application_impl.cpp b/frameworks/kits/appkit/native/app/src/application_impl.cpp index 8e7a0f982a..21ab979a37 100644 --- a/frameworks/kits/appkit/native/app/src/application_impl.cpp +++ b/frameworks/kits/appkit/native/app/src/application_impl.cpp @@ -15,7 +15,7 @@ #include "application_impl.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ohos_application.h" #include "uri_permission_manager_client.h" @@ -33,7 +33,7 @@ ApplicationImpl::ApplicationImpl() : curState_(APP_STATE_CREATE), recordId_(0) void ApplicationImpl::SetApplication(const std::shared_ptr &application) { if (application == nullptr) { - APP_LOGE("ApplicationImpl::SetApplication failed, application is nullptr"); + HILOG_ERROR("ApplicationImpl::SetApplication failed, application is nullptr"); return; } this->application_ = application; @@ -47,13 +47,13 @@ void ApplicationImpl::SetApplication(const std::shared_ptr &app */ bool ApplicationImpl::PerformAppReady() { - APP_LOGD("ApplicationImpl::PerformAppReady called"); + HILOG_DEBUG("ApplicationImpl::PerformAppReady called"); if (curState_ == APP_STATE_CREATE) { application_->OnStart(); curState_ = APP_STATE_READY; return true; } - APP_LOGE("ApplicationImpl::PerformAppReady error! curState is %{public}d", curState_); + HILOG_ERROR("ApplicationImpl::PerformAppReady error! curState is %{public}d", curState_); return false; } @@ -65,13 +65,13 @@ bool ApplicationImpl::PerformAppReady() */ bool ApplicationImpl::PerformForeground() { - APP_LOGD("ApplicationImpl::performForeground called"); + HILOG_DEBUG("ApplicationImpl::performForeground called"); if ((curState_ == APP_STATE_READY) || (curState_ == APP_STATE_BACKGROUND)) { application_->OnForeground(); curState_ = APP_STATE_FOREGROUND; return true; } - APP_LOGE("ApplicationImpl::performForeground error! curState is %{public}d", curState_); + HILOG_ERROR("ApplicationImpl::performForeground error! curState is %{public}d", curState_); return false; } @@ -83,13 +83,13 @@ bool ApplicationImpl::PerformForeground() */ bool ApplicationImpl::PerformBackground() { - APP_LOGD("ApplicationImpl::performBackground called"); + HILOG_DEBUG("ApplicationImpl::performBackground called"); if (curState_ == APP_STATE_FOREGROUND) { application_->OnBackground(); curState_ = APP_STATE_BACKGROUND; return true; } - APP_LOGE("ApplicationImpl::performBackground error! curState is %{public}d", curState_); + HILOG_ERROR("ApplicationImpl::performBackground error! curState is %{public}d", curState_); return false; } @@ -101,14 +101,14 @@ bool ApplicationImpl::PerformBackground() */ bool ApplicationImpl::PerformTerminate() { - APP_LOGD("ApplicationImpl::PerformTerminate called"); + HILOG_DEBUG("ApplicationImpl::PerformTerminate called"); if (curState_ == APP_STATE_BACKGROUND) { application_->OnTerminate(); curState_ = APP_STATE_TERMINATED; RemoveUriPermission(); return true; } - APP_LOGE("ApplicationImpl::performTerminate error! curState is %{public}d", curState_); + HILOG_ERROR("ApplicationImpl::performTerminate error! curState is %{public}d", curState_); return false; } @@ -120,7 +120,7 @@ bool ApplicationImpl::PerformTerminate() */ void ApplicationImpl::PerformTerminateStrong() { - APP_LOGD("ApplicationImpl::PerformTerminateStrong called"); + HILOG_DEBUG("ApplicationImpl::PerformTerminateStrong called"); application_->OnTerminate(); RemoveUriPermission(); } @@ -129,12 +129,12 @@ void ApplicationImpl::RemoveUriPermission() { auto appContext = application_->GetAppContext(); if (!appContext) { - APP_LOGE("ApplicationImpl::RemoveUriPermission: Get appliction context failed."); + HILOG_ERROR("ApplicationImpl::RemoveUriPermission: Get appliction context failed."); return; } auto appInfo = appContext->GetApplicationInfo(); if (!appInfo) { - APP_LOGE("ApplicationImpl::RemoveUriPermission: Get appliction info failed."); + HILOG_ERROR("ApplicationImpl::RemoveUriPermission: Get appliction info failed."); return; } auto uriPermMgrClient = AAFwk::UriPermissionManagerClient::GetInstance(); @@ -149,7 +149,7 @@ void ApplicationImpl::RemoveUriPermission() */ void ApplicationImpl::PerformMemoryLevel(int level) { - APP_LOGD("ApplicationImpl::PerformMemoryLevel called"); + HILOG_DEBUG("ApplicationImpl::PerformMemoryLevel called"); application_->OnMemoryLevel(level); } @@ -161,7 +161,7 @@ void ApplicationImpl::PerformMemoryLevel(int level) */ void ApplicationImpl::PerformConfigurationUpdated(const Configuration &config) { - APP_LOGD("ApplicationImpl::PerformConfigurationUpdated called"); + HILOG_DEBUG("ApplicationImpl::PerformConfigurationUpdated called"); application_->OnConfigurationUpdated(config); } diff --git a/frameworks/kits/appkit/native/app/src/context_container.cpp b/frameworks/kits/appkit/native/app/src/context_container.cpp index 87692a7fd5..715b11a8f5 100644 --- a/frameworks/kits/appkit/native/app/src/context_container.cpp +++ b/frameworks/kits/appkit/native/app/src/context_container.cpp @@ -19,9 +19,9 @@ #include "ability_constants.h" #include "ability_manager_client.h" #include "ability_manager_errors.h" -#include "app_log_wrapper.h" #include "application_context.h" #include "bundle_constants.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -36,7 +36,7 @@ constexpr int CURRENT_ACCOUNT_ID = 100; void ContextContainer::AttachBaseContext(const std::shared_ptr &base) { if (base == nullptr) { - APP_LOGE("ContextDeal::AttachBaseContext failed, base is nullptr"); + HILOG_ERROR("ContextDeal::AttachBaseContext failed, base is nullptr"); return; } baseContext_ = base; @@ -66,7 +66,7 @@ std::shared_ptr ContextContainer::GetApplicationInfo() const if (baseContext_ != nullptr) { return baseContext_->GetApplicationInfo(); } else { - APP_LOGE("ContextContainer::GetApplicationInfo baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetApplicationInfo baseContext_ is nullptr"); return nullptr; } } @@ -81,7 +81,7 @@ std::shared_ptr ContextContainer::GetApplicationContext() const if (baseContext_ != nullptr) { return baseContext_->GetApplicationContext(); } else { - APP_LOGE("ContextContainer::GetApplicationContext baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetApplicationContext baseContext_ is nullptr"); return nullptr; } } @@ -97,7 +97,7 @@ std::string ContextContainer::GetBundleCodePath() if (baseContext_ != nullptr) { return baseContext_->GetBundleCodePath(); } else { - APP_LOGE("ContextContainer::GetBundleCodePath baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetBundleCodePath baseContext_ is nullptr"); return ""; } } @@ -113,7 +113,7 @@ const std::shared_ptr ContextContainer::GetAbilityInfo() if (baseContext_ != nullptr) { return baseContext_->GetAbilityInfo(); } else { - APP_LOGE("ContextContainer::GetAbilityInfo baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetAbilityInfo baseContext_ is nullptr"); return nullptr; } } @@ -128,7 +128,7 @@ std::shared_ptr ContextContainer::GetContext() if (baseContext_ != nullptr) { return baseContext_->GetContext(); } else { - APP_LOGE("ContextContainer::GetContext baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetContext baseContext_ is nullptr"); return nullptr; } } @@ -144,7 +144,7 @@ sptr ContextContainer::GetBundleManager() const if (baseContext_ != nullptr) { return baseContext_->GetBundleManager(); } else { - APP_LOGE("ContextContainer::GetBundleManager baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetBundleManager baseContext_ is nullptr"); return nullptr; } } @@ -159,7 +159,7 @@ std::shared_ptr ContextContainer::GetResource if (baseContext_ != nullptr) { return baseContext_->GetResourceManager(); } else { - APP_LOGE("ContextContainer::GetResourceManager baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetResourceManager baseContext_ is nullptr"); return nullptr; } } @@ -176,7 +176,7 @@ bool ContextContainer::DeleteFile(const std::string &fileName) if (baseContext_ != nullptr) { return baseContext_->DeleteFile(fileName); } else { - APP_LOGE("ContextContainer::DeleteFile baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::DeleteFile baseContext_ is nullptr"); return false; } } @@ -193,7 +193,7 @@ std::string ContextContainer::GetCacheDir() if (baseContext_ != nullptr) { return baseContext_->GetCacheDir(); } else { - APP_LOGE("ContextContainer::GetCacheDir baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetCacheDir baseContext_ is nullptr"); return ""; } } @@ -210,7 +210,7 @@ std::string ContextContainer::GetCodeCacheDir() if (baseContext_ != nullptr) { return baseContext_->GetCodeCacheDir(); } else { - APP_LOGE("ContextContainer::GetCodeCacheDir baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetCodeCacheDir baseContext_ is nullptr"); return ""; } } @@ -226,7 +226,7 @@ std::string ContextContainer::GetDatabaseDir() if (baseContext_ != nullptr) { return baseContext_->GetDatabaseDir(); } else { - APP_LOGE("ContextContainer::GetDatabaseDir baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetDatabaseDir baseContext_ is nullptr"); return ""; } } @@ -241,7 +241,7 @@ std::string ContextContainer::GetDataDir() if (baseContext_ != nullptr) { return baseContext_->GetDataDir(); } else { - APP_LOGE("ContextContainer::GetDataDir baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetDataDir baseContext_ is nullptr"); return ""; } } @@ -262,7 +262,7 @@ std::string ContextContainer::GetDir(const std::string &name, int mode) if (baseContext_ != nullptr) { return baseContext_->GetDir(name, mode); } else { - APP_LOGE("ContextContainer::GetDir baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetDir baseContext_ is nullptr"); return ""; } } @@ -279,7 +279,7 @@ std::string ContextContainer::GetExternalCacheDir() if (baseContext_ != nullptr) { return baseContext_->GetExternalCacheDir(); } else { - APP_LOGE("ContextContainer::GetExternalCacheDir baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetExternalCacheDir baseContext_ is nullptr"); return ""; } } @@ -298,7 +298,7 @@ std::string ContextContainer::GetExternalFilesDir(std::string &type) if (baseContext_ != nullptr) { return baseContext_->GetExternalFilesDir(type); } else { - APP_LOGE("ContextContainer::GetExternalFilesDir baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetExternalFilesDir baseContext_ is nullptr"); return ""; } } @@ -313,7 +313,7 @@ std::string ContextContainer::GetFilesDir() if (baseContext_ != nullptr) { return baseContext_->GetFilesDir(); } else { - APP_LOGE("ContextContainer::GetFilesDir baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetFilesDir baseContext_ is nullptr"); return ""; } } @@ -330,7 +330,7 @@ std::string ContextContainer::GetNoBackupFilesDir() if (baseContext_ != nullptr) { return baseContext_->GetNoBackupFilesDir(); } else { - APP_LOGE("ContextContainer::GetNoBackupFilesDir baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetNoBackupFilesDir baseContext_ is nullptr"); return ""; } } @@ -349,7 +349,7 @@ int ContextContainer::VerifyCallingPermission(const std::string &permission) if (baseContext_ != nullptr) { return baseContext_->VerifyCallingPermission(permission); } else { - APP_LOGE("ContextContainer::VerifyCallingPermission baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::VerifyCallingPermission baseContext_ is nullptr"); return AppExecFwk::Constants::PERMISSION_NOT_GRANTED; } } @@ -369,7 +369,7 @@ int ContextContainer::VerifySelfPermission(const std::string &permission) if (baseContext_ != nullptr) { return baseContext_->VerifySelfPermission(permission); } else { - APP_LOGE("ContextContainer::VerifySelfPermission baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::VerifySelfPermission baseContext_ is nullptr"); return AppExecFwk::Constants::PERMISSION_NOT_GRANTED; } } @@ -384,7 +384,7 @@ std::string ContextContainer::GetBundleName() if (baseContext_ != nullptr) { return baseContext_->GetBundleName(); } else { - APP_LOGE("ContextContainer::GetBundleName baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetBundleName baseContext_ is nullptr"); return ""; } } @@ -399,7 +399,7 @@ std::string ContextContainer::GetBundleResourcePath() if (baseContext_ != nullptr) { return baseContext_->GetBundleResourcePath(); } else { - APP_LOGE("ContextContainer::GetBundleResourcePath baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetBundleResourcePath baseContext_ is nullptr"); return ""; } } @@ -417,7 +417,7 @@ void ContextContainer::UnauthUriPermission(const std::string &permission, const if (baseContext_ != nullptr) { baseContext_->UnauthUriPermission(permission, uri, uid); } else { - APP_LOGE("ContextContainer::UnauthUriPermission baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::UnauthUriPermission baseContext_ is nullptr"); } } @@ -432,7 +432,7 @@ sptr ContextContainer::GetAbilityManager() if (baseContext_ != nullptr) { return baseContext_->GetAbilityManager(); } else { - APP_LOGE("ContextContainer::GetAbilityManager baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetAbilityManager baseContext_ is nullptr"); return nullptr; } } @@ -450,7 +450,7 @@ std::string ContextContainer::GetAppType() if (baseContext_ != nullptr) { return baseContext_->GetAppType(); } else { - APP_LOGE("ContextContainer::GetAppType baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetAppType baseContext_ is nullptr"); return ""; } } @@ -472,7 +472,7 @@ bool ContextContainer::CanRequestPermission(const std::string &permission) if (baseContext_ != nullptr) { return baseContext_->CanRequestPermission(permission); } else { - APP_LOGE("ContextContainer::CanRequestPermission baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::CanRequestPermission baseContext_ is nullptr"); return true; } } @@ -490,7 +490,7 @@ int ContextContainer::VerifyCallingOrSelfPermission(const std::string &permissio if (baseContext_ != nullptr) { return baseContext_->VerifyCallingOrSelfPermission(permission); } else { - APP_LOGE("ContextContainer::VerifyCallingOrSelfPermission baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::VerifyCallingOrSelfPermission baseContext_ is nullptr"); return AppExecFwk::Constants::PERMISSION_NOT_GRANTED; } } @@ -509,7 +509,7 @@ int ContextContainer::VerifyPermission(const std::string &permission, int pid, i if (baseContext_ != nullptr) { return baseContext_->VerifyPermission(permission, pid, uid); } else { - APP_LOGE("ContextContainer::VerifyPermission baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::VerifyPermission baseContext_ is nullptr"); return AppExecFwk::Constants::PERMISSION_NOT_GRANTED; } } @@ -526,7 +526,7 @@ std::string ContextContainer::GetDistributedDir() if (baseContext_ != nullptr) { return baseContext_->GetDistributedDir(); } else { - APP_LOGE("ContextContainer::GetDistributedDir baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetDistributedDir baseContext_ is nullptr"); return ""; } } @@ -540,7 +540,7 @@ void ContextContainer::SetPattern(int patternId) if (baseContext_ != nullptr) { baseContext_->SetPattern(patternId); } else { - APP_LOGE("ContextContainer::SetPattern baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::SetPattern baseContext_ is nullptr"); } } @@ -554,7 +554,7 @@ std::shared_ptr ContextContainer::GetAbilityPackageContext() if (baseContext_ != nullptr) { return baseContext_->GetAbilityPackageContext(); } else { - APP_LOGE("ContextContainer::GetAbilityPackageContext baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetAbilityPackageContext baseContext_ is nullptr"); return nullptr; } } @@ -569,7 +569,7 @@ std::shared_ptr ContextContainer::GetHapModuleInfo() if (baseContext_ != nullptr) { return baseContext_->GetHapModuleInfo(); } else { - APP_LOGE("ContextContainer::GetHapModuleInfo baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetHapModuleInfo baseContext_ is nullptr"); return nullptr; } } @@ -584,7 +584,7 @@ std::string ContextContainer::GetProcessName() if (baseContext_ != nullptr) { return baseContext_->GetProcessName(); } else { - APP_LOGE("ContextContainer::GetProcessName baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetProcessName baseContext_ is nullptr"); return ""; } } @@ -604,14 +604,14 @@ void ContextContainer::RequestPermissionsFromUser(std::vector &perm if (baseContext_ != nullptr) { baseContext_->RequestPermissionsFromUser(permissions, requestCode); } else { - APP_LOGE("ContextContainer::RequestPermissionsFromUser baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::RequestPermissionsFromUser baseContext_ is nullptr"); } } std::shared_ptr ContextContainer::CreateBundleContext(std::string bundleName, int flag, int accountId) { if (bundleName.empty()) { - APP_LOGE("ContextContainer::CreateBundleContext bundleName is empty"); + HILOG_ERROR("ContextContainer::CreateBundleContext bundleName is empty"); return nullptr; } @@ -621,13 +621,15 @@ std::shared_ptr ContextContainer::CreateBundleContext(std::string bundl sptr bundleMgr = GetBundleManager(); if (nullptr == bundleMgr) { - APP_LOGE("ContextContainer::CreateBundleContext GetBundleManager is nullptr"); + HILOG_ERROR("ContextContainer::CreateBundleContext GetBundleManager is nullptr"); return nullptr; } BundleInfo bundleInfo; - APP_LOGI("CreateBundleContext length: %{public}zu, bundleName: %{public}s, accountId is %{public}d", - bundleName.length(), bundleName.c_str(), accountId); + HILOG_INFO("CreateBundleContext length: %{public}zu, bundleName: %{public}s, accountId is %{public}d", + bundleName.length(), + bundleName.c_str(), + accountId); int realAccountId = CURRENT_ACCOUNT_ID; if (accountId != DEFAULT_ACCOUNT_ID) { realAccountId = accountId; @@ -635,18 +637,18 @@ std::shared_ptr ContextContainer::CreateBundleContext(std::string bundl bundleMgr->GetBundleInfo(bundleName, BundleFlag::GET_BUNDLE_DEFAULT, bundleInfo, realAccountId); if (bundleInfo.name.empty() || bundleInfo.applicationInfo.name.empty()) { - APP_LOGE("ContextContainer::CreateBundleContext GetBundleInfo is error"); + HILOG_ERROR("ContextContainer::CreateBundleContext GetBundleInfo is error"); return nullptr; } std::shared_ptr appContext = std::make_shared(); if (appContext == nullptr) { - APP_LOGE("ContextContainer::CreateBundleContext appContext is nullptr"); + HILOG_ERROR("ContextContainer::CreateBundleContext appContext is nullptr"); return nullptr; } std::shared_ptr deal = std::make_shared(true); if (deal == nullptr) { - APP_LOGE("ContextContainer::CreateBundleContext bundleName is empty"); + HILOG_ERROR("ContextContainer::CreateBundleContext bundleName is empty"); return nullptr; } @@ -662,11 +664,11 @@ void ContextContainer::InitResourceManager(BundleInfo &bundleInfo, std::shared_p { std::shared_ptr resourceManager(Global::Resource::CreateResourceManager()); if (deal == nullptr || resourceManager == nullptr) { - APP_LOGE("ContextContainer::InitResourceManager create resourceManager failed"); + HILOG_ERROR("ContextContainer::InitResourceManager create resourceManager failed"); return; } - APP_LOGI( + HILOG_INFO( "ContextContainer::InitResourceManager moduleResPaths count: %{public}zu", bundleInfo.moduleResPaths.size()); std::vector moduleResPaths; std::regex pattern(AbilityRuntime::Constants::ABS_CODE_PATH); @@ -679,11 +681,11 @@ void ContextContainer::InitResourceManager(BundleInfo &bundleInfo, std::shared_p for (auto moduleResPath : moduleResPaths) { if (!moduleResPath.empty()) { - APP_LOGI("ContextContainer::InitResourceManager length: %{public}zu, moduleResPath : %{public}s", + HILOG_INFO("ContextContainer::InitResourceManager length: %{public}zu, moduleResPath : %{public}s", moduleResPath.length(), moduleResPath.c_str()); if (!resourceManager->AddResource(moduleResPath.c_str())) { - APP_LOGE("ContextContainer::InitResourceManager AddResource failed"); + HILOG_ERROR("ContextContainer::InitResourceManager AddResource failed"); } } } @@ -691,12 +693,13 @@ void ContextContainer::InitResourceManager(BundleInfo &bundleInfo, std::shared_p std::unique_ptr resConfig(Global::Resource::CreateResConfig()); resConfig->SetLocaleInfo("zh", "Hans", "CN"); if (resConfig->GetLocaleInfo() != nullptr) { - APP_LOGI("ContextContainer::InitResourceManager language: %{public}s, script: %{public}s, region: %{public}s,", + HILOG_INFO( + "ContextContainer::InitResourceManager language: %{public}s, script: %{public}s, region: %{public}s,", resConfig->GetLocaleInfo()->getLanguage(), resConfig->GetLocaleInfo()->getScript(), resConfig->GetLocaleInfo()->getCountry()); } else { - APP_LOGI("ContextContainer::InitResourceManager language: GetLocaleInfo is null."); + HILOG_INFO("ContextContainer::InitResourceManager language: GetLocaleInfo is null."); } resourceManager->UpdateResConfig(*resConfig); deal->initResourceManager(resourceManager); @@ -711,7 +714,7 @@ Uri ContextContainer::GetCaller() if (baseContext_ != nullptr) { return baseContext_->GetCaller(); } else { - APP_LOGE("ContextContainer::GetCaller baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetCaller baseContext_ is nullptr"); Uri uri(""); return uri; } @@ -730,7 +733,7 @@ std::string ContextContainer::GetString(int resId) std::string ret = baseContext_->GetString(resId); return ret; } else { - APP_LOGE("ContextContainer::GetString baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetString baseContext_ is nullptr"); return ""; } } @@ -748,7 +751,7 @@ std::vector ContextContainer::GetStringArray(int resId) return baseContext_->GetStringArray(resId); } else { return std::vector(); - APP_LOGE("ContextContainer::GetStringArray baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetStringArray baseContext_ is nullptr"); } } @@ -764,7 +767,7 @@ std::vector ContextContainer::GetIntArray(int resId) if (baseContext_ != nullptr) { return baseContext_->GetIntArray(resId); } else { - APP_LOGE("ContextContainer::GetIntArray baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetIntArray baseContext_ is nullptr"); return std::vector(); } } @@ -779,7 +782,7 @@ std::map ContextContainer::GetTheme() if (baseContext_ != nullptr) { return baseContext_->GetTheme(); } else { - APP_LOGE("ContextContainer::GetTheme baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetTheme baseContext_ is nullptr"); return std::map(); } } @@ -794,7 +797,7 @@ void ContextContainer::SetTheme(int themeId) if (baseContext_ != nullptr) { baseContext_->SetTheme(themeId); } else { - APP_LOGE("ContextContainer::SetTheme baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::SetTheme baseContext_ is nullptr"); } } @@ -808,7 +811,7 @@ std::map ContextContainer::GetPattern() if (baseContext_ != nullptr) { return baseContext_->GetPattern(); } else { - APP_LOGE("ContextContainer::GetPattern baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetPattern baseContext_ is nullptr"); return std::map(); } } @@ -825,7 +828,7 @@ int ContextContainer::GetColor(int resId) if (baseContext_ != nullptr) { return baseContext_->GetColor(resId); } else { - APP_LOGE("ContextContainer::GetColor baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetColor baseContext_ is nullptr"); return INVALID_RESOURCE_VALUE; } } @@ -840,7 +843,7 @@ int ContextContainer::GetThemeId() if (baseContext_ != nullptr) { return baseContext_->GetThemeId(); } else { - APP_LOGE("ContextContainer::GetThemeId baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetThemeId baseContext_ is nullptr"); return -1; } } @@ -855,7 +858,7 @@ int ContextContainer::GetDisplayOrientation() if (baseContext_ != nullptr) { return baseContext_->GetDisplayOrientation(); } else { - APP_LOGE("ContextContainer::GetDisplayOrientation baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetDisplayOrientation baseContext_ is nullptr"); return static_cast(DisplayOrientation::UNSPECIFIED); } } @@ -871,7 +874,7 @@ std::string ContextContainer::GetPreferencesDir() if (baseContext_ != nullptr) { return baseContext_->GetPreferencesDir(); } else { - APP_LOGE("ContextContainer::GetPreferencesDir baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetPreferencesDir baseContext_ is nullptr"); return ""; } } @@ -884,7 +887,7 @@ std::string ContextContainer::GetPreferencesDir() void ContextContainer::SetColorMode(int mode) { if (baseContext_ == nullptr) { - APP_LOGE("ContextContainer::SetColorMode baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::SetColorMode baseContext_ is nullptr"); return; } @@ -899,7 +902,7 @@ void ContextContainer::SetColorMode(int mode) int ContextContainer::GetColorMode() { if (baseContext_ == nullptr) { - APP_LOGE("ContextContainer::GetColorMode baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetColorMode baseContext_ is nullptr"); return -1; } @@ -916,7 +919,7 @@ int ContextContainer::GetMissionId() if (baseContext_ != nullptr) { return baseContext_->GetMissionId(); } else { - APP_LOGE("ContextContainer::GetMissionId baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetMissionId baseContext_ is nullptr"); return -1; } } @@ -930,7 +933,7 @@ void ContextContainer::TerminateAndRemoveMission() if (baseContext_ != nullptr) { baseContext_->TerminateAndRemoveMission(); } else { - APP_LOGE("ContextContainer::TerminateAndRemoveMission baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::TerminateAndRemoveMission baseContext_ is nullptr"); } } @@ -944,7 +947,7 @@ std::shared_ptr ContextContainer::GetUITaskDispatcher() if (baseContext_ != nullptr) { return baseContext_->GetUITaskDispatcher(); } else { - APP_LOGE("ContextContainer::GetUITaskDispatcher baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetUITaskDispatcher baseContext_ is nullptr"); return nullptr; } } @@ -959,7 +962,7 @@ std::shared_ptr ContextContainer::GetMainTaskDispatcher() if (baseContext_ != nullptr) { return baseContext_->GetMainTaskDispatcher(); } else { - APP_LOGE("ContextContainer::GetMainTaskDispatcher baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetMainTaskDispatcher baseContext_ is nullptr"); return nullptr; } } @@ -977,7 +980,7 @@ std::shared_ptr ContextContainer::CreateParallelTaskDispatcher( if (baseContext_ != nullptr) { return baseContext_->CreateParallelTaskDispatcher(name, priority); } else { - APP_LOGE("ContextContainer::CreateParallelTaskDispatcher baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::CreateParallelTaskDispatcher baseContext_ is nullptr"); return nullptr; } } @@ -996,7 +999,7 @@ std::shared_ptr ContextContainer::CreateSerialTaskDispatcher( if (baseContext_ != nullptr) { return baseContext_->CreateSerialTaskDispatcher(name, priority); } else { - APP_LOGE("ContextContainer::CreateSerialTaskDispatcher baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::CreateSerialTaskDispatcher baseContext_ is nullptr"); return nullptr; } } @@ -1013,7 +1016,7 @@ std::shared_ptr ContextContainer::GetGlobalTaskDispatcher(const if (baseContext_ != nullptr) { return baseContext_->GetGlobalTaskDispatcher(priority); } else { - APP_LOGE("ContextContainer::GetGlobalTaskDispatcher baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::GetGlobalTaskDispatcher baseContext_ is nullptr"); return nullptr; } } @@ -1029,19 +1032,19 @@ bool ContextContainer::MoveMissionToEnd(bool nonFirst) { sptr token = GetToken(); if (token == nullptr) { - APP_LOGE("ContextContainer::MoveMissionToEnd GetToken return nullptr"); + HILOG_ERROR("ContextContainer::MoveMissionToEnd GetToken return nullptr"); return false; } auto abilityClient = AAFwk::AbilityManagerClient::GetInstance(); if (abilityClient == nullptr) { - APP_LOGE("ContextContainer::MoveMissionToEnd abilityClient is nullptr"); + HILOG_ERROR("ContextContainer::MoveMissionToEnd abilityClient is nullptr"); return false; } ErrCode errval = abilityClient->MoveMissionToEnd(token, nonFirst); if (errval != ERR_OK) { - APP_LOGE("ContextContainer::MoveMissionToEnd MoveMissionToEnd retval is %d", errval); + HILOG_ERROR("ContextContainer::MoveMissionToEnd MoveMissionToEnd retval is %d", errval); } return (errval == ERR_OK) ? true : false; @@ -1054,13 +1057,13 @@ void ContextContainer::LockMission() { auto abilityClient = AAFwk::AbilityManagerClient::GetInstance(); if (abilityClient == nullptr) { - APP_LOGE("ContextContainer::LockMission abilityClient is nullptr"); + HILOG_ERROR("ContextContainer::LockMission abilityClient is nullptr"); return; } ErrCode errval = abilityClient->LockMission(GetMissionId()); if (errval != ERR_OK) { - APP_LOGE("ContextContainer::LockMission LockMission retval is %d", errval); + HILOG_ERROR("ContextContainer::LockMission LockMission retval is %d", errval); } } @@ -1071,13 +1074,13 @@ void ContextContainer::UnlockMission() { auto abilityClient = AAFwk::AbilityManagerClient::GetInstance(); if (abilityClient == nullptr) { - APP_LOGE("ContextContainer::UnlockMission abilityClient is nullptr"); + HILOG_ERROR("ContextContainer::UnlockMission abilityClient is nullptr"); return; } ErrCode errval = abilityClient->UnlockMission(GetMissionId()); if (errval != ERR_OK) { - APP_LOGE("ContextContainer::UnlockMission UnlockMission retval is %d", errval); + HILOG_ERROR("ContextContainer::UnlockMission UnlockMission retval is %d", errval); } } @@ -1092,13 +1095,13 @@ bool ContextContainer::SetMissionInformation(const MissionInformation &missionIn { sptr token = GetToken(); if (token == nullptr) { - APP_LOGE("ContextContainer::SetMissionInformation GetToken return nullptr"); + HILOG_ERROR("ContextContainer::SetMissionInformation GetToken return nullptr"); return false; } auto abilityClient = AAFwk::AbilityManagerClient::GetInstance(); if (abilityClient == nullptr) { - APP_LOGE("ContextContainer::SetMissionInformation abilityClient is nullptr"); + HILOG_ERROR("ContextContainer::SetMissionInformation abilityClient is nullptr"); return false; } @@ -1108,7 +1111,7 @@ bool ContextContainer::SetMissionInformation(const MissionInformation &missionIn ErrCode errval = abilityClient->SetMissionDescriptionInfo(token, missionInfoMat); if (errval != ERR_OK) { - APP_LOGE("ContextContainer::SetMissionInformation SetMissionDescriptionInfo retval is %d", errval); + HILOG_ERROR("ContextContainer::SetMissionInformation SetMissionDescriptionInfo retval is %d", errval); } return (errval == ERR_OK) ? true : false; @@ -1123,12 +1126,12 @@ bool ContextContainer::SetMissionInformation(const MissionInformation &missionIn void ContextContainer::SetShowOnLockScreen(bool isAllow) { if (baseContext_ == nullptr) { - APP_LOGE("ContextContainer::SetShowOnLockScreen baseContext_ is nullptr"); + HILOG_ERROR("ContextContainer::SetShowOnLockScreen baseContext_ is nullptr"); return; } baseContext_->SetShowOnLockScreen(isAllow); - APP_LOGI("ContextContainer::SetShowOnLockScreen called end."); + HILOG_INFO("ContextContainer::SetShowOnLockScreen called end."); } bool ContextContainer::IsUpdatingConfigurations() diff --git a/frameworks/kits/appkit/native/app/src/context_deal.cpp b/frameworks/kits/appkit/native/app/src/context_deal.cpp index 93b6de245f..837825cdfa 100644 --- a/frameworks/kits/appkit/native/app/src/context_deal.cpp +++ b/frameworks/kits/appkit/native/app/src/context_deal.cpp @@ -20,10 +20,10 @@ #include "ability_constants.h" #include "ability_manager_client.h" #include "ability_manager_interface.h" -#include "app_log_wrapper.h" #include "application_context.h" #include "directory_ex.h" #include "file_ex.h" +#include "hilog_wrapper.h" #include "iservice_registry.h" #include "os_account_manager.h" #include "spec_task_dispatcher.h" @@ -69,12 +69,12 @@ std::shared_ptr ContextDeal::GetProcessInfo() const */ void ContextDeal::SetProcessInfo(const std::shared_ptr &info) { - APP_LOGI("ContextDeal::SetProcessInfo begin"); + HILOG_INFO("ContextDeal::SetProcessInfo begin"); if (info == nullptr) { - APP_LOGE("ContextDeal::SetProcessInfo failed, info is empty"); + HILOG_ERROR("ContextDeal::SetProcessInfo failed, info is empty"); return; } - APP_LOGI("ContextDeal::SetProcessInfo end"); + HILOG_INFO("ContextDeal::SetProcessInfo end"); processInfo_ = info; } @@ -96,13 +96,13 @@ std::shared_ptr ContextDeal::GetApplicationInfo() const */ void ContextDeal::SetApplicationInfo(const std::shared_ptr &info) { - APP_LOGI("ContextDeal::SetApplicationInfo begin"); + HILOG_INFO("ContextDeal::SetApplicationInfo begin"); if (info == nullptr) { - APP_LOGE("ContextDeal::SetApplicationInfo failed, info is empty"); + HILOG_ERROR("ContextDeal::SetApplicationInfo failed, info is empty"); return; } applicationInfo_ = info; - APP_LOGI("ContextDeal::SetApplicationInfo end"); + HILOG_INFO("ContextDeal::SetApplicationInfo end"); } /** @@ -122,13 +122,13 @@ std::shared_ptr ContextDeal::GetApplicationContext() const */ void ContextDeal::SetApplicationContext(const std::shared_ptr &context) { - APP_LOGI("ContextDeal::SetApplicationContext begin"); + HILOG_INFO("ContextDeal::SetApplicationContext begin"); if (context == nullptr) { - APP_LOGE("ContextDeal::SetApplicationContext failed, context is empty"); + HILOG_ERROR("ContextDeal::SetApplicationContext failed, context is empty"); return; } appContext_ = context; - APP_LOGI("ContextDeal::SetApplicationContext end"); + HILOG_INFO("ContextDeal::SetApplicationContext end"); } /** @@ -181,13 +181,13 @@ const std::shared_ptr ContextDeal::GetAbilityInfo() */ void ContextDeal::SetAbilityInfo(const std::shared_ptr &info) { - APP_LOGI("ContextDeal::SetAbilityInfo begin"); + HILOG_INFO("ContextDeal::SetAbilityInfo begin"); if (info == nullptr) { - APP_LOGE("ContextDeal::SetAbilityInfo failed, info is empty"); + HILOG_ERROR("ContextDeal::SetAbilityInfo failed, info is empty"); return; } abilityInfo_ = info; - APP_LOGI("ContextDeal::SetAbilityInfo end"); + HILOG_INFO("ContextDeal::SetAbilityInfo end"); } /** @@ -207,13 +207,13 @@ std::shared_ptr ContextDeal::GetContext() */ void ContextDeal::SetContext(const std::shared_ptr &context) { - APP_LOGI("ContextDeal::SetContext begin"); + HILOG_INFO("ContextDeal::SetContext begin"); if (context == nullptr) { - APP_LOGE("ContextDeal::SetContext failed, context is empty"); + HILOG_ERROR("ContextDeal::SetContext failed, context is empty"); return; } abilityContext_ = context; - APP_LOGI("ContextDeal::SetContext end"); + HILOG_INFO("ContextDeal::SetContext end"); } /** @@ -224,17 +224,17 @@ void ContextDeal::SetContext(const std::shared_ptr &context) */ sptr ContextDeal::GetBundleManager() const { - APP_LOGI("ContextDeal::GetBundleManager begin"); + HILOG_INFO("ContextDeal::GetBundleManager begin"); auto bundleObj = OHOS::DelayedSingleton::GetInstance()->GetSystemAbility(BUNDLE_MGR_SERVICE_SYS_ABILITY_ID); if (bundleObj == nullptr) { - APP_LOGE("failed to get bundle manager service"); + HILOG_ERROR("failed to get bundle manager service"); return nullptr; } - APP_LOGI("ContextDeal::GetBundleManager before iface_cast"); + HILOG_INFO("ContextDeal::GetBundleManager before iface_cast"); sptr bms = iface_cast(bundleObj); - APP_LOGI("ContextDeal::GetBundleManager after iface_cast"); - APP_LOGI("ContextDeal::GetBundleManager end"); + HILOG_INFO("ContextDeal::GetBundleManager after iface_cast"); + HILOG_INFO("ContextDeal::GetBundleManager end"); return bms; } @@ -255,13 +255,13 @@ std::shared_ptr ContextDeal::GetResourceManag */ void ContextDeal::SetProfile(const std::shared_ptr &profile) { - APP_LOGI("ContextDeal::SetProfile begin"); + HILOG_INFO("ContextDeal::SetProfile begin"); if (profile == nullptr) { - APP_LOGE("ContextDeal::SetProfile failed, profile is nullptr"); + HILOG_ERROR("ContextDeal::SetProfile failed, profile is nullptr"); return; } profile_ = profile; - APP_LOGI("ContextDeal::SetProfile end"); + HILOG_INFO("ContextDeal::SetProfile end"); } /** @@ -283,10 +283,10 @@ std::shared_ptr ContextDeal::GetProfile() const */ bool ContextDeal::DeleteFile(const std::string &fileName) { - APP_LOGI("ContextDeal::DeleteFile begin"); + HILOG_INFO("ContextDeal::DeleteFile begin"); std::string path = GetDataDir() + CONTEXT_DEAL_FILE_SEPARATOR + fileName; bool ret = OHOS::RemoveFile(path); - APP_LOGI("ContextDeal::DeleteFile end"); + HILOG_INFO("ContextDeal::DeleteFile end"); return ret; } @@ -375,18 +375,18 @@ std::string ContextDeal::GetDataDir() */ std::string ContextDeal::GetDir(const std::string &name, int mode) { - APP_LOGI("ContextDeal::GetDir begin"); + HILOG_INFO("ContextDeal::GetDir begin"); if (applicationInfo_ == nullptr) { - APP_LOGE("ContextDeal::GetDir failed, applicationInfo_ == nullptr"); + HILOG_ERROR("ContextDeal::GetDir failed, applicationInfo_ == nullptr"); return ""; } std::string dir = applicationInfo_->dataDir + CONTEXT_DEAL_FILE_SEPARATOR + name; if (!OHOS::FileExists(dir)) { - APP_LOGI("ContextDeal::GetDir File is not exits"); + HILOG_INFO("ContextDeal::GetDir File is not exits"); OHOS::ForceCreateDirectory(dir); OHOS::ChangeModeDirectory(dir, mode); } - APP_LOGI("ContextDeal::GetDir end"); + HILOG_INFO("ContextDeal::GetDir end"); return dir; } @@ -437,14 +437,14 @@ std::string ContextDeal::GetFilesDir() */ std::string ContextDeal::GetNoBackupFilesDir() { - APP_LOGI("ContextDeal::GetNoBackupFilesDir begin"); + HILOG_INFO("ContextDeal::GetNoBackupFilesDir begin"); std::string dir = applicationInfo_->dataDir + CONTEXT_DEAL_NO_BACKUP_Files; if (!OHOS::FileExists(dir)) { - APP_LOGI("ContextDeal::GetDir GetNoBackupFilesDir is not exits"); + HILOG_INFO("ContextDeal::GetDir GetNoBackupFilesDir is not exits"); OHOS::ForceCreateDirectory(dir); OHOS::ChangeModeDirectory(dir, MODE); } - APP_LOGI("ContextDeal::GetNoBackupFilesDir end"); + HILOG_INFO("ContextDeal::GetNoBackupFilesDir end"); return dir; } @@ -525,7 +525,7 @@ std::string ContextDeal::GetBundleResourcePath() */ ErrCode ContextDeal::StartAbility(const AAFwk::Want &want, int requestCode) { - APP_LOGI("ContextDeal::StartAbility is called"); + HILOG_INFO("ContextDeal::StartAbility is called"); return ERR_INVALID_VALUE; } @@ -548,16 +548,16 @@ void ContextDeal::UnauthUriPermission(const std::string &permission, const Uri & */ sptr ContextDeal::GetAbilityManager() { - APP_LOGI("ContextDeal::GetAbilityManager begin"); + HILOG_INFO("ContextDeal::GetAbilityManager begin"); auto remoteObject = OHOS::DelayedSingleton::GetInstance()->GetSystemAbility(ABILITY_MGR_SERVICE_ID); if (remoteObject == nullptr) { - APP_LOGE("failed to get ability manager service"); + HILOG_ERROR("failed to get ability manager service"); return nullptr; } - APP_LOGI("ContextDeal::SetPattern before iface_cast"); + HILOG_INFO("ContextDeal::SetPattern before iface_cast"); sptr ams = iface_cast(remoteObject); - APP_LOGI("ContextDeal::SetPattern after iface_cast"); - APP_LOGI("ContextDeal::GetAbilityManager end"); + HILOG_INFO("ContextDeal::SetPattern after iface_cast"); + HILOG_INFO("ContextDeal::GetAbilityManager end"); return ams; } @@ -571,14 +571,14 @@ sptr ContextDeal::GetAbilityManager() */ std::string ContextDeal::GetAppType() { - APP_LOGI("ContextDeal::GetAppType begin"); + HILOG_INFO("ContextDeal::GetAppType begin"); sptr ptr = GetBundleManager(); if (ptr == nullptr) { - APP_LOGE("GetAppType failed to get bundle manager service"); + HILOG_ERROR("GetAppType failed to get bundle manager service"); return ""; } std::string retString = ptr->GetAppType(applicationInfo_->bundleName); - APP_LOGI("ContextDeal::GetAppType end"); + HILOG_INFO("ContextDeal::GetAppType end"); return retString; } @@ -653,12 +653,12 @@ int ContextDeal::GetCurrentAccountId() const void ContextDeal::CreateDirIfNotExist(const std::string &dirPath) const { - APP_LOGI("CreateDirIfNotExist: create directory if not exists."); + HILOG_INFO("CreateDirIfNotExist: create directory if not exists."); if (!OHOS::FileExists(dirPath)) { - APP_LOGI("ContextDeal::CreateDirIfNotExist File is not exits"); + HILOG_INFO("ContextDeal::CreateDirIfNotExist File is not exits"); bool createDir = OHOS::ForceCreateDirectory(dirPath); if (!createDir) { - APP_LOGI("CreateDirIfNotExist: create dir %{public}s failed.", dirPath.c_str()); + HILOG_INFO("CreateDirIfNotExist: create dir %{public}s failed.", dirPath.c_str()); return; } } @@ -673,7 +673,7 @@ void ContextDeal::CreateDirIfNotExist(const std::string &dirPath) const */ std::string ContextDeal::GetDistributedDir() { - APP_LOGI("ContextImpl::GetDistributedDir"); + HILOG_INFO("ContextImpl::GetDistributedDir"); std::string dir; if (IsCreateBySystemApp()) { dir = CONTEXT_DISTRIBUTED_BASE_BEFORE + std::to_string(GetCurrentAccountId()) + @@ -683,7 +683,7 @@ std::string ContextDeal::GetDistributedDir() ((GetHapModuleInfo() == nullptr) ? "" : GetHapModuleInfo()->moduleName); } CreateDirIfNotExist(dir); - APP_LOGI("ContextImpl::GetDistributedDir:%{public}s", dir.c_str()); + HILOG_INFO("ContextImpl::GetDistributedDir:%{public}s", dir.c_str()); return dir; } /** @@ -693,21 +693,21 @@ std::string ContextDeal::GetDistributedDir() */ void ContextDeal::SetPattern(int patternId) { - APP_LOGI("ContextDeal::SetPattern begin"); + HILOG_INFO("ContextDeal::SetPattern begin"); if (resourceManager_ != nullptr) { if (!pattern_.empty()) { pattern_.clear(); } - APP_LOGI("ContextDeal::SetPattern before resourceManager_->GetPatternById"); + HILOG_INFO("ContextDeal::SetPattern before resourceManager_->GetPatternById"); OHOS::Global::Resource::RState errval = resourceManager_->GetPatternById(patternId, pattern_); - APP_LOGI("ContextDeal::SetPattern after resourceManager_->GetPatternById"); + HILOG_INFO("ContextDeal::SetPattern after resourceManager_->GetPatternById"); if (errval != OHOS::Global::Resource::RState::SUCCESS) { - APP_LOGE("ContextDeal::SetPattern GetPatternById(patternId:%d) retval is %u", patternId, errval); + HILOG_ERROR("ContextDeal::SetPattern GetPatternById(patternId:%d) retval is %u", patternId, errval); } } else { - APP_LOGE("ContextDeal::SetPattern resourceManager_ is nullptr"); + HILOG_ERROR("ContextDeal::SetPattern resourceManager_ is nullptr"); } - APP_LOGI("ContextDeal::SetPattern end"); + HILOG_INFO("ContextDeal::SetPattern end"); } /** @@ -734,7 +734,7 @@ std::shared_ptr ContextDeal::GetHapModuleInfo() sptr ptr = GetBundleManager(); if (ptr == nullptr) { - APP_LOGE("GetAppType failed to get bundle manager service"); + HILOG_ERROR("GetAppType failed to get bundle manager service"); return hapModuleInfoLocal_; } Want want; @@ -746,7 +746,7 @@ std::shared_ptr ContextDeal::GetHapModuleInfo() if (isSuc) { hapModuleInfoLocal_->abilityInfos = abilityInfos; } - APP_LOGI("ContextDeal::GetHapModuleInfo end"); + HILOG_INFO("ContextDeal::GetHapModuleInfo end"); return hapModuleInfoLocal_; } @@ -851,9 +851,9 @@ sptr ContextDeal::GetToken() */ void ContextDeal::initResourceManager(const std::shared_ptr &resourceManager) { - APP_LOGI("ContextDeal::initResourceManager. Start."); + HILOG_INFO("ContextDeal::initResourceManager. Start."); resourceManager_ = resourceManager; - APP_LOGI("ContextDeal::initResourceManager. End."); + HILOG_INFO("ContextDeal::initResourceManager. End."); } /** @@ -884,23 +884,23 @@ void ContextDeal::SerUriString(const std::string &uri) */ std::string ContextDeal::GetString(int resId) { - APP_LOGI("ContextDeal::GetString begin"); + HILOG_INFO("ContextDeal::GetString begin"); if (resourceManager_ == nullptr) { - APP_LOGE("ContextDeal::GetString resourceManager_ is nullptr"); + HILOG_ERROR("ContextDeal::GetString resourceManager_ is nullptr"); return ""; } std::string ret; - APP_LOGI("ContextDeal::GetString before resourceManager_->GetStringById"); + HILOG_INFO("ContextDeal::GetString before resourceManager_->GetStringById"); OHOS::Global::Resource::RState errval = resourceManager_->GetStringById(resId, ret); - APP_LOGI("ContextDeal::GetString after resourceManager_->GetStringById"); + HILOG_INFO("ContextDeal::GetString after resourceManager_->GetStringById"); if (errval == OHOS::Global::Resource::RState::SUCCESS) { return ret; } else { - APP_LOGE("ContextDeal::GetString GetStringById(resId:%d) retval is %u", resId, errval); + HILOG_ERROR("ContextDeal::GetString GetStringById(resId:%d) retval is %u", resId, errval); return ""; } - APP_LOGI("ContextDeal::GetString end"); + HILOG_INFO("ContextDeal::GetString end"); } /** @@ -912,23 +912,23 @@ std::string ContextDeal::GetString(int resId) */ std::vector ContextDeal::GetStringArray(int resId) { - APP_LOGI("ContextDeal::GetStringArray begin"); + HILOG_INFO("ContextDeal::GetStringArray begin"); if (resourceManager_ == nullptr) { - APP_LOGE("ContextDeal::GetStringArray resourceManager_ is nullptr"); + HILOG_ERROR("ContextDeal::GetStringArray resourceManager_ is nullptr"); return std::vector(); } std::vector retv; - APP_LOGI("ContextDeal::GetString before resourceManager_->GetStringArrayById"); + HILOG_INFO("ContextDeal::GetString before resourceManager_->GetStringArrayById"); OHOS::Global::Resource::RState errval = resourceManager_->GetStringArrayById(resId, retv); - APP_LOGI("ContextDeal::GetString after resourceManager_->GetStringArrayById"); + HILOG_INFO("ContextDeal::GetString after resourceManager_->GetStringArrayById"); if (errval == OHOS::Global::Resource::RState::SUCCESS) { return retv; } else { - APP_LOGE("ContextDeal::GetStringArray GetStringArrayById(resId:%d) retval is %u", resId, errval); + HILOG_ERROR("ContextDeal::GetStringArray GetStringArrayById(resId:%d) retval is %u", resId, errval); return std::vector(); } - APP_LOGI("ContextDeal::GetStringArray end"); + HILOG_INFO("ContextDeal::GetStringArray end"); } /** @@ -940,23 +940,23 @@ std::vector ContextDeal::GetStringArray(int resId) */ std::vector ContextDeal::GetIntArray(int resId) { - APP_LOGI("ContextDeal::GetIntArray begin"); + HILOG_INFO("ContextDeal::GetIntArray begin"); if (resourceManager_ == nullptr) { - APP_LOGE("ContextDeal::GetIntArray resourceManager_ is nullptr"); + HILOG_ERROR("ContextDeal::GetIntArray resourceManager_ is nullptr"); return std::vector(); } std::vector retv; - APP_LOGI("ContextDeal::GetString before resourceManager_->GetIntArrayById"); + HILOG_INFO("ContextDeal::GetString before resourceManager_->GetIntArrayById"); OHOS::Global::Resource::RState errval = resourceManager_->GetIntArrayById(resId, retv); - APP_LOGI("ContextDeal::GetString after resourceManager_->GetIntArrayById"); + HILOG_INFO("ContextDeal::GetString after resourceManager_->GetIntArrayById"); if (errval == OHOS::Global::Resource::RState::SUCCESS) { return retv; } else { - APP_LOGE("ContextDeal::GetIntArray GetIntArrayById(resId:%d) retval is %u", resId, errval); + HILOG_ERROR("ContextDeal::GetIntArray GetIntArrayById(resId:%d) retval is %u", resId, errval); return std::vector(); } - APP_LOGI("ContextDeal::GetIntArray end"); + HILOG_INFO("ContextDeal::GetIntArray end"); } /** @@ -966,11 +966,11 @@ std::vector ContextDeal::GetIntArray(int resId) */ std::map ContextDeal::GetTheme() { - APP_LOGI("ContextDeal::GetTheme begin"); + HILOG_INFO("ContextDeal::GetTheme begin"); if (theme_.empty()) { SetTheme(GetThemeId()); } - APP_LOGI("ContextDeal::GetTheme end"); + HILOG_INFO("ContextDeal::GetTheme end"); return theme_; } @@ -981,30 +981,30 @@ std::map ContextDeal::GetTheme() */ void ContextDeal::SetTheme(int themeId) { - APP_LOGI("ContextDeal::SetTheme begin"); + HILOG_INFO("ContextDeal::SetTheme begin"); if (resourceManager_ == nullptr) { - APP_LOGE("ContextDeal::SetTheme resourceManager_ is nullptr"); + HILOG_ERROR("ContextDeal::SetTheme resourceManager_ is nullptr"); return; } auto hapModInfo = GetHapModuleInfo(); if (hapModInfo == nullptr) { - APP_LOGE("ContextDeal::SetTheme hapModInfo is nullptr"); + HILOG_ERROR("ContextDeal::SetTheme hapModInfo is nullptr"); return; } if (!theme_.empty()) { theme_.clear(); } - APP_LOGI("ContextDeal::GetString before resourceManager_->GetThemeById"); + HILOG_INFO("ContextDeal::GetString before resourceManager_->GetThemeById"); OHOS::Global::Resource::RState errval = resourceManager_->GetThemeById(themeId, theme_); - APP_LOGI("ContextDeal::GetString after resourceManager_->GetThemeById"); + HILOG_INFO("ContextDeal::GetString after resourceManager_->GetThemeById"); if (errval != OHOS::Global::Resource::RState::SUCCESS) { - APP_LOGE("ContextDeal::SetTheme GetThemeById(themeId:%d) retval is %u", themeId, errval); + HILOG_ERROR("ContextDeal::SetTheme GetThemeById(themeId:%d) retval is %u", themeId, errval); return; } - APP_LOGI("ContextDeal::SetTheme end"); + HILOG_INFO("ContextDeal::SetTheme end"); return; } @@ -1015,12 +1015,12 @@ void ContextDeal::SetTheme(int themeId) */ std::map ContextDeal::GetPattern() { - APP_LOGI("ContextDeal::GetPattern begin"); + HILOG_INFO("ContextDeal::GetPattern begin"); if (!pattern_.empty()) { - APP_LOGI("ContextDeal::GetPattern end"); + HILOG_INFO("ContextDeal::GetPattern end"); return pattern_; } else { - APP_LOGE("ContextDeal::GetPattern pattern_ is empty"); + HILOG_ERROR("ContextDeal::GetPattern pattern_ is empty"); return std::map(); } } @@ -1034,23 +1034,23 @@ std::map ContextDeal::GetPattern() */ int ContextDeal::GetColor(int resId) { - APP_LOGI("ContextDeal::GetColor begin"); + HILOG_INFO("ContextDeal::GetColor begin"); if (resourceManager_ == nullptr) { - APP_LOGE("ContextDeal::GetColor resourceManager_ is nullptr"); + HILOG_ERROR("ContextDeal::GetColor resourceManager_ is nullptr"); return INVALID_RESOURCE_VALUE; } uint32_t ret = INVALID_RESOURCE_VALUE; - APP_LOGI("ContextDeal::GetString before resourceManager_->GetColorById"); + HILOG_INFO("ContextDeal::GetString before resourceManager_->GetColorById"); OHOS::Global::Resource::RState errval = resourceManager_->GetColorById(resId, ret); - APP_LOGI("ContextDeal::GetString after resourceManager_->GetColorById"); + HILOG_INFO("ContextDeal::GetString after resourceManager_->GetColorById"); if (errval == OHOS::Global::Resource::RState::SUCCESS) { return ret; } else { - APP_LOGE("ContextDeal::GetColor GetColorById(resId:%d) retval is %u", resId, errval); + HILOG_ERROR("ContextDeal::GetColor GetColorById(resId:%d) retval is %u", resId, errval); return INVALID_RESOURCE_VALUE; } - APP_LOGI("ContextDeal::GetColor end"); + HILOG_INFO("ContextDeal::GetColor end"); } /** @@ -1064,7 +1064,7 @@ int ContextDeal::GetThemeId() if (hapModInfo != nullptr) { return -1; } else { - APP_LOGE("ContextDeal::GetThemeId hapModInfo is nullptr"); + HILOG_ERROR("ContextDeal::GetThemeId hapModInfo is nullptr"); return -1; } } @@ -1096,12 +1096,12 @@ bool ContextDeal::TerminateAbilityResult(int startId) */ int ContextDeal::GetDisplayOrientation() { - APP_LOGI("ContextDeal::GetDisplayOrientation begin"); + HILOG_INFO("ContextDeal::GetDisplayOrientation begin"); if (abilityInfo_ != nullptr) { - APP_LOGI("ContextDeal::GetDisplayOrientation end"); + HILOG_INFO("ContextDeal::GetDisplayOrientation end"); return static_cast(abilityInfo_->orientation); } else { - APP_LOGE("ContextDeal::GetDisplayOrientation abilityInfo_ is nullptr"); + HILOG_ERROR("ContextDeal::GetDisplayOrientation abilityInfo_ is nullptr"); return static_cast(DisplayOrientation::UNSPECIFIED); } } @@ -1114,13 +1114,13 @@ int ContextDeal::GetDisplayOrientation() */ std::string ContextDeal::GetPreferencesDir() { - APP_LOGI("ContextDeal::GetPreferencesDir begin"); + HILOG_INFO("ContextDeal::GetPreferencesDir begin"); if (!preferenceDir_.empty()) { return preferenceDir_; } if (abilityInfo_ == nullptr || applicationInfo_ == nullptr) { - APP_LOGE("ContextDeal::GetPreferencesDir %s is nullptr", + HILOG_ERROR("ContextDeal::GetPreferencesDir %s is nullptr", (abilityInfo_ == nullptr) ? "abilityInfo_" : "applicationInfo_"); return ""; } @@ -1132,13 +1132,13 @@ std::string ContextDeal::GetPreferencesDir() std::string abilityname = abilityInfo_->name; size_t findpos = abilityname.find_last_of("."); if (findpos == std::string::npos) { - APP_LOGE("ContextDeal::GetPreferencesDir Find last of string failed."); + HILOG_ERROR("ContextDeal::GetPreferencesDir Find last of string failed."); return ""; } abilityDirectoryName = abilityname.substr(findpos + 1, abilityname.length()); if (abilityDirectoryName == "") { - APP_LOGE("ContextDeal::GetPreferencesDir abilityDirectoryName is nullptr"); + HILOG_ERROR("ContextDeal::GetPreferencesDir abilityDirectoryName is nullptr"); return ""; } } @@ -1147,20 +1147,20 @@ std::string ContextDeal::GetPreferencesDir() CONTEXT_DEAL_FILE_SEPARATOR + CONTEXT_DEAL_DIRNAME; if (!OHOS::FileExists(dataDir)) { - APP_LOGI("ContextDeal::GetPreferencesDir File is not exits. Bengin create"); + HILOG_INFO("ContextDeal::GetPreferencesDir File is not exits. Bengin create"); if (!OHOS::ForceCreateDirectory(dataDir)) { - APP_LOGE("ContextDeal::GetPreferencesDir ForceCreateDirectory return false. Create failed"); + HILOG_ERROR("ContextDeal::GetPreferencesDir ForceCreateDirectory return false. Create failed"); return ""; } if (!OHOS::ChangeModeDirectory(dataDir, MODE)) { - APP_LOGW("ContextDeal::GetPreferencesDir ChangeModeDirectory(%s, 0771) return false. Change failed", + HILOG_WARN("ContextDeal::GetPreferencesDir ChangeModeDirectory(%s, 0771) return false. Change failed", dataDir.c_str()); } - APP_LOGI("ContextDeal::GetPreferencesDir File create complete"); + HILOG_INFO("ContextDeal::GetPreferencesDir File create complete"); } preferenceDir_ = dataDir; - APP_LOGI("ContextDeal::GetPreferencesDir end"); + HILOG_INFO("ContextDeal::GetPreferencesDir end"); return preferenceDir_; } @@ -1171,10 +1171,10 @@ std::string ContextDeal::GetPreferencesDir() */ void ContextDeal::SetColorMode(int mode) { - APP_LOGI("ContextDeal::SetColorMode begin"); + HILOG_INFO("ContextDeal::SetColorMode begin"); auto hapModInfo = GetHapModuleInfo(); if (hapModInfo == nullptr) { - APP_LOGE("ContextDeal::SetColorMode hapModInfo is nullptr"); + HILOG_ERROR("ContextDeal::SetColorMode hapModInfo is nullptr"); return; } @@ -1185,7 +1185,7 @@ void ContextDeal::SetColorMode(int mode) } else { // default use AUTO hapModInfo->colorMode = ModuleColorMode::AUTO; } - APP_LOGI("ContextDeal::SetColorMode end"); + HILOG_INFO("ContextDeal::SetColorMode end"); } /** @@ -1195,13 +1195,13 @@ void ContextDeal::SetColorMode(int mode) */ int ContextDeal::GetColorMode() { - APP_LOGI("ContextDeal::GetColorMode begin"); + HILOG_INFO("ContextDeal::GetColorMode begin"); auto hapModInfo = GetHapModuleInfo(); if (hapModInfo == nullptr) { - APP_LOGE("ContextDeal::GetColorMode hapModInfo is nullptr"); + HILOG_ERROR("ContextDeal::GetColorMode hapModInfo is nullptr"); return -1; } - APP_LOGI("ContextDeal::GetColorMode end"); + HILOG_INFO("ContextDeal::GetColorMode end"); return static_cast(hapModInfo->colorMode); } @@ -1241,21 +1241,21 @@ AAFwk::LifeCycleStateInfo ContextDeal::GetLifeCycleStateInfo() const */ void ContextDeal::TerminateAndRemoveMission() { - APP_LOGI("ContextDeal::TerminateAndRemoveMission begin"); + HILOG_INFO("ContextDeal::TerminateAndRemoveMission begin"); auto abilityManagerClient = AAFwk::AbilityManagerClient::GetInstance(); if (abilityManagerClient == nullptr) { - APP_LOGE("ContextDeal::TerminateAndRemoveMission abilityManagerClient is nullptr"); + HILOG_ERROR("ContextDeal::TerminateAndRemoveMission abilityManagerClient is nullptr"); return; } std::vector removeIdList = {GetMissionId()}; - APP_LOGI("ContextDeal::TerminateAndRemoveMission before abilityManagerClient->RemoveMissions"); + HILOG_INFO("ContextDeal::TerminateAndRemoveMission before abilityManagerClient->RemoveMissions"); ErrCode errval = abilityManagerClient->RemoveMissions(removeIdList); - APP_LOGI("ContextDeal::TerminateAndRemoveMission after abilityManagerClient->RemoveMissions"); + HILOG_INFO("ContextDeal::TerminateAndRemoveMission after abilityManagerClient->RemoveMissions"); if (errval != ERR_OK) { - APP_LOGW("ContextDeal::TerminateAndRemoveMission RemoveMissions retval is ERROR(%d)", errval); + HILOG_WARN("ContextDeal::TerminateAndRemoveMission RemoveMissions retval is ERROR(%d)", errval); } - APP_LOGI("ContextDeal::TerminateAndRemoveMission end"); + HILOG_INFO("ContextDeal::TerminateAndRemoveMission end"); } /** @@ -1293,25 +1293,25 @@ std::shared_ptr ContextDeal::GetUITaskDispatcher() */ std::shared_ptr ContextDeal::GetMainTaskDispatcher() { - APP_LOGI("ContextDeal::GetMainTaskDispatcher begin"); + HILOG_INFO("ContextDeal::GetMainTaskDispatcher begin"); if (mainTaskDispatcher_ != nullptr) { return mainTaskDispatcher_; } if (mainEventRunner_ == nullptr) { - APP_LOGE("ContextDeal::GetMainTaskDispatcher mainTaskDispatcher_ is nullptr"); + HILOG_ERROR("ContextDeal::GetMainTaskDispatcher mainTaskDispatcher_ is nullptr"); return nullptr; } std::shared_ptr config = std::make_shared(SpecDispatcherConfig::MAIN, TaskPriority::HIGH); if (config == nullptr) { - APP_LOGE("ContextDeal::GetMainTaskDispatcher config is nullptr"); + HILOG_ERROR("ContextDeal::GetMainTaskDispatcher config is nullptr"); return nullptr; } mainTaskDispatcher_ = std::make_shared(config, mainEventRunner_); - APP_LOGI("ContextDeal::GetMainTaskDispatcher end"); + HILOG_INFO("ContextDeal::GetMainTaskDispatcher end"); return mainTaskDispatcher_; } @@ -1326,14 +1326,14 @@ std::shared_ptr ContextDeal::GetMainTaskDispatcher() std::shared_ptr ContextDeal::CreateParallelTaskDispatcher( const std::string &name, const TaskPriority &priority) { - APP_LOGI("ContextDeal::CreateParallelTaskDispatcher begin"); + HILOG_INFO("ContextDeal::CreateParallelTaskDispatcher begin"); if (appContext_ == nullptr) { - APP_LOGE("ContextDeal::CreateParallelTaskDispatcher appContext_ is nullptr"); + HILOG_ERROR("ContextDeal::CreateParallelTaskDispatcher appContext_ is nullptr"); return nullptr; } std::shared_ptr task = appContext_->CreateParallelTaskDispatcher(name, priority); - APP_LOGI("ContextDeal::CreateParallelTaskDispatcher end"); + HILOG_INFO("ContextDeal::CreateParallelTaskDispatcher end"); return task; } @@ -1348,14 +1348,14 @@ std::shared_ptr ContextDeal::CreateParallelTaskDispatcher( std::shared_ptr ContextDeal::CreateSerialTaskDispatcher( const std::string &name, const TaskPriority &priority) { - APP_LOGI("ContextDeal::CreateSerialTaskDispatcher begin"); + HILOG_INFO("ContextDeal::CreateSerialTaskDispatcher begin"); if (appContext_ == nullptr) { - APP_LOGE("ContextDeal::CreateSerialTaskDispatcher appContext_ is nullptr"); + HILOG_ERROR("ContextDeal::CreateSerialTaskDispatcher appContext_ is nullptr"); return nullptr; } std::shared_ptr task = appContext_->CreateSerialTaskDispatcher(name, priority); - APP_LOGI("ContextDeal::CreateSerialTaskDispatcher end"); + HILOG_INFO("ContextDeal::CreateSerialTaskDispatcher end"); return task; } @@ -1368,14 +1368,14 @@ std::shared_ptr ContextDeal::CreateSerialTaskDispatcher( */ std::shared_ptr ContextDeal::GetGlobalTaskDispatcher(const TaskPriority &priority) { - APP_LOGI("ContextDeal::GetGlobalTaskDispatcher begin"); + HILOG_INFO("ContextDeal::GetGlobalTaskDispatcher begin"); if (appContext_ == nullptr) { - APP_LOGE("ContextDeal::GetGlobalTaskDispatcher appContext_ is nullptr"); + HILOG_ERROR("ContextDeal::GetGlobalTaskDispatcher appContext_ is nullptr"); return nullptr; } std::shared_ptr task = appContext_->GetGlobalTaskDispatcher(priority); - APP_LOGI("ContextDeal::GetGlobalTaskDispatcher end"); + HILOG_INFO("ContextDeal::GetGlobalTaskDispatcher end"); return task; } @@ -1396,27 +1396,27 @@ void ContextDeal::SetRunner(const std::shared_ptr &runner) */ bool ContextDeal::HapModuleInfoRequestInit() { - APP_LOGI("ContextDeal::HapModuleInfoRequestInit begin"); + HILOG_INFO("ContextDeal::HapModuleInfoRequestInit begin"); sptr ptr = GetBundleManager(); if (ptr == nullptr) { - APP_LOGE("GetHapModuleInfo failed to get bundle manager service"); + HILOG_ERROR("GetHapModuleInfo failed to get bundle manager service"); return false; } if (abilityInfo_ == nullptr) { - APP_LOGE("GetHapModuleInfo failed for abilityInfo_ is nullptr"); + HILOG_ERROR("GetHapModuleInfo failed for abilityInfo_ is nullptr"); return false; } hapModuleInfoLocal_ = std::make_shared(); - APP_LOGI("ContextDeal::HapModuleInfoRequestInit before IBundleMgr->GetBundleManager"); + HILOG_INFO("ContextDeal::HapModuleInfoRequestInit before IBundleMgr->GetBundleManager"); if (!ptr->GetHapModuleInfo(*abilityInfo_.get(), *hapModuleInfoLocal_)) { - APP_LOGE("IBundleMgr::GetHapModuleInfo failed, will retval false value"); + HILOG_ERROR("IBundleMgr::GetHapModuleInfo failed, will retval false value"); return false; } - APP_LOGI("ContextDeal::HapModuleInfoRequestInit after IBundleMgr->GetBundleManager"); - APP_LOGI("ContextDeal::HapModuleInfoRequestInit end"); + HILOG_INFO("ContextDeal::HapModuleInfoRequestInit after IBundleMgr->GetBundleManager"); + HILOG_INFO("ContextDeal::HapModuleInfoRequestInit end"); return true; } @@ -1466,12 +1466,12 @@ void ContextDeal::SetShowOnLockScreen(bool isAllow) { auto abilityManagerClient = AAFwk::AbilityManagerClient::GetInstance(); if (abilityManagerClient == nullptr) { - APP_LOGE("ContextDeal::SetShowOnLockScreen abilityManagerClient is nullptr"); + HILOG_ERROR("ContextDeal::SetShowOnLockScreen abilityManagerClient is nullptr"); return; } ErrCode errval = abilityManagerClient->SetShowOnLockScreen(isAllow); if (errval != ERR_OK) { - APP_LOGE("ContextDeal::SetShowOnLockScreen SetShowOnLockScreen retval is ERROR(%d)", errval); + HILOG_ERROR("ContextDeal::SetShowOnLockScreen SetShowOnLockScreen retval is ERROR(%d)", errval); } } } // namespace AppExecFwk diff --git a/frameworks/kits/appkit/native/app/src/hdc_register.cpp b/frameworks/kits/appkit/native/app/src/hdc_register.cpp index 638919fd62..2e1f5ece5e 100644 --- a/frameworks/kits/appkit/native/app/src/hdc_register.cpp +++ b/frameworks/kits/appkit/native/app/src/hdc_register.cpp @@ -18,7 +18,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS::AppExecFwk { namespace { @@ -30,7 +30,7 @@ HdcRegister::HdcRegister() : registerHandler_(nullptr) { registerHandler_ = dlopen("libhdc_register.z.so", RTLD_LAZY); if (registerHandler_ == nullptr) { - APP_LOGE("HdcRegister::StartHdcRegister failed to open register library"); + HILOG_ERROR("HdcRegister::StartHdcRegister failed to open register library"); } } @@ -47,34 +47,34 @@ HdcRegister& HdcRegister::Get() void HdcRegister::StartHdcRegister(const std::string& bundleName) { - APP_LOGI("HdcRegister::StartHdcRegister begin"); + HILOG_INFO("HdcRegister::StartHdcRegister begin"); if (registerHandler_ == nullptr) { - APP_LOGE("HdcRegister::StartHdcRegister registerHandler_ is nullptr"); + HILOG_ERROR("HdcRegister::StartHdcRegister registerHandler_ is nullptr"); return; } StartRegister startRegister = (StartRegister)dlsym(registerHandler_, "StartConnect"); if (startRegister == nullptr) { - APP_LOGE("HdcRegister::StartHdcRegister failed to find symbol 'StartConnect'"); + HILOG_ERROR("HdcRegister::StartHdcRegister failed to find symbol 'StartConnect'"); return; } startRegister(bundleName); - APP_LOGI("HdcRegister::StartHdcRegister end"); + HILOG_INFO("HdcRegister::StartHdcRegister end"); } void HdcRegister::StopHdcRegister() { - APP_LOGE("HdcRegister::StopHdcRegister begin"); + HILOG_ERROR("HdcRegister::StopHdcRegister begin"); if (registerHandler_ == nullptr) { - APP_LOGE("HdcRegister::StopHdcRegister registerHandler_ is nullptr"); + HILOG_ERROR("HdcRegister::StopHdcRegister registerHandler_ is nullptr"); return; } StopRegister stopRegister = (StopRegister)dlsym(registerHandler_, "StopConnect"); if (stopRegister == nullptr) { - APP_LOGE("HdcRegister::StopHdcRegister failed to find symbol 'StopConnect'"); + HILOG_ERROR("HdcRegister::StopHdcRegister failed to find symbol 'StopConnect'"); return; } dlclose(registerHandler_); registerHandler_ = nullptr; - APP_LOGI("HdcRegister::StopHdcRegister end"); + HILOG_INFO("HdcRegister::StopHdcRegister end"); } } // namespace OHOS::AppExecFwk diff --git a/frameworks/kits/appkit/native/app/src/main.cpp b/frameworks/kits/appkit/native/app/src/main.cpp index 96355533a0..d1a0c639c2 100644 --- a/frameworks/kits/appkit/native/app/src/main.cpp +++ b/frameworks/kits/appkit/native/app/src/main.cpp @@ -14,7 +14,7 @@ */ #include "main_thread.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" using namespace OHOS; using namespace OHOS::AppExecFwk; diff --git a/frameworks/kits/appkit/native/app/src/main_thread.cpp b/frameworks/kits/appkit/native/app/src/main_thread.cpp index 6a9aa87d2e..23053516c8 100644 --- a/frameworks/kits/appkit/native/app/src/main_thread.cpp +++ b/frameworks/kits/appkit/native/app/src/main_thread.cpp @@ -24,7 +24,6 @@ #include "ability_loader.h" #include "ability_thread.h" #include "app_loader.h" -#include "app_log_wrapper.h" #include "application_env_impl.h" #include "bytrace.h" #include "configuration_convertor.h" @@ -32,6 +31,7 @@ #include "context_impl.h" #include "extension_module_loader.h" #include "form_extension.h" +#include "hilog_wrapper.h" #include "if_system_ability_manager.h" #include "iservice_registry.h" #include "js_runtime.h" @@ -84,7 +84,7 @@ constexpr char EVENT_KEY_PROCESS_NAME[] = "PROCESS_NAME"; */ void AppMgrDeathRecipient::OnRemoteDied(const wptr &remote) { - APP_LOGE("MainThread::AppMgrDeathRecipient remote died receive"); + HILOG_ERROR("MainThread::AppMgrDeathRecipient remote died receive"); } MainThread::MainThread() @@ -187,33 +187,33 @@ std::shared_ptr MainThread::GetApplicationImpl() bool MainThread::ConnectToAppMgr() { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("MainThread::ConnectToAppMgr start"); + HILOG_INFO("MainThread::ConnectToAppMgr start"); auto object = OHOS::DelayedSingleton::GetInstance()->GetSystemAbility(APP_MGR_SERVICE_ID); if (object == nullptr) { - APP_LOGE("failed to get app manager service"); + HILOG_ERROR("failed to get app manager service"); return false; } deathRecipient_ = new (std::nothrow) AppMgrDeathRecipient(); if (deathRecipient_ == nullptr) { - APP_LOGE("failed to new AppMgrDeathRecipient"); + HILOG_ERROR("failed to new AppMgrDeathRecipient"); return false; } - APP_LOGI("%{public}s, Start calling AddDeathRecipient.", __func__); + HILOG_INFO("%{public}s, Start calling AddDeathRecipient.", __func__); if (!object->AddDeathRecipient(deathRecipient_)) { - APP_LOGE("failed to AddDeathRecipient"); + HILOG_ERROR("failed to AddDeathRecipient"); return false; } - APP_LOGI("%{public}s, End calling AddDeathRecipient.", __func__); + HILOG_INFO("%{public}s, End calling AddDeathRecipient.", __func__); appMgr_ = iface_cast(object); if (appMgr_ == nullptr) { - APP_LOGE("failed to iface_cast object to appMgr_"); + HILOG_ERROR("failed to iface_cast object to appMgr_"); return false; } - APP_LOGI("MainThread::connectToAppMgr before AttachApplication"); + HILOG_INFO("MainThread::connectToAppMgr before AttachApplication"); appMgr_->AttachApplication(this); - APP_LOGI("MainThread::connectToAppMgr after AttachApplication"); + HILOG_INFO("MainThread::connectToAppMgr after AttachApplication"); return true; } @@ -225,13 +225,13 @@ bool MainThread::ConnectToAppMgr() void MainThread::Attach() { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("MainThread::attach called"); + HILOG_INFO("MainThread::attach called"); if (!ConnectToAppMgr()) { - APP_LOGE("attachApplication failed"); + HILOG_ERROR("attachApplication failed"); return; } mainThreadState_ = MainThreadState::ATTACH; - APP_LOGI("MainThread::attach mainThreadState: %{public}d", mainThreadState_); + HILOG_INFO("MainThread::attach mainThreadState: %{public}d", mainThreadState_); } /** @@ -241,21 +241,21 @@ void MainThread::Attach() */ void MainThread::RemoveAppMgrDeathRecipient() { - APP_LOGI("MainThread::RemoveAppMgrDeathRecipient called begin"); + HILOG_INFO("MainThread::RemoveAppMgrDeathRecipient called begin"); if (appMgr_ == nullptr) { - APP_LOGE("MainThread::RemoveAppMgrDeathRecipient failed"); + HILOG_ERROR("MainThread::RemoveAppMgrDeathRecipient failed"); return; } sptr object = appMgr_->AsObject(); if (object != nullptr) { - APP_LOGI("%{public}s called. Start calling RemoveDeathRecipient.", __func__); + HILOG_INFO("%{public}s called. Start calling RemoveDeathRecipient.", __func__); object->RemoveDeathRecipient(deathRecipient_); - APP_LOGI("%{public}s called. End calling RemoveDeathRecipient.", __func__); + HILOG_INFO("%{public}s called. End calling RemoveDeathRecipient.", __func__); } else { - APP_LOGE("appMgr_->AsObject() failed"); + HILOG_ERROR("appMgr_->AsObject() failed"); } - APP_LOGI("%{public}s called end.", __func__); + HILOG_INFO("%{public}s called end.", __func__); } /** @@ -277,20 +277,20 @@ std::shared_ptr MainThread::GetMainHandler() const void MainThread::ScheduleForegroundApplication() { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("MainThread::scheduleForegroundApplication called begin"); + HILOG_INFO("MainThread::scheduleForegroundApplication called begin"); wptr weak = this; auto task = [weak]() { auto appThread = weak.promote(); if (appThread == nullptr) { - APP_LOGE("appThread is nullptr, HandleForegroundApplication failed."); + HILOG_ERROR("appThread is nullptr, HandleForegroundApplication failed."); return; } appThread->HandleForegroundApplication(); }; if (!mainHandler_->PostTask(task)) { - APP_LOGE("PostTask task failed"); + HILOG_ERROR("PostTask task failed"); } - APP_LOGI("MainThread::scheduleForegroundApplication called end."); + HILOG_INFO("MainThread::scheduleForegroundApplication called end."); } /** @@ -300,20 +300,20 @@ void MainThread::ScheduleForegroundApplication() */ void MainThread::ScheduleBackgroundApplication() { - APP_LOGI("MainThread::scheduleBackgroundApplication called begin"); + HILOG_INFO("MainThread::scheduleBackgroundApplication called begin"); wptr weak = this; auto task = [weak]() { auto appThread = weak.promote(); if (appThread == nullptr) { - APP_LOGE("appThread is nullptr, HandleBackgroundApplication failed."); + HILOG_ERROR("appThread is nullptr, HandleBackgroundApplication failed."); return; } appThread->HandleBackgroundApplication(); }; if (!mainHandler_->PostTask(task)) { - APP_LOGE("MainThread::ScheduleBackgroundApplication PostTask task failed"); + HILOG_ERROR("MainThread::ScheduleBackgroundApplication PostTask task failed"); } - APP_LOGI("MainThread::scheduleBackgroundApplication called end."); + HILOG_INFO("MainThread::scheduleBackgroundApplication called end."); } /** @@ -323,20 +323,20 @@ void MainThread::ScheduleBackgroundApplication() */ void MainThread::ScheduleTerminateApplication() { - APP_LOGI("MainThread::scheduleTerminateApplication called begin"); + HILOG_INFO("MainThread::scheduleTerminateApplication called begin"); wptr weak = this; auto task = [weak]() { auto appThread = weak.promote(); if (appThread == nullptr) { - APP_LOGE("appThread is nullptr, HandleTerminateApplication failed."); + HILOG_ERROR("appThread is nullptr, HandleTerminateApplication failed."); return; } appThread->HandleTerminateApplication(); }; if (!mainHandler_->PostTask(task)) { - APP_LOGE("MainThread::ScheduleTerminateApplication PostTask task failed"); + HILOG_ERROR("MainThread::ScheduleTerminateApplication PostTask task failed"); } - APP_LOGI("MainThread::scheduleTerminateApplication called."); + HILOG_INFO("MainThread::scheduleTerminateApplication called."); } /** @@ -347,20 +347,20 @@ void MainThread::ScheduleTerminateApplication() */ void MainThread::ScheduleShrinkMemory(const int level) { - APP_LOGI("MainThread::scheduleShrinkMemory level: %{public}d", level); + HILOG_INFO("MainThread::scheduleShrinkMemory level: %{public}d", level); wptr weak = this; auto task = [weak, level]() { auto appThread = weak.promote(); if (appThread == nullptr) { - APP_LOGE("appThread is nullptr, HandleShrinkMemory failed."); + HILOG_ERROR("appThread is nullptr, HandleShrinkMemory failed."); return; } appThread->HandleShrinkMemory(level); }; if (!mainHandler_->PostTask(task)) { - APP_LOGE("MainThread::ScheduleShrinkMemory PostTask task failed"); + HILOG_ERROR("MainThread::ScheduleShrinkMemory PostTask task failed"); } - APP_LOGI("MainThread::scheduleShrinkMemory level: %{public}d end.", level); + HILOG_INFO("MainThread::scheduleShrinkMemory level: %{public}d end.", level); } /** @@ -370,20 +370,20 @@ void MainThread::ScheduleShrinkMemory(const int level) */ void MainThread::ScheduleProcessSecurityExit() { - APP_LOGI("MainThread::ScheduleProcessSecurityExit called start"); + HILOG_INFO("MainThread::ScheduleProcessSecurityExit called start"); wptr weak = this; auto task = [weak]() { auto appThread = weak.promote(); if (appThread == nullptr) { - APP_LOGE("appThread is nullptr, HandleShrinkMemory failed."); + HILOG_ERROR("appThread is nullptr, HandleShrinkMemory failed."); return; } appThread->HandleProcessSecurityExit(); }; if (!mainHandler_->PostTask(task)) { - APP_LOGE("MainThread::ScheduleProcessSecurityExit PostTask task failed"); + HILOG_ERROR("MainThread::ScheduleProcessSecurityExit PostTask task failed"); } - APP_LOGI("MainThread::ScheduleProcessSecurityExit called end"); + HILOG_INFO("MainThread::ScheduleProcessSecurityExit called end"); } /** @@ -393,7 +393,7 @@ void MainThread::ScheduleProcessSecurityExit() */ void MainThread::ScheduleLowMemory() { - APP_LOGI("MainThread::scheduleLowMemory called"); + HILOG_INFO("MainThread::scheduleLowMemory called"); } /** @@ -406,44 +406,44 @@ void MainThread::ScheduleLowMemory() void MainThread::ScheduleLaunchApplication(const AppLaunchData &data, const Configuration &config) { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("MainThread::scheduleLaunchApplication start"); + HILOG_INFO("MainThread::scheduleLaunchApplication start"); wptr weak = this; auto task = [weak, data, config]() { auto appThread = weak.promote(); if (appThread == nullptr) { - APP_LOGE("appThread is nullptr, HandleLaunchApplication failed."); + HILOG_ERROR("appThread is nullptr, HandleLaunchApplication failed."); return; } appThread->HandleLaunchApplication(data, config); }; if (!mainHandler_->PostTask(task)) { - APP_LOGE("MainThread::ScheduleLaunchApplication PostTask task failed"); + HILOG_ERROR("MainThread::ScheduleLaunchApplication PostTask task failed"); } - APP_LOGI("MainThread::scheduleLaunchApplication end."); + HILOG_INFO("MainThread::scheduleLaunchApplication end."); } void MainThread::ScheduleAbilityStage(const HapModuleInfo &abilityStage) { - APP_LOGI("MainThread::ScheduleAbilityStageInfo start"); + HILOG_INFO("MainThread::ScheduleAbilityStageInfo start"); wptr weak = this; auto task = [weak, abilityStage]() { auto appThread = weak.promote(); if (appThread == nullptr) { - APP_LOGE("appThread is nullptr, HandleShrinkMemory failed."); + HILOG_ERROR("appThread is nullptr, HandleShrinkMemory failed."); return; } appThread->HandleAbilityStage(abilityStage); }; if (!mainHandler_->PostTask(task)) { - APP_LOGE("MainThread::ScheduleAbilityStageInfo PostTask task failed"); + HILOG_ERROR("MainThread::ScheduleAbilityStageInfo PostTask task failed"); } - APP_LOGI("MainThread::ScheduleAbilityStageInfo end."); + HILOG_INFO("MainThread::ScheduleAbilityStageInfo end."); } void MainThread::ScheduleLaunchAbility(const AbilityInfo &info, const sptr &token, const std::shared_ptr &want) { - APP_LOGI("MainThread::scheduleLaunchAbility, AbilityInfo name:%{public}s type:%{public}d", + HILOG_INFO("MainThread::scheduleLaunchAbility, AbilityInfo name:%{public}s type:%{public}d", info.name.c_str(), info.type); std::shared_ptr abilityInfo = std::make_shared(info); @@ -456,20 +456,20 @@ void MainThread::ScheduleLaunchAbility(const AbilityInfo &info, const sptrGetBundleInfo(abilityInfo->bundleName, BundleFlag::GET_BUNDLE_DEFAULT, bundleInfo); abilityRecord->SetCompatibleVersion(bundleInfo.compatibleVersion); - APP_LOGI("MainThread::ScheduleLaunchAbility compatibleVersion:%{public}d", bundleInfo.compatibleVersion); + HILOG_INFO("MainThread::ScheduleLaunchAbility compatibleVersion:%{public}d", bundleInfo.compatibleVersion); } wptr weak = this; auto task = [weak, abilityRecord]() { auto appThread = weak.promote(); if (appThread == nullptr) { - APP_LOGE("appThread is nullptr, HandleLaunchAbility failed."); + HILOG_ERROR("appThread is nullptr, HandleLaunchAbility failed."); return; } appThread->HandleLaunchAbility(abilityRecord); }; if (!mainHandler_->PostTask(task)) { - APP_LOGE("MainThread::ScheduleLaunchAbility PostTask task failed"); + HILOG_ERROR("MainThread::ScheduleLaunchAbility PostTask task failed"); } } @@ -482,20 +482,20 @@ void MainThread::ScheduleLaunchAbility(const AbilityInfo &info, const sptr &token) { - APP_LOGI("MainThread::scheduleCleanAbility called start."); + HILOG_INFO("MainThread::scheduleCleanAbility called start."); wptr weak = this; auto task = [weak, token]() { auto appThread = weak.promote(); if (appThread == nullptr) { - APP_LOGE("appThread is nullptr, HandleCleanAbility failed."); + HILOG_ERROR("appThread is nullptr, HandleCleanAbility failed."); return; } appThread->HandleCleanAbility(token); }; if (!mainHandler_->PostTask(task)) { - APP_LOGE("MainThread::ScheduleCleanAbility PostTask task failed"); + HILOG_ERROR("MainThread::ScheduleCleanAbility PostTask task failed"); } - APP_LOGI("MainThread::scheduleCleanAbility called end."); + HILOG_INFO("MainThread::scheduleCleanAbility called end."); } /** @@ -507,7 +507,7 @@ void MainThread::ScheduleCleanAbility(const sptr &token) */ void MainThread::ScheduleProfileChanged(const Profile &profile) { - APP_LOGI("MainThread::scheduleProfileChanged profile name: %{public}s", profile.GetName().c_str()); + HILOG_INFO("MainThread::scheduleProfileChanged profile name: %{public}s", profile.GetName().c_str()); } /** @@ -519,20 +519,20 @@ void MainThread::ScheduleProfileChanged(const Profile &profile) */ void MainThread::ScheduleConfigurationUpdated(const Configuration &config) { - APP_LOGI("MainThread::ScheduleConfigurationUpdated called start."); + HILOG_INFO("MainThread::ScheduleConfigurationUpdated called start."); wptr weak = this; auto task = [weak, config]() { auto appThread = weak.promote(); if (appThread == nullptr) { - APP_LOGE("appThread is nullptr, HandleConfigurationUpdated failed."); + HILOG_ERROR("appThread is nullptr, HandleConfigurationUpdated failed."); return; } appThread->HandleConfigurationUpdated(config); }; if (!mainHandler_->PostTask(task)) { - APP_LOGE("MainThread::ScheduleConfigurationUpdated PostTask task failed"); + HILOG_ERROR("MainThread::ScheduleConfigurationUpdated PostTask task failed"); } - APP_LOGI("MainThread::ScheduleConfigurationUpdated called end."); + HILOG_INFO("MainThread::ScheduleConfigurationUpdated called end."); } /** @@ -545,22 +545,22 @@ void MainThread::ScheduleConfigurationUpdated(const Configuration &config) */ bool MainThread::CheckLaunchApplicationParam(const AppLaunchData &appLaunchData) const { - APP_LOGI("MainThread::CheckLaunchApplicationParam called start."); + HILOG_INFO("MainThread::CheckLaunchApplicationParam called start."); ApplicationInfo appInfo = appLaunchData.GetApplicationInfo(); ProcessInfo processInfo = appLaunchData.GetProcessInfo(); if (appInfo.name.empty()) { - APP_LOGE("MainThread::checkLaunchApplicationParam applicationName is empty"); + HILOG_ERROR("MainThread::checkLaunchApplicationParam applicationName is empty"); return false; } if (processInfo.GetProcessName().empty()) { - APP_LOGE("MainThread::checkLaunchApplicationParam processName is empty"); + HILOG_ERROR("MainThread::checkLaunchApplicationParam processName is empty"); return false; } - APP_LOGI("MainThread::CheckLaunchApplicationParam called end."); + HILOG_INFO("MainThread::CheckLaunchApplicationParam called end."); return true; } @@ -574,9 +574,9 @@ bool MainThread::CheckLaunchApplicationParam(const AppLaunchData &appLaunchData) */ bool MainThread::CheckAbilityItem(const std::shared_ptr &record) const { - APP_LOGI("MainThread::CheckAbilityItem called start."); + HILOG_INFO("MainThread::CheckAbilityItem called start."); if (record == nullptr) { - APP_LOGE("MainThread::checkAbilityItem record is null"); + HILOG_ERROR("MainThread::checkAbilityItem record is null"); return false; } @@ -584,16 +584,16 @@ bool MainThread::CheckAbilityItem(const std::shared_ptr &rec sptr token = record->GetToken(); if (abilityInfo == nullptr) { - APP_LOGE("MainThread::checkAbilityItem abilityInfo is null"); + HILOG_ERROR("MainThread::checkAbilityItem abilityInfo is null"); return false; } if (token == nullptr) { - APP_LOGE("MainThread::checkAbilityItem token is null"); + HILOG_ERROR("MainThread::checkAbilityItem token is null"); return false; } - APP_LOGI("MainThread::CheckAbilityItem called end."); + HILOG_INFO("MainThread::CheckAbilityItem called end."); return true; } @@ -604,17 +604,17 @@ bool MainThread::CheckAbilityItem(const std::shared_ptr &rec */ void MainThread::HandleTerminateApplicationLocal() { - APP_LOGI("MainThread::HandleTerminateApplicationLocal called start."); + HILOG_INFO("MainThread::HandleTerminateApplicationLocal called start."); if (application_ == nullptr) { - APP_LOGE("MainThread::HandleTerminateApplicationLocal error!"); + HILOG_ERROR("MainThread::HandleTerminateApplicationLocal error!"); return; } - APP_LOGI("MainThread::HandleTerminateApplicationLocal before PerformTerminateStrong."); + HILOG_INFO("MainThread::HandleTerminateApplicationLocal before PerformTerminateStrong."); applicationImpl_->PerformTerminateStrong(); - APP_LOGI("MainThread::HandleTerminateApplicationLocal after PerformTerminateStrong."); + HILOG_INFO("MainThread::HandleTerminateApplicationLocal after PerformTerminateStrong."); std::shared_ptr runner = mainHandler_->GetEventRunner(); if (runner == nullptr) { - APP_LOGE("MainThread::HandleTerminateApplicationLocal get manHandler error"); + HILOG_ERROR("MainThread::HandleTerminateApplicationLocal get manHandler error"); return; } @@ -623,25 +623,25 @@ void MainThread::HandleTerminateApplicationLocal() } int ret = runner->Stop(); if (ret != ERR_OK) { - APP_LOGE("MainThread::HandleTerminateApplicationLocal failed. runner->Run failed ret = %{public}d", ret); + HILOG_ERROR("MainThread::HandleTerminateApplicationLocal failed. runner->Run failed ret = %{public}d", ret); } - APP_LOGI("runner is stopped"); + HILOG_INFO("runner is stopped"); SetRunnerStarted(false); #ifdef ABILITY_LIBRARY_LOADER - APP_LOGI("MainThread::HandleTerminateApplicationLocal called. Start calling CloseAbilityLibrary."); + HILOG_INFO("MainThread::HandleTerminateApplicationLocal called. Start calling CloseAbilityLibrary."); CloseAbilityLibrary(); - APP_LOGI("MainThread::HandleTerminateApplicationLocal called. End calling CloseAbilityLibrary."); + HILOG_INFO("MainThread::HandleTerminateApplicationLocal called. End calling CloseAbilityLibrary."); #endif // ABILITY_LIBRARY_LOADER #ifdef APPLICATION_LIBRARY_LOADER if (handleAppLib_ != nullptr) { - APP_LOGI("MainThread::HandleTerminateApplicationLocal called. Start calling dlclose."); + HILOG_INFO("MainThread::HandleTerminateApplicationLocal called. Start calling dlclose."); dlclose(handleAppLib_); - APP_LOGI("MainThread::HandleTerminateApplicationLocal called. End calling dlclose."); + HILOG_INFO("MainThread::HandleTerminateApplicationLocal called. End calling dlclose."); handleAppLib_ = nullptr; } #endif // APPLICATION_LIBRARY_LOADER - APP_LOGI("MainThread::HandleTerminateApplicationLocal called end."); + HILOG_INFO("MainThread::HandleTerminateApplicationLocal called end."); } /** @@ -652,9 +652,9 @@ void MainThread::HandleTerminateApplicationLocal() void MainThread::HandleProcessSecurityExit() { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("MainThread::HandleProcessSecurityExit called start."); + HILOG_INFO("MainThread::HandleProcessSecurityExit called start."); if (abilityRecordMgr_ == nullptr) { - APP_LOGE("MainThread::HandleProcessSecurityExit abilityRecordMgr_ is null"); + HILOG_ERROR("MainThread::HandleProcessSecurityExit abilityRecordMgr_ is null"); return; } @@ -665,7 +665,7 @@ void MainThread::HandleProcessSecurityExit() } HandleTerminateApplicationLocal(); - APP_LOGI("MainThread::HandleProcessSecurityExit called end."); + HILOG_INFO("MainThread::HandleProcessSecurityExit called end."); } bool MainThread::InitCreate( @@ -674,37 +674,37 @@ bool MainThread::InitCreate( BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); applicationInfo_ = std::make_shared(appInfo); if (applicationInfo_ == nullptr) { - APP_LOGE("MainThread::InitCreate create applicationInfo_ failed"); + HILOG_ERROR("MainThread::InitCreate create applicationInfo_ failed"); return false; } processInfo_ = std::make_shared(processInfo); if (processInfo_ == nullptr) { - APP_LOGE("MainThread::InitCreate create processInfo_ failed"); + HILOG_ERROR("MainThread::InitCreate create processInfo_ failed"); return false; } appProfile_ = std::make_shared(appProfile); if (appProfile_ == nullptr) { - APP_LOGE("MainThread::InitCreate create appProfile_ failed"); + HILOG_ERROR("MainThread::InitCreate create appProfile_ failed"); return false; } applicationImpl_ = std::make_shared(); if (applicationImpl_ == nullptr) { - APP_LOGE("MainThread::InitCreate create applicationImpl_ failed"); + HILOG_ERROR("MainThread::InitCreate create applicationImpl_ failed"); return false; } abilityRecordMgr_ = std::make_shared(); if (abilityRecordMgr_ == nullptr) { - APP_LOGE("MainThread::InitCreate create AbilityRecordMgr failed"); + HILOG_ERROR("MainThread::InitCreate create AbilityRecordMgr failed"); return false; } contextDeal = std::make_shared(); if (contextDeal == nullptr) { - APP_LOGE("MainThread::InitCreate create contextDeal failed"); + HILOG_ERROR("MainThread::InitCreate create contextDeal failed"); return false; } @@ -723,12 +723,12 @@ bool MainThread::InitCreate( bool MainThread::CheckForHandleLaunchApplication(const AppLaunchData &appLaunchData) { if (application_ != nullptr) { - APP_LOGE("MainThread::handleLaunchApplication already create application"); + HILOG_ERROR("MainThread::handleLaunchApplication already create application"); return false; } if (!CheckLaunchApplicationParam(appLaunchData)) { - APP_LOGE("MainThread::handleLaunchApplication appLaunchData invalid"); + HILOG_ERROR("MainThread::handleLaunchApplication appLaunchData invalid"); return false; } return true; @@ -739,45 +739,45 @@ bool MainThread::InitResourceManager(std::shared_ptr resPaths; ChangeToLocalPath(bundleInfo.name, bundleInfo.moduleResPaths, resPaths); for (auto moduleResPath : resPaths) { if (!moduleResPath.empty()) { - APP_LOGI("MainThread::handleLaunchApplication length: %{public}zu, moduleResPath: %{public}s", + HILOG_INFO("MainThread::handleLaunchApplication length: %{public}zu, moduleResPath: %{public}s", moduleResPath.length(), moduleResPath.c_str()); - APP_LOGI("MainThread::handleLaunchApplication. before resourceManager->AddResource."); + HILOG_INFO("MainThread::handleLaunchApplication. before resourceManager->AddResource."); if (!resourceManager->AddResource(moduleResPath.c_str())) { - APP_LOGE("MainThread::handleLaunchApplication AddResource failed"); + HILOG_ERROR("MainThread::handleLaunchApplication AddResource failed"); } - APP_LOGI("MainThread::handleLaunchApplication. after resourceManager->AddResource."); + HILOG_INFO("MainThread::handleLaunchApplication. after resourceManager->AddResource."); } } - APP_LOGI("MainThread::handleLaunchApplication moduleResPaths end."); - APP_LOGI("MainThread::handleLaunchApplication before Resource::CreateResConfig."); + HILOG_INFO("MainThread::handleLaunchApplication moduleResPaths end."); + HILOG_INFO("MainThread::handleLaunchApplication before Resource::CreateResConfig."); std::unique_ptr resConfig(Global::Resource::CreateResConfig()); - APP_LOGI("MainThread::handleLaunchApplication after Resource::CreateResConfig."); + HILOG_INFO("MainThread::handleLaunchApplication after Resource::CreateResConfig."); UErrorCode status = U_ZERO_ERROR; icu::Locale locale = icu::Locale::forLanguageTag(Global::I18n::LocaleConfig::GetSystemLanguage(), status); resConfig->SetLocaleInfo(locale); const icu::Locale *localeInfo = resConfig->GetLocaleInfo(); if (localeInfo != nullptr) { - APP_LOGI("MainThread::handleLaunchApplication language: %{public}s, script: %{public}s, region: %{public}s,", + HILOG_INFO("MainThread::handleLaunchApplication language: %{public}s, script: %{public}s, region: %{public}s,", localeInfo->getLanguage(), localeInfo->getScript(), localeInfo->getCountry()); } else { - APP_LOGI("MainThread::handleLaunchApplication localeInfo is nullptr."); + HILOG_INFO("MainThread::handleLaunchApplication localeInfo is nullptr."); } std::string colormode = config.GetItem(GlobalConfigurationKey::SYSTEM_COLORMODE); resConfig->SetColorMode(ConvertColorMode(colormode)); - APP_LOGI("MainThread::handleLaunchApplication. Start calling UpdateResConfig."); + HILOG_INFO("MainThread::handleLaunchApplication. Start calling UpdateResConfig."); resourceManager->UpdateResConfig(*resConfig); - APP_LOGI("MainThread::handleLaunchApplication. End calling UpdateResConfig."); + HILOG_INFO("MainThread::handleLaunchApplication. End calling UpdateResConfig."); return true; } /** @@ -790,9 +790,9 @@ bool MainThread::InitResourceManager(std::shared_ptr localPaths; @@ -807,14 +807,14 @@ void MainThread::HandleLaunchApplication(const AppLaunchData &appLaunchData, con std::shared_ptr contextDeal = nullptr; if (!InitCreate(contextDeal, appInfo, processInfo, appProfile)) { - APP_LOGE("MainThread::handleLaunchApplication InitCreate failed"); + HILOG_ERROR("MainThread::handleLaunchApplication InitCreate failed"); return; } // get application shared point application_ = std::shared_ptr(ApplicationLoader::GetInstance().GetApplicationByName()); if (application_ == nullptr) { - APP_LOGE("HandleLaunchApplication::application launch failed"); + HILOG_ERROR("HandleLaunchApplication::application launch failed"); return; } applicationForAnr_ = application_; @@ -822,27 +822,27 @@ void MainThread::HandleLaunchApplication(const AppLaunchData &appLaunchData, con // init resourceManager. std::shared_ptr resourceManager(Global::Resource::CreateResourceManager()); if (resourceManager == nullptr) { - APP_LOGE("MainThread::handleLaunchApplication create resourceManager failed"); + HILOG_ERROR("MainThread::handleLaunchApplication create resourceManager failed"); return; } - APP_LOGI("MainThread::handleLaunchApplication. Start calling GetBundleManager."); + HILOG_INFO("MainThread::handleLaunchApplication. Start calling GetBundleManager."); sptr bundleMgr = contextDeal->GetBundleManager(); if (bundleMgr == nullptr) { - APP_LOGE("MainThread::handleLaunchApplication GetBundleManager is nullptr"); + HILOG_ERROR("MainThread::handleLaunchApplication GetBundleManager is nullptr"); return; } - APP_LOGI("MainThread::handleLaunchApplication. End calling GetBundleManager."); + HILOG_INFO("MainThread::handleLaunchApplication. End calling GetBundleManager."); BundleInfo bundleInfo; - APP_LOGI("MainThread::handleLaunchApplication length: %{public}zu, bundleName: %{public}s", + HILOG_INFO("MainThread::handleLaunchApplication length: %{public}zu, bundleName: %{public}s", appInfo.bundleName.length(), appInfo.bundleName.c_str()); if (!bundleMgr->GetBundleInfo(appInfo.bundleName, BundleFlag::GET_BUNDLE_DEFAULT, bundleInfo, UNSPECIFIED_USERID)) { - APP_LOGD("MainThread::handleLaunchApplication GetBundleInfo fail."); + HILOG_DEBUG("MainThread::handleLaunchApplication GetBundleInfo fail."); } if (!InitResourceManager(resourceManager, contextDeal, appInfo, bundleInfo, config)) { - APP_LOGE("MainThread::handleLaunchApplication InitResourceManager failed"); + HILOG_ERROR("MainThread::handleLaunchApplication InitResourceManager failed"); return; } @@ -859,7 +859,7 @@ void MainThread::HandleLaunchApplication(const AppLaunchData &appLaunchData, con moduelJson = bundleInfo.hapModuleInfos.back().isModuleJson; isStageBased = bundleInfo.hapModuleInfos.back().isStageBasedModel; } - APP_LOGI("stageBased:%{public}d moduleJson:%{public}d size:%{public}d", + HILOG_INFO("stageBased:%{public}d moduleJson:%{public}d size:%{public}d", isStageBased, moduelJson, (int32_t)bundleInfo.hapModuleInfos.size()); if (isStageBased) { @@ -874,12 +874,12 @@ void MainThread::HandleLaunchApplication(const AppLaunchData &appLaunchData, con } std::string libPath = LOCAL_CODE_PATH; libPath += (libPath.back() == '/') ? nativeLibraryPath : "/" + nativeLibraryPath; - APP_LOGI("napi lib path = %{private}s", libPath.c_str()); + HILOG_INFO("napi lib path = %{private}s", libPath.c_str()); options.packagePath = libPath; } auto runtime = AbilityRuntime::Runtime::Create(options); if (!runtime) { - APP_LOGE("OHOSApplication::OHOSApplication: Failed to create runtime"); + HILOG_ERROR("OHOSApplication::OHOSApplication: Failed to create runtime"); return; } auto& jsEngine = (static_cast(*runtime)).GetNativeEngine(); @@ -889,33 +889,33 @@ void MainThread::HandleLaunchApplication(const AppLaunchData &appLaunchData, con auto processPid = processInfo.GetPid(); wptr weak = this; auto uncaughtTask = [weak, uid, processPid, bundleName, processName](NativeValue* v) { - APP_LOGI("RegisterUncaughtExceptionHandler Begin"); + HILOG_INFO("RegisterUncaughtExceptionHandler Begin"); NativeObject* obj = AbilityRuntime::ConvertNativeValueTo(v); NativeValue* message = obj->GetProperty("message"); NativeString* messageStr = AbilityRuntime::ConvertNativeValueTo(message); if (messageStr == nullptr) { - APP_LOGE("messageStr Convert failed"); + HILOG_ERROR("messageStr Convert failed"); return; } size_t messagebufferLen = messageStr->GetLength(); size_t messagestrLen = 0; char* messagecap = new char[messagebufferLen + 1]; messageStr->GetCString(messagecap, messagebufferLen + 1, &messagestrLen); - APP_LOGI("messagecap = %{public}s", messagecap); + HILOG_INFO("messagecap = %{public}s", messagecap); NativeValue* stack = obj->GetProperty("stack"); NativeString* stackStr = AbilityRuntime::ConvertNativeValueTo(stack); if (stackStr == nullptr) { - APP_LOGE("stackStr Convert failed"); + HILOG_ERROR("stackStr Convert failed"); return; } size_t stackbufferLen = stackStr->GetLength(); size_t stackstrLen = 0; char* stackcap = new char[stackbufferLen + 1]; stackStr->GetCString(stackcap, stackbufferLen + 1, &stackstrLen); - APP_LOGI("stackcap = %{public}s", stackcap); + HILOG_INFO("stackcap = %{public}s", stackcap); auto appThread = weak.promote(); if (appThread == nullptr) { - APP_LOGE("appThread is nullptr, HandleLaunchApplication failed."); + HILOG_ERROR("appThread is nullptr, HandleLaunchApplication failed."); return; } std::string eventType = "JS_EXCEPTION"; @@ -937,7 +937,7 @@ void MainThread::HandleLaunchApplication(const AppLaunchData &appLaunchData, con EVENT_KEY_PROCESS_NAME, processName, EVENT_KEY_MESSAGE, msgContent); appThread->ScheduleProcessSecurityExit(); - APP_LOGI("RegisterUncaughtExceptionHandler End ret = %{public}d", ret); + HILOG_INFO("RegisterUncaughtExceptionHandler End ret = %{public}d", ret); }; jsEngine.RegisterUncaughtExceptionHandler(uncaughtTask); application_->SetRuntime(std::move(runtime)); @@ -966,7 +966,7 @@ void MainThread::HandleLaunchApplication(const AppLaunchData &appLaunchData, con auto usertestInfo = appLaunchData.GetUserTestInfo(); if (usertestInfo) { if (!PrepareAbilityDelegator(usertestInfo)) { - APP_LOGE("Failed to prepare ability delegator"); + HILOG_ERROR("Failed to prepare ability delegator"); return; } } @@ -981,22 +981,22 @@ void MainThread::HandleLaunchApplication(const AppLaunchData &appLaunchData, con applicationImpl_->SetRecordId(appLaunchData.GetRecordId()); applicationImpl_->SetApplication(application_); mainThreadState_ = MainThreadState::READY; - APP_LOGI("MainThread::handleLaunchApplication before PerformAppReady."); + HILOG_INFO("MainThread::handleLaunchApplication before PerformAppReady."); if (!applicationImpl_->PerformAppReady()) { - APP_LOGE("HandleLaunchApplication::application applicationImpl_->PerformAppReady failed"); + HILOG_ERROR("HandleLaunchApplication::application applicationImpl_->PerformAppReady failed"); return; } - APP_LOGI("MainThread::handleLaunchApplication after PerformAppReady."); + HILOG_INFO("MainThread::handleLaunchApplication after PerformAppReady."); // L1 needs to add corresponding interface ApplicationEnvImpl *pAppEvnIml = ApplicationEnvImpl::GetInstance(); if (pAppEvnIml) { pAppEvnIml->SetAppInfo(*applicationInfo_.get()); } else { - APP_LOGE("HandleLaunchApplication::application pAppEvnIml is null"); + HILOG_ERROR("HandleLaunchApplication::application pAppEvnIml is null"); } - APP_LOGI("MainThread::handleLaunchApplication called end."); + HILOG_INFO("MainThread::handleLaunchApplication called end."); } void MainThread::ChangeToLocalPath(const std::string &bundleName, @@ -1014,21 +1014,21 @@ void MainThread::ChangeToLocalPath(const std::string &bundleName, void MainThread::HandleAbilityStage(const HapModuleInfo &abilityStage) { - APP_LOGI("MainThread::HandleAbilityStageInfo"); + HILOG_INFO("MainThread::HandleAbilityStageInfo"); if (!application_) { - APP_LOGE("application_ is nullptr"); + HILOG_ERROR("application_ is nullptr"); return; } application_->AddAbilityStage(abilityStage); if (!appMgr_ || !applicationImpl_) { - APP_LOGE("appMgr_ is nullptr"); + HILOG_ERROR("appMgr_ is nullptr"); return; } if (!appMgr_ || !applicationImpl_) { - APP_LOGE("appMgr_ is nullptr"); + HILOG_ERROR("appMgr_ is nullptr"); return; } appMgr_->AddAbilityStageDone(applicationImpl_->GetRecordId()); @@ -1037,13 +1037,13 @@ void MainThread::HandleAbilityStage(const HapModuleInfo &abilityStage) void MainThread::LoadAndRegisterExtension(const std::string &libName, const std::string &extensionName, const std::unique_ptr& runtime) { - APP_LOGI("MainThread::LoadAndRegisterExtension.libName:%{public}s,extensionName:%{public}s,", + HILOG_INFO("MainThread::LoadAndRegisterExtension.libName:%{public}s,extensionName:%{public}s,", libName.c_str(), extensionName.c_str()); if (application_ == nullptr) { - APP_LOGE("LoadAndRegisterExtension::application launch failed"); + HILOG_ERROR("LoadAndRegisterExtension::application launch failed"); return; } - APP_LOGI("MainThread::LoadAndRegisterExtension load success."); + HILOG_INFO("MainThread::LoadAndRegisterExtension load success."); AbilityLoader::GetInstance().RegisterExtension(extensionName, [application = application_, libName]() { return AbilityRuntime::ExtensionModuleLoader::GetLoader(libName.c_str()).Create(application->GetRuntime()); }); @@ -1051,18 +1051,18 @@ void MainThread::LoadAndRegisterExtension(const std::string &libName, bool MainThread::PrepareAbilityDelegator(const std::shared_ptr &record) { - APP_LOGI("enter"); + HILOG_INFO("enter"); if (!record) { - APP_LOGE("Invalid UserTestRecord"); + HILOG_ERROR("Invalid UserTestRecord"); return false; } auto args = std::make_shared(record->want); if (!args) { - APP_LOGE("args is null"); + HILOG_ERROR("args is null"); return false; } if (application_->GetRuntime() == nullptr) { // FA model - APP_LOGI("PrepareAbilityDelegator for FA model."); + HILOG_INFO("PrepareAbilityDelegator for FA model."); AbilityRuntime::Runtime::Options options; options.codePath = LOCAL_CODE_PATH; options.eventRunner = mainHandler_->GetEventRunner(); @@ -1073,7 +1073,7 @@ bool MainThread::PrepareAbilityDelegator(const std::shared_ptr & AbilityDelegatorRegistry::RegisterInstance(delegator, args); delegator->Prepare(); } else { // Stage model - APP_LOGI("PrepareAbilityDelegator for Stage model."); + HILOG_INFO("PrepareAbilityDelegator for Stage model."); auto testRunner = TestRunner::Create(application_->GetRuntime(), args); auto delegator = std::make_shared( application_->GetAppContext(), std::move(testRunner), record->observer); @@ -1093,26 +1093,26 @@ bool MainThread::PrepareAbilityDelegator(const std::shared_ptr & void MainThread::HandleLaunchAbility(const std::shared_ptr &abilityRecord) { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("MainThread::handleLaunchAbility called start."); + HILOG_INFO("MainThread::handleLaunchAbility called start."); if (applicationImpl_ == nullptr) { - APP_LOGE("MainThread::HandleLaunchAbility applicationImpl_ is null"); + HILOG_ERROR("MainThread::HandleLaunchAbility applicationImpl_ is null"); return; } if (abilityRecordMgr_ == nullptr) { - APP_LOGE("MainThread::HandleLaunchAbility abilityRecordMgr_ is null"); + HILOG_ERROR("MainThread::HandleLaunchAbility abilityRecordMgr_ is null"); return; } if (abilityRecord == nullptr) { - APP_LOGE("MainThread::HandleLaunchAbility parameter(abilityRecord) is null"); + HILOG_ERROR("MainThread::HandleLaunchAbility parameter(abilityRecord) is null"); return; } auto abilityToken = abilityRecord->GetToken(); if (abilityToken == nullptr) { - APP_LOGE("MainThread::HandleLaunchAbility failed. abilityRecord->GetToken failed"); + HILOG_ERROR("MainThread::HandleLaunchAbility failed. abilityRecord->GetToken failed"); return; } @@ -1120,12 +1120,12 @@ void MainThread::HandleLaunchAbility(const std::shared_ptr & abilityRecordMgr_->AddAbilityRecord(abilityToken, abilityRecord); if (!IsApplicationReady()) { - APP_LOGE("MainThread::handleLaunchAbility not init OHOSApplication, should launch application first"); + HILOG_ERROR("MainThread::handleLaunchAbility not init OHOSApplication, should launch application first"); return; } if (!CheckAbilityItem(abilityRecord)) { - APP_LOGE("MainThread::handleLaunchAbility record is invalid"); + HILOG_ERROR("MainThread::handleLaunchAbility record is invalid"); return; } @@ -1157,28 +1157,28 @@ void MainThread::HandleLaunchAbility(const std::shared_ptr & */ void MainThread::HandleCleanAbilityLocal(const sptr &token) { - APP_LOGI("MainThread::HandleCleanAbilityLocal called start."); + HILOG_INFO("MainThread::HandleCleanAbilityLocal called start."); if (!IsApplicationReady()) { - APP_LOGE("MainThread::HandleCleanAbilityLocal not init OHOSApplication, should launch application first"); + HILOG_ERROR("MainThread::HandleCleanAbilityLocal not init OHOSApplication, should launch application first"); return; } if (token == nullptr) { - APP_LOGE("MainThread::HandleCleanAbilityLocal token is null"); + HILOG_ERROR("MainThread::HandleCleanAbilityLocal token is null"); return; } std::shared_ptr record = abilityRecordMgr_->GetAbilityItem(token); if (record == nullptr) { - APP_LOGE("MainThread::HandleCleanAbilityLocal abilityRecord not found"); + HILOG_ERROR("MainThread::HandleCleanAbilityLocal abilityRecord not found"); return; } std::shared_ptr abilityInfo = record->GetAbilityInfo(); if (abilityInfo == nullptr) { - APP_LOGE("MainThread::HandleCleanAbilityLocal record->GetAbilityInfo() failed"); + HILOG_ERROR("MainThread::HandleCleanAbilityLocal record->GetAbilityInfo() failed"); return; } - APP_LOGI("MainThread::HandleCleanAbilityLocal ability name: %{public}s", abilityInfo->name.c_str()); + HILOG_INFO("MainThread::HandleCleanAbilityLocal ability name: %{public}s", abilityInfo->name.c_str()); abilityRecordMgr_->RemoveAbilityRecord(token); #ifdef APP_ABILITY_USE_TWO_RUNNER @@ -1186,14 +1186,14 @@ void MainThread::HandleCleanAbilityLocal(const sptr &token) if (runner != nullptr) { int ret = runner->Stop(); if (ret != ERR_OK) { - APP_LOGE("MainThread::main failed. ability runner->Run failed ret = %{public}d", ret); + HILOG_ERROR("MainThread::main failed. ability runner->Run failed ret = %{public}d", ret); } abilityRecordMgr_->RemoveAbilityRecord(token); } else { - APP_LOGW("MainThread::HandleCleanAbilityLocal runner not found"); + HILOG_WARN("MainThread::HandleCleanAbilityLocal runner not found"); } #endif - APP_LOGI("MainThread::HandleCleanAbilityLocal called end."); + HILOG_INFO("MainThread::HandleCleanAbilityLocal called end."); } /** @@ -1206,28 +1206,28 @@ void MainThread::HandleCleanAbilityLocal(const sptr &token) void MainThread::HandleCleanAbility(const sptr &token) { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("MainThread::handleCleanAbility called start."); + HILOG_INFO("MainThread::handleCleanAbility called start."); if (!IsApplicationReady()) { - APP_LOGE("MainThread::handleCleanAbility not init OHOSApplication, should launch application first"); + HILOG_ERROR("MainThread::handleCleanAbility not init OHOSApplication, should launch application first"); return; } if (token == nullptr) { - APP_LOGE("MainThread::handleCleanAbility token is null"); + HILOG_ERROR("MainThread::handleCleanAbility token is null"); return; } std::shared_ptr record = abilityRecordMgr_->GetAbilityItem(token); if (record == nullptr) { - APP_LOGE("MainThread::handleCleanAbility abilityRecord not found"); + HILOG_ERROR("MainThread::handleCleanAbility abilityRecord not found"); return; } std::shared_ptr abilityInfo = record->GetAbilityInfo(); if (abilityInfo == nullptr) { - APP_LOGE("MainThread::handleCleanAbility record->GetAbilityInfo() failed"); + HILOG_ERROR("MainThread::handleCleanAbility record->GetAbilityInfo() failed"); return; } - APP_LOGI("MainThread::handleCleanAbility ability name: %{public}s", abilityInfo->name.c_str()); + HILOG_INFO("MainThread::handleCleanAbility ability name: %{public}s", abilityInfo->name.c_str()); abilityRecordMgr_->RemoveAbilityRecord(token); #ifdef APP_ABILITY_USE_TWO_RUNNER @@ -1235,17 +1235,17 @@ void MainThread::HandleCleanAbility(const sptr &token) if (runner != nullptr) { int ret = runner->Stop(); if (ret != ERR_OK) { - APP_LOGE("MainThread::main failed. ability runner->Run failed ret = %{public}d", ret); + HILOG_ERROR("MainThread::main failed. ability runner->Run failed ret = %{public}d", ret); } abilityRecordMgr_->RemoveAbilityRecord(token); } else { - APP_LOGW("MainThread::handleCleanAbility runner not found"); + HILOG_WARN("MainThread::handleCleanAbility runner not found"); } #endif - APP_LOGI("MainThread::handleCleanAbility before AbilityCleaned."); + HILOG_INFO("MainThread::handleCleanAbility before AbilityCleaned."); appMgr_->AbilityCleaned(token); - APP_LOGI("MainThread::handleCleanAbility after AbilityCleaned."); - APP_LOGI("MainThread::handleCleanAbility called end."); + HILOG_INFO("MainThread::handleCleanAbility after AbilityCleaned."); + HILOG_INFO("MainThread::handleCleanAbility called end."); } /** @@ -1256,21 +1256,21 @@ void MainThread::HandleCleanAbility(const sptr &token) void MainThread::HandleForegroundApplication() { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("MainThread::handleForegroundApplication called start."); + HILOG_INFO("MainThread::handleForegroundApplication called start."); if ((application_ == nullptr) || (appMgr_ == nullptr)) { - APP_LOGE("MainThread::handleForegroundApplication error!"); + HILOG_ERROR("MainThread::handleForegroundApplication error!"); return; } if (!applicationImpl_->PerformForeground()) { - APP_LOGE("MainThread::handleForegroundApplication error!, applicationImpl_->PerformForeground() failed"); + HILOG_ERROR("MainThread::handleForegroundApplication error!, applicationImpl_->PerformForeground() failed"); return; } - APP_LOGI("MainThread::handleForegroundApplication before ApplicationForegrounded"); + HILOG_INFO("MainThread::handleForegroundApplication before ApplicationForegrounded"); appMgr_->ApplicationForegrounded(applicationImpl_->GetRecordId()); - APP_LOGI("MainThread::handleForegroundApplication after ApplicationForegrounded"); - APP_LOGI("MainThread::handleForegroundApplication called end"); + HILOG_INFO("MainThread::handleForegroundApplication after ApplicationForegrounded"); + HILOG_INFO("MainThread::handleForegroundApplication called end"); } /** @@ -1281,22 +1281,22 @@ void MainThread::HandleForegroundApplication() void MainThread::HandleBackgroundApplication() { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("MainThread::handleBackgroundApplication called start."); + HILOG_INFO("MainThread::handleBackgroundApplication called start."); if ((application_ == nullptr) || (appMgr_ == nullptr)) { - APP_LOGE("MainThread::handleBackgroundApplication error!"); + HILOG_ERROR("MainThread::handleBackgroundApplication error!"); return; } if (!applicationImpl_->PerformBackground()) { - APP_LOGE("MainThread::handleForegroundApplication error!, applicationImpl_->PerformBackground() failed"); + HILOG_ERROR("MainThread::handleForegroundApplication error!, applicationImpl_->PerformBackground() failed"); return; } - APP_LOGI("MainThread::handleBackgroundApplication before ApplicationBackgrounded"); + HILOG_INFO("MainThread::handleBackgroundApplication before ApplicationBackgrounded"); appMgr_->ApplicationBackgrounded(applicationImpl_->GetRecordId()); - APP_LOGI("MainThread::handleBackgroundApplication after ApplicationBackgrounded"); + HILOG_INFO("MainThread::handleBackgroundApplication after ApplicationBackgrounded"); - APP_LOGI("MainThread::handleBackgroundApplication called end"); + HILOG_INFO("MainThread::handleBackgroundApplication called end"); } /** @@ -1307,43 +1307,43 @@ void MainThread::HandleBackgroundApplication() void MainThread::HandleTerminateApplication() { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("MainThread::handleTerminateApplication called start."); + HILOG_INFO("MainThread::handleTerminateApplication called start."); if ((application_ == nullptr) || (appMgr_ == nullptr)) { - APP_LOGE("MainThread::handleTerminateApplication error!"); + HILOG_ERROR("MainThread::handleTerminateApplication error!"); return; } - APP_LOGI("MainThread::handleTerminateApplication before PerformTerminate"); + HILOG_INFO("MainThread::handleTerminateApplication before PerformTerminate"); if (!applicationImpl_->PerformTerminate()) { - APP_LOGE("MainThread::handleForegroundApplication error!, applicationImpl_->PerformTerminate() failed"); + HILOG_ERROR("MainThread::handleForegroundApplication error!, applicationImpl_->PerformTerminate() failed"); return; } - APP_LOGI("MainThread::handleTerminateApplication after PerformTerminate"); + HILOG_INFO("MainThread::handleTerminateApplication after PerformTerminate"); - APP_LOGI("MainThread::handleTerminateApplication before ApplicationTerminated"); + HILOG_INFO("MainThread::handleTerminateApplication before ApplicationTerminated"); appMgr_->ApplicationTerminated(applicationImpl_->GetRecordId()); - APP_LOGI("MainThread::handleTerminateApplication after ApplicationTerminated"); + HILOG_INFO("MainThread::handleTerminateApplication after ApplicationTerminated"); std::shared_ptr runner = mainHandler_->GetEventRunner(); if (runner == nullptr) { - APP_LOGE("MainThread::handleTerminateApplication get manHandler error"); + HILOG_ERROR("MainThread::handleTerminateApplication get manHandler error"); return; } if (watchDogHandler_ != nullptr) { watchDogHandler_->Stop(); } - APP_LOGI("MainThread::handleTerminateApplication before stop runner"); + HILOG_INFO("MainThread::handleTerminateApplication before stop runner"); int ret = runner->Stop(); - APP_LOGI("MainThread::handleTerminateApplication after stop runner"); + HILOG_INFO("MainThread::handleTerminateApplication after stop runner"); if (ret != ERR_OK) { - APP_LOGE("MainThread::handleTerminateApplication failed. runner->Run failed ret = %{public}d", ret); + HILOG_ERROR("MainThread::handleTerminateApplication failed. runner->Run failed ret = %{public}d", ret); } SetRunnerStarted(false); #ifdef ABILITY_LIBRARY_LOADER - APP_LOGI("MainThread::handleTerminateApplication. Start callint CloseAbilityLibrary."); + HILOG_INFO("MainThread::handleTerminateApplication. Start callint CloseAbilityLibrary."); CloseAbilityLibrary(); - APP_LOGI("MainThread::handleTerminateApplication. End callint CloseAbilityLibrary."); + HILOG_INFO("MainThread::handleTerminateApplication. End callint CloseAbilityLibrary."); #endif // ABILITY_LIBRARY_LOADER #ifdef APPLICATION_LIBRARY_LOADER if (handleAppLib_ != nullptr) { @@ -1351,7 +1351,7 @@ void MainThread::HandleTerminateApplication() handleAppLib_ = nullptr; } #endif // APPLICATION_LIBRARY_LOADER - APP_LOGI("MainThread::handleTerminateApplication called end."); + HILOG_INFO("MainThread::handleTerminateApplication called end."); } /** @@ -1364,15 +1364,15 @@ void MainThread::HandleTerminateApplication() void MainThread::HandleShrinkMemory(const int level) { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("MainThread::HandleShrinkMemory called start."); + HILOG_INFO("MainThread::HandleShrinkMemory called start."); if (applicationImpl_ == nullptr) { - APP_LOGE("MainThread::HandleShrinkMemory error! applicationImpl_ is null"); + HILOG_ERROR("MainThread::HandleShrinkMemory error! applicationImpl_ is null"); return; } applicationImpl_->PerformMemoryLevel(level); - APP_LOGI("MainThread::HandleShrinkMemory called end."); + HILOG_INFO("MainThread::HandleShrinkMemory called end."); } /** @@ -1385,27 +1385,27 @@ void MainThread::HandleShrinkMemory(const int level) void MainThread::HandleConfigurationUpdated(const Configuration &config) { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("MainThread::HandleConfigurationUpdated called start."); + HILOG_INFO("MainThread::HandleConfigurationUpdated called start."); if (applicationImpl_ == nullptr) { - APP_LOGE("MainThread::HandleConfigurationUpdated error! applicationImpl_ is null"); + HILOG_ERROR("MainThread::HandleConfigurationUpdated error! applicationImpl_ is null"); return; } applicationImpl_->PerformConfigurationUpdated(config); - APP_LOGI("MainThread::HandleConfigurationUpdated called end."); + HILOG_INFO("MainThread::HandleConfigurationUpdated called end."); } void MainThread::TaskTimeoutDetected(const std::shared_ptr &runner) { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("MainThread::TaskTimeoutDetected called start."); + HILOG_INFO("MainThread::TaskTimeoutDetected called start."); auto deliveryTimeoutCallback = []() { - APP_LOGI("MainThread::TaskTimeoutDetected delivery timeout"); + HILOG_INFO("MainThread::TaskTimeoutDetected delivery timeout"); }; auto distributeTimeoutCallback = []() { - APP_LOGI("MainThread::TaskTimeoutDetected distribute timeout"); + HILOG_INFO("MainThread::TaskTimeoutDetected distribute timeout"); }; if (runner !=nullptr && mainHandler_ != nullptr) { @@ -1415,67 +1415,67 @@ void MainThread::TaskTimeoutDetected(const std::shared_ptr &runner) runner->SetDistributeTimeout(DISTRIBUTE_TIME); mainHandler_->SetDistributeTimeoutCallback(distributeTimeoutCallback); } - APP_LOGI("MainThread::TaskTimeoutDetected called end."); + HILOG_INFO("MainThread::TaskTimeoutDetected called end."); } void MainThread::Init(const std::shared_ptr &runner, const std::shared_ptr &watchDogRunner) { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("MainThread:Init Start"); + HILOG_INFO("MainThread:Init Start"); mainHandler_ = std::make_shared(runner, this); watchDogHandler_ = std::make_shared(watchDogRunner); wptr weak = this; auto task = [weak]() { auto appThread = weak.promote(); if (appThread == nullptr) { - APP_LOGE("abilityThread is nullptr, SetRunnerStarted failed."); + HILOG_ERROR("abilityThread is nullptr, SetRunnerStarted failed."); return; } - APP_LOGI("MainThread:MainHandler Start"); + HILOG_INFO("MainThread:MainHandler Start"); appThread->SetRunnerStarted(true); }; auto taskWatchDog = []() { - APP_LOGI("MainThread:WatchDogHandler Start"); + HILOG_INFO("MainThread:WatchDogHandler Start"); }; if (!mainHandler_->PostTask(task)) { - APP_LOGE("MainThread::Init PostTask task failed"); + HILOG_ERROR("MainThread::Init PostTask task failed"); } if (!watchDogHandler_->PostTask(taskWatchDog)) { - APP_LOGE("MainThread::Init WatchDog postTask task failed"); + HILOG_ERROR("MainThread::Init WatchDog postTask task failed"); } TaskTimeoutDetected(runner); watchDogHandler_->Init(mainHandler_, watchDogHandler_); - APP_LOGI("MainThread:Init before CreateRunner."); + HILOG_INFO("MainThread:Init before CreateRunner."); TaskHandlerClient::GetInstance()->CreateRunner(); - APP_LOGI("MainThread:Init after CreateRunner."); - APP_LOGI("MainThread:Init end."); + HILOG_INFO("MainThread:Init after CreateRunner."); + HILOG_INFO("MainThread:Init end."); } void MainThread::HandleANRProcess(int sigMessage) { if (sigMessage == SIGUSR1) { - APP_LOGI("MainThread:HandleANRProcess start."); + HILOG_INFO("MainThread:HandleANRProcess start."); int rFD = -1; std::string mainThreadStackInfo; if ((rFD = RequestFileDescriptor(int32_t(FaultLoggerType::CPP_STACKTRACE))) < 0) { - APP_LOGE("MainThread::HandleANRProcess request file eescriptor failed"); + HILOG_ERROR("MainThread::HandleANRProcess request file eescriptor failed"); return; } auto jsRuntime = std::move((std::unique_ptr&)applicationForAnr_->GetRuntime()); if (jsRuntime != nullptr) { mainThreadStackInfo= jsRuntime->BuildNativeAndJsBackStackTrace(); if (write(rFD, mainThreadStackInfo.c_str(), mainThreadStackInfo.size()) != mainThreadStackInfo.size()) { - APP_LOGE("MainThread::HandleANRProcess write main thread stack info failed"); + HILOG_ERROR("MainThread::HandleANRProcess write main thread stack info failed"); } } OHOS::HiviewDFX::DfxDumpCatcher dumplog; std::string proStackInfo; if (dumplog.DumpCatch(getpid(), 0, proStackInfo) == false) { - APP_LOGE("MainThread::HandleANRProcess get process stack info failed"); + HILOG_ERROR("MainThread::HandleANRProcess get process stack info failed"); } if (write(rFD, proStackInfo.c_str(), proStackInfo.size()) != proStackInfo.size()) { - APP_LOGE("MainThread::HandleANRProcess write process stack info failed"); + HILOG_ERROR("MainThread::HandleANRProcess write process stack info failed"); } if (rFD != -1) { close(rFD); @@ -1486,46 +1486,46 @@ void MainThread::HandleANRProcess(int sigMessage) void MainThread::Start() { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("MainThread::main called start"); + HILOG_INFO("MainThread::main called start"); std::shared_ptr runner = EventRunner::GetMainEventRunner(); if (runner == nullptr) { - APP_LOGE("MainThread::main failed, runner is nullptr"); + HILOG_ERROR("MainThread::main failed, runner is nullptr"); return; } std::shared_ptr runnerWatchDog = EventRunner::Create("WatchDogRunner"); if (runnerWatchDog == nullptr) { - APP_LOGE("MainThread::Start runnerWatchDog is nullptr"); + HILOG_ERROR("MainThread::Start runnerWatchDog is nullptr"); return; } sptr thread = sptr(new (std::nothrow) MainThread()); if (thread == nullptr) { - APP_LOGE("MainThread::static failed. new MainThread failed"); + HILOG_ERROR("MainThread::static failed. new MainThread failed"); return; } - APP_LOGI("MainThread::main Register sig handle start"); + HILOG_INFO("MainThread::main Register sig handle start"); struct sigaction sigAct; sigemptyset(&sigAct.sa_mask); sigAct.sa_flags = 0; sigAct.sa_handler = &MainThread::HandleANRProcess; sigaction(SIGUSR1, &sigAct, NULL); - APP_LOGI("MainThread::main Register sig handle end"); + HILOG_INFO("MainThread::main Register sig handle end"); - APP_LOGI("MainThread::main called start Init"); + HILOG_INFO("MainThread::main called start Init"); thread->Init(runner, runnerWatchDog); - APP_LOGI("MainThread::main called end Init"); + HILOG_INFO("MainThread::main called end Init"); - APP_LOGI("MainThread::main called start Attach"); + HILOG_INFO("MainThread::main called start Attach"); thread->Attach(); - APP_LOGI("MainThread::main called end Attach"); + HILOG_INFO("MainThread::main called end Attach"); int ret = runner->Run(); if (ret != ERR_OK) { - APP_LOGE("MainThread::main failed. runner->Run failed ret = %{public}d", ret); + HILOG_ERROR("MainThread::main failed. runner->Run failed ret = %{public}d", ret); } thread->RemoveAppMgrDeathRecipient(); - APP_LOGI("MainThread::main runner stopped"); + HILOG_INFO("MainThread::main runner stopped"); } MainThread::MainHandler::MainHandler(const std::shared_ptr &runner, const sptr &thread) @@ -1559,13 +1559,13 @@ void MainThread::MainHandler::ProcessEvent(const OHOS::AppExecFwk::InnerEvent::P */ bool MainThread::IsApplicationReady() const { - APP_LOGI("MainThread::IsApplicationReady called start"); + HILOG_INFO("MainThread::IsApplicationReady called start"); if (application_ == nullptr || applicationImpl_ == nullptr) { - APP_LOGI("MainThread::IsApplicationReady called. application_=null or applicationImpl_=null"); + HILOG_INFO("MainThread::IsApplicationReady called. application_=null or applicationImpl_=null"); return false; } - APP_LOGI("MainThread::IsApplicationReady called end"); + HILOG_INFO("MainThread::IsApplicationReady called end"); return true; } @@ -1581,7 +1581,7 @@ void MainThread::LoadAbilityLibrary(const std::vector &libraryPaths { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); #ifdef ABILITY_LIBRARY_LOADER - APP_LOGI("MainThread::LoadAbilityLibrary called start"); + HILOG_INFO("MainThread::LoadAbilityLibrary called start"); #ifdef ACEABILITY_LIBRARY_LOADER #ifdef _ARM64_ std::string acelibdir("/system/lib64/libace.z.so"); @@ -1589,53 +1589,53 @@ void MainThread::LoadAbilityLibrary(const std::vector &libraryPaths std::string acelibdir("/system/lib/libace.z.so"); #endif void *AceAbilityLib = nullptr; - APP_LOGI("MainThread::LoadAbilityLibrary. Start calling dlopen acelibdir."); + HILOG_INFO("MainThread::LoadAbilityLibrary. Start calling dlopen acelibdir."); AceAbilityLib = dlopen(acelibdir.c_str(), RTLD_NOW | RTLD_GLOBAL); if (AceAbilityLib == nullptr) { - APP_LOGE("Fail to dlopen %{public}s, [%{public}s]", acelibdir.c_str(), dlerror()); + HILOG_ERROR("Fail to dlopen %{public}s, [%{public}s]", acelibdir.c_str(), dlerror()); } else { - APP_LOGI("Success to dlopen %{public}s", acelibdir.c_str()); + HILOG_INFO("Success to dlopen %{public}s", acelibdir.c_str()); handleAbilityLib_.emplace_back(AceAbilityLib); } - APP_LOGI("MainThread::LoadAbilityLibrary. End calling dlopen."); + HILOG_INFO("MainThread::LoadAbilityLibrary. End calling dlopen."); #endif // ACEABILITY_LIBRARY_LOADER int size = libraryPaths.size(); - APP_LOGI("MainThread::LoadAbilityLibrary. size=%{public}d.", size); + HILOG_INFO("MainThread::LoadAbilityLibrary. size=%{public}d.", size); for (int index = 0; index < size; index++) { std::string libraryPath = libraryPaths[index]; - APP_LOGI("MainThread::LoadAbilityLibrary Try to scanDir %{public}s", libraryPath.c_str()); + HILOG_INFO("MainThread::LoadAbilityLibrary Try to scanDir %{public}s", libraryPath.c_str()); if (!ScanDir(libraryPath)) { - APP_LOGE("MainThread::LoadAbilityLibrary scanDir %{public}s not exits", libraryPath.c_str()); + HILOG_ERROR("MainThread::LoadAbilityLibrary scanDir %{public}s not exits", libraryPath.c_str()); } libraryPath = libraryPath + "/libs"; if (!ScanDir(libraryPath)) { - APP_LOGE("MainThread::LoadAbilityLibrary scanDir %{public}s not exits", libraryPath.c_str()); + HILOG_ERROR("MainThread::LoadAbilityLibrary scanDir %{public}s not exits", libraryPath.c_str()); } } if (fileEntries_.empty()) { - APP_LOGE("No ability library"); + HILOG_ERROR("No ability library"); return; } void *handleAbilityLib = nullptr; for (auto fileEntry : fileEntries_) { if (!fileEntry.empty()) { - APP_LOGI("MainThread::LoadAbilityLibrary. Start calling dlopen fileEntry."); + HILOG_INFO("MainThread::LoadAbilityLibrary. Start calling dlopen fileEntry."); handleAbilityLib = dlopen(fileEntry.c_str(), RTLD_NOW | RTLD_GLOBAL); - APP_LOGI("MainThread::LoadAbilityLibrary. End calling dlopen fileEntry."); + HILOG_INFO("MainThread::LoadAbilityLibrary. End calling dlopen fileEntry."); if (handleAbilityLib == nullptr) { - APP_LOGE("MainThread::LoadAbilityLibrary Fail to dlopen %{public}s, [%{public}s]", + HILOG_ERROR("MainThread::LoadAbilityLibrary Fail to dlopen %{public}s, [%{public}s]", fileEntry.c_str(), dlerror()); exit(-1); } else { - APP_LOGI("MainThread::LoadAbilityLibrary Success to dlopen %{public}s", fileEntry.c_str()); + HILOG_INFO("MainThread::LoadAbilityLibrary Success to dlopen %{public}s", fileEntry.c_str()); } handleAbilityLib_.emplace_back(handleAbilityLib); } } - APP_LOGI("MainThread::LoadAbilityLibrary called end."); + HILOG_INFO("MainThread::LoadAbilityLibrary called end."); #endif // ABILITY_LIBRARY_LOADER } @@ -1644,13 +1644,13 @@ void MainThread::LoadAppLibrary() BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); #ifdef APPLICATION_LIBRARY_LOADER std::string appPath = applicationLibraryPath; - APP_LOGI("MainThread::handleLaunchApplication Start calling dlopen. appPath=%{public}s", appPath.c_str()); + HILOG_INFO("MainThread::handleLaunchApplication Start calling dlopen. appPath=%{public}s", appPath.c_str()); handleAppLib_ = dlopen(appPath.c_str(), RTLD_NOW | RTLD_GLOBAL); if (handleAppLib_ == nullptr) { - APP_LOGE("Fail to dlopen %{public}s, [%{public}s]", appPath.c_str(), dlerror()); + HILOG_ERROR("Fail to dlopen %{public}s, [%{public}s]", appPath.c_str(), dlerror()); exit(-1); } - APP_LOGI("MainThread::handleLaunchApplication End calling dlopen."; + HILOG_INFO("MainThread::handleLaunchApplication End calling dlopen."; #endif // APPLICATION_LIBRARY_LOADER } @@ -1661,18 +1661,18 @@ void MainThread::LoadAppLibrary() */ void MainThread::CloseAbilityLibrary() { - APP_LOGI("MainThread::CloseAbilityLibrary called start"); + HILOG_INFO("MainThread::CloseAbilityLibrary called start"); for (auto iter : handleAbilityLib_) { if (iter != nullptr) { - APP_LOGI("MainThread::CloseAbilityLibrary before dlclose"); + HILOG_INFO("MainThread::CloseAbilityLibrary before dlclose"); dlclose(iter); - APP_LOGI("MainThread::CloseAbilityLibrary after dlclose"); + HILOG_INFO("MainThread::CloseAbilityLibrary after dlclose"); iter = nullptr; } } handleAbilityLib_.clear(); fileEntries_.clear(); - APP_LOGI("MainThread::CloseAbilityLibrary called end"); + HILOG_INFO("MainThread::CloseAbilityLibrary called end"); } /** @@ -1684,41 +1684,41 @@ void MainThread::CloseAbilityLibrary() */ bool MainThread::ScanDir(const std::string &dirPath) { - APP_LOGI("MainThread::ScanDir called start. dirPath: %{public}s.", dirPath.c_str()); - APP_LOGI("MainThread::ScanDir before opendir."); + HILOG_INFO("MainThread::ScanDir called start. dirPath: %{public}s.", dirPath.c_str()); + HILOG_INFO("MainThread::ScanDir before opendir."); DIR *dirp = opendir(dirPath.c_str()); if (dirp == nullptr) { - APP_LOGE("MainThread::ScanDir open dir:%{public}s fail", dirPath.c_str()); + HILOG_ERROR("MainThread::ScanDir open dir:%{public}s fail", dirPath.c_str()); return false; } - APP_LOGI("MainThread::ScanDir after opendir."); + HILOG_INFO("MainThread::ScanDir after opendir."); struct dirent *df = nullptr; for (;;) { - APP_LOGI("MainThread::ScanDir before readdir."); + HILOG_INFO("MainThread::ScanDir before readdir."); df = readdir(dirp); - APP_LOGI("MainThread::ScanDir after readdir."); + HILOG_INFO("MainThread::ScanDir after readdir."); if (df == nullptr) { break; } std::string currentName(df->d_name); - APP_LOGD("folder found:'%{public}s'", df->d_name); + HILOG_DEBUG("folder found:'%{public}s'", df->d_name); if (currentName.compare(".") == 0 || currentName.compare("..") == 0) { continue; } if (CheckFileType(currentName, abilityLibraryType_)) { - APP_LOGI("MainThread::ScanDir CheckFileType == true."); + HILOG_INFO("MainThread::ScanDir CheckFileType == true."); fileEntries_.emplace_back(dirPath + pathSeparator_ + currentName); } } - APP_LOGI("MainThread::ScanDir before closedir."); + HILOG_INFO("MainThread::ScanDir before closedir."); if (closedir(dirp) == -1) { - APP_LOGW("close dir fail"); + HILOG_WARN("close dir fail"); } - APP_LOGI("MainThread::ScanDir after closedir."); - APP_LOGI("MainThread::ScanDir called end."); + HILOG_INFO("MainThread::ScanDir after closedir."); + HILOG_INFO("MainThread::ScanDir called end."); return true; } @@ -1734,31 +1734,31 @@ bool MainThread::ScanDir(const std::string &dirPath) */ bool MainThread::CheckFileType(const std::string &fileName, const std::string &extensionName) { - APP_LOGD("MainThread::CheckFileType path is %{public}s, support suffix is %{public}s", + HILOG_DEBUG("MainThread::CheckFileType path is %{public}s, support suffix is %{public}s", fileName.c_str(), extensionName.c_str()); if (fileName.empty()) { - APP_LOGE("the file name is empty"); + HILOG_ERROR("the file name is empty"); return false; } auto position = fileName.rfind('.'); if (position == std::string::npos) { - APP_LOGE("filename no extension name"); + HILOG_ERROR("filename no extension name"); return false; } std::string suffixStr = fileName.substr(position); - APP_LOGD("MainThread::CheckFileType end."); + HILOG_DEBUG("MainThread::CheckFileType end."); return LowerStr(suffixStr) == extensionName; } void MainThread::HandleScheduleAcceptWant(const AAFwk::Want &want, const std::string &moduleName) { - APP_LOGI("MainThread::HandleScheduleAcceptWant"); + HILOG_INFO("MainThread::HandleScheduleAcceptWant"); if (!application_) { - APP_LOGE("application_ is nullptr"); + HILOG_ERROR("application_ is nullptr"); return; } @@ -1766,7 +1766,7 @@ void MainThread::HandleScheduleAcceptWant(const AAFwk::Want &want, const std::st application_->ScheduleAcceptWant(want, moduleName, specifiedFlag); if (!appMgr_ || !applicationImpl_) { - APP_LOGE("appMgr_ is nullptr"); + HILOG_ERROR("appMgr_ is nullptr"); return; } @@ -1775,20 +1775,20 @@ void MainThread::HandleScheduleAcceptWant(const AAFwk::Want &want, const std::st void MainThread::ScheduleAcceptWant(const AAFwk::Want &want, const std::string &moduleName) { - APP_LOGI("MainThread::ScheduleAcceptWant start"); + HILOG_INFO("MainThread::ScheduleAcceptWant start"); wptr weak = this; auto task = [weak, want, moduleName]() { auto appThread = weak.promote(); if (appThread == nullptr) { - APP_LOGE("abilityThread is nullptr, HandleScheduleAcceptWant failed."); + HILOG_ERROR("abilityThread is nullptr, HandleScheduleAcceptWant failed."); return; } appThread->HandleScheduleAcceptWant(want, moduleName); }; if (!mainHandler_->PostTask(task)) { - APP_LOGE("MainThread::ScheduleAcceptWant PostTask task failed"); + HILOG_ERROR("MainThread::ScheduleAcceptWant PostTask task failed"); } - APP_LOGI("MainThread::ScheduleAcceptWant end."); + HILOG_INFO("MainThread::ScheduleAcceptWant end."); } #endif // ABILITY_LIBRARY_LOADER } // namespace AppExecFwk diff --git a/frameworks/kits/appkit/native/app/src/ohos_application.cpp b/frameworks/kits/appkit/native/app/src/ohos_application.cpp index 7c35334893..1a16893358 100644 --- a/frameworks/kits/appkit/native/app/src/ohos_application.cpp +++ b/frameworks/kits/appkit/native/app/src/ohos_application.cpp @@ -17,9 +17,9 @@ #include "ability_record_mgr.h" #include "app_loader.h" -#include "app_log_wrapper.h" #include "application_impl.h" #include "context_impl.h" +#include "hilog_wrapper.h" #include "iservice_registry.h" #include "runtime.h" #include "system_ability_definition.h" @@ -47,7 +47,7 @@ OHOSApplication::~OHOSApplication() = default; void OHOSApplication::DispatchAbilitySavedState(const PacMap &outState) { - APP_LOGI("OHOSApplication::dispatchAbilitySavedState: called"); + HILOG_INFO("OHOSApplication::dispatchAbilitySavedState: called"); for (auto callback : abilityLifecycleCallbacks_) { if (callback != nullptr) { callback->OnAbilitySaveState(outState); @@ -73,7 +73,7 @@ void OHOSApplication::OnBackground() void OHOSApplication::DumpApplication() { - APP_LOGD("OHOSApplication::Dump called"); + HILOG_DEBUG("OHOSApplication::Dump called"); // create and initialize abilityInfos std::shared_ptr abilityInfo = nullptr; std::shared_ptr record = nullptr; @@ -87,31 +87,31 @@ void OHOSApplication::DumpApplication() } if (abilityInfo) { - APP_LOGD("==============AbilityInfo=============="); - APP_LOGD("abilityInfo: package: %{public}s", abilityInfo->package.c_str()); - APP_LOGD("abilityInfo: name: %{public}s", abilityInfo->name.c_str()); - APP_LOGD("abilityInfo: label: %{public}s", abilityInfo->label.c_str()); - APP_LOGD("abilityInfo: description: %{public}s", abilityInfo->description.c_str()); - APP_LOGD("abilityInfo: iconPath: %{public}s", abilityInfo->iconPath.c_str()); - APP_LOGD("abilityInfo: visible: %{public}d", abilityInfo->visible); - APP_LOGD("abilityInfo: kind: %{public}s", abilityInfo->kind.c_str()); - APP_LOGD("abilityInfo: type: %{public}d", abilityInfo->type); - APP_LOGD("abilityInfo: orientation: %{public}d", abilityInfo->orientation); - APP_LOGD("abilityInfo: launchMode: %{public}d", abilityInfo->launchMode); + HILOG_DEBUG("==============AbilityInfo=============="); + HILOG_DEBUG("abilityInfo: package: %{public}s", abilityInfo->package.c_str()); + HILOG_DEBUG("abilityInfo: name: %{public}s", abilityInfo->name.c_str()); + HILOG_DEBUG("abilityInfo: label: %{public}s", abilityInfo->label.c_str()); + HILOG_DEBUG("abilityInfo: description: %{public}s", abilityInfo->description.c_str()); + HILOG_DEBUG("abilityInfo: iconPath: %{public}s", abilityInfo->iconPath.c_str()); + HILOG_DEBUG("abilityInfo: visible: %{public}d", abilityInfo->visible); + HILOG_DEBUG("abilityInfo: kind: %{public}s", abilityInfo->kind.c_str()); + HILOG_DEBUG("abilityInfo: type: %{public}d", abilityInfo->type); + HILOG_DEBUG("abilityInfo: orientation: %{public}d", abilityInfo->orientation); + HILOG_DEBUG("abilityInfo: launchMode: %{public}d", abilityInfo->launchMode); for (auto permission : abilityInfo->permissions) { - APP_LOGD("abilityInfo: permission: %{public}s", permission.c_str()); + HILOG_DEBUG("abilityInfo: permission: %{public}s", permission.c_str()); } - APP_LOGD("abilityInfo: bundleName: %{public}s", abilityInfo->bundleName.c_str()); - APP_LOGD("abilityInfo: applicationName: %{public}s", abilityInfo->applicationName.c_str()); + HILOG_DEBUG("abilityInfo: bundleName: %{public}s", abilityInfo->bundleName.c_str()); + HILOG_DEBUG("abilityInfo: applicationName: %{public}s", abilityInfo->applicationName.c_str()); } // create and initialize applicationInfo - APP_LOGD("==============applicationInfo=============="); + HILOG_DEBUG("==============applicationInfo=============="); std::shared_ptr applicationInfoPtr = GetApplicationInfo(); if (applicationInfoPtr != nullptr) { - APP_LOGD("applicationInfo: name: %{public}s", applicationInfoPtr->name.c_str()); - APP_LOGD("applicationInfo: bundleName: %{public}s", applicationInfoPtr->bundleName.c_str()); - APP_LOGD("applicationInfo: signatureKey: %{public}s", applicationInfoPtr->signatureKey.c_str()); + HILOG_DEBUG("applicationInfo: name: %{public}s", applicationInfoPtr->name.c_str()); + HILOG_DEBUG("applicationInfo: bundleName: %{public}s", applicationInfoPtr->bundleName.c_str()); + HILOG_DEBUG("applicationInfo: signatureKey: %{public}s", applicationInfoPtr->signatureKey.c_str()); } } @@ -122,13 +122,13 @@ void OHOSApplication::DumpApplication() */ void OHOSApplication::SetRuntime(std::unique_ptr&& runtime) { - APP_LOGI("OHOSApplication::SetRuntime begin"); + HILOG_INFO("OHOSApplication::SetRuntime begin"); if (runtime == nullptr) { - APP_LOGE("OHOSApplication::SetRuntime failed, runtime is empty"); + HILOG_ERROR("OHOSApplication::SetRuntime failed, runtime is empty"); return; } runtime_ = std::move(runtime); - APP_LOGI("OHOSApplication::SetRuntime end"); + HILOG_INFO("OHOSApplication::SetRuntime end"); } /** @@ -138,13 +138,13 @@ void OHOSApplication::SetRuntime(std::unique_ptr&& runt */ void OHOSApplication::SetApplicationContext(const std::shared_ptr &abilityRuntimeContext) { - APP_LOGI("OHOSApplication::SetApplicationContext begin"); + HILOG_INFO("OHOSApplication::SetApplicationContext begin"); if (abilityRuntimeContext == nullptr) { - APP_LOGE("OHOSApplication::SetApplicationContext failed, context is empty"); + HILOG_ERROR("OHOSApplication::SetApplicationContext failed, context is empty"); return; } abilityRuntimeContext_ = abilityRuntimeContext; - APP_LOGI("OHOSApplication::SetApplicationContext end"); + HILOG_INFO("OHOSApplication::SetApplicationContext end"); } /** @@ -155,13 +155,13 @@ void OHOSApplication::SetApplicationContext(const std::shared_ptr &abilityRecordMgr) { - APP_LOGI("OHOSApplication::SetAbilityRecordMgr. Start"); + HILOG_INFO("OHOSApplication::SetAbilityRecordMgr. Start"); if (abilityRecordMgr == nullptr) { - APP_LOGE("ContextDeal::SetAbilityRecordMgr failed, abilityRecordMgr is nullptr"); + HILOG_ERROR("ContextDeal::SetAbilityRecordMgr failed, abilityRecordMgr is nullptr"); return; } abilityRecordMgr_ = abilityRecordMgr; - APP_LOGI("OHOSApplication::SetAbilityRecordMgr. End"); + HILOG_INFO("OHOSApplication::SetAbilityRecordMgr. End"); } /** @@ -172,10 +172,10 @@ void OHOSApplication::SetAbilityRecordMgr(const std::shared_ptr &callBack) { - APP_LOGI("OHOSApplication::RegisterAbilityLifecycleCallbacks: called"); + HILOG_INFO("OHOSApplication::RegisterAbilityLifecycleCallbacks: called"); if (callBack == nullptr) { - APP_LOGI("OHOSApplication::RegisterAbilityLifecycleCallbacks: observer is null"); + HILOG_INFO("OHOSApplication::RegisterAbilityLifecycleCallbacks: observer is null"); return; } @@ -190,10 +190,10 @@ void OHOSApplication::RegisterAbilityLifecycleCallbacks(const std::shared_ptr &callBack) { - APP_LOGI("OHOSApplication::UnregisterAbilityLifecycleCallbacks: called"); + HILOG_INFO("OHOSApplication::UnregisterAbilityLifecycleCallbacks: called"); if (callBack == nullptr) { - APP_LOGI("OHOSApplication::UnregisterAbilityLifecycleCallbacks: observer is null"); + HILOG_INFO("OHOSApplication::UnregisterAbilityLifecycleCallbacks: observer is null"); return; } @@ -209,11 +209,11 @@ void OHOSApplication::UnregisterAbilityLifecycleCallbacks(const std::shared_ptr< void OHOSApplication::OnAbilityStart(const std::shared_ptr &ability) { if (ability == nullptr) { - APP_LOGE("ContextDeal::OnAbilityStart failed, ability is nullptr"); + HILOG_ERROR("ContextDeal::OnAbilityStart failed, ability is nullptr"); return; } - APP_LOGI("OHOSApplication::OnAbilityStart: called"); + HILOG_INFO("OHOSApplication::OnAbilityStart: called"); for (auto callback : abilityLifecycleCallbacks_) { if (callback != nullptr) { callback->OnAbilityStart(ability); @@ -230,11 +230,11 @@ void OHOSApplication::OnAbilityStart(const std::shared_ptr &ability) void OHOSApplication::OnAbilityInactive(const std::shared_ptr &ability) { if (ability == nullptr) { - APP_LOGE("ContextDeal::OnAbilityInactive failed, ability is nullptr"); + HILOG_ERROR("ContextDeal::OnAbilityInactive failed, ability is nullptr"); return; } - APP_LOGI("OHOSApplication::OnAbilityInactive: called"); + HILOG_INFO("OHOSApplication::OnAbilityInactive: called"); for (auto callback : abilityLifecycleCallbacks_) { if (callback != nullptr) { callback->OnAbilityInactive(ability); @@ -251,11 +251,11 @@ void OHOSApplication::OnAbilityInactive(const std::shared_ptr &ability) void OHOSApplication::OnAbilityBackground(const std::shared_ptr &ability) { if (ability == nullptr) { - APP_LOGE("ContextDeal::OnAbilityBackground failed, ability is nullptr"); + HILOG_ERROR("ContextDeal::OnAbilityBackground failed, ability is nullptr"); return; } - APP_LOGI("OHOSApplication::OnAbilityBackground: called"); + HILOG_INFO("OHOSApplication::OnAbilityBackground: called"); for (auto callback : abilityLifecycleCallbacks_) { if (callback != nullptr) { callback->OnAbilityBackground(ability); @@ -272,11 +272,11 @@ void OHOSApplication::OnAbilityBackground(const std::shared_ptr &abilit void OHOSApplication::OnAbilityForeground(const std::shared_ptr &ability) { if (ability == nullptr) { - APP_LOGE("ContextDeal::OnAbilityForeground failed, ability is nullptr"); + HILOG_ERROR("ContextDeal::OnAbilityForeground failed, ability is nullptr"); return; } - APP_LOGI("OHOSApplication::OnAbilityForeground: called"); + HILOG_INFO("OHOSApplication::OnAbilityForeground: called"); for (auto callback : abilityLifecycleCallbacks_) { if (callback != nullptr) { callback->OnAbilityForeground(ability); @@ -293,11 +293,11 @@ void OHOSApplication::OnAbilityForeground(const std::shared_ptr &abilit void OHOSApplication::OnAbilityActive(const std::shared_ptr &ability) { if (ability == nullptr) { - APP_LOGE("ContextDeal::OnAbilityActive failed, ability is nullptr"); + HILOG_ERROR("ContextDeal::OnAbilityActive failed, ability is nullptr"); return; } - APP_LOGI("OHOSApplication::OnAbilityActive: called"); + HILOG_INFO("OHOSApplication::OnAbilityActive: called"); for (auto callback : abilityLifecycleCallbacks_) { if (callback != nullptr) { callback->OnAbilityActive(ability); @@ -314,11 +314,11 @@ void OHOSApplication::OnAbilityActive(const std::shared_ptr &ability) void OHOSApplication::OnAbilityStop(const std::shared_ptr &ability) { if (ability == nullptr) { - APP_LOGE("ContextDeal::OnAbilityStop failed, ability is nullptr"); + HILOG_ERROR("ContextDeal::OnAbilityStop failed, ability is nullptr"); return; } - APP_LOGI("OHOSApplication::OnAbilityStop: called"); + HILOG_INFO("OHOSApplication::OnAbilityStop: called"); for (auto callback : abilityLifecycleCallbacks_) { if (callback != nullptr) { callback->OnAbilityStop(ability); @@ -334,10 +334,10 @@ void OHOSApplication::OnAbilityStop(const std::shared_ptr &ability) */ void OHOSApplication::RegisterElementsCallbacks(const std::shared_ptr &callback) { - APP_LOGI("OHOSApplication::RegisterElementsCallbacks: called"); + HILOG_INFO("OHOSApplication::RegisterElementsCallbacks: called"); if (callback == nullptr) { - APP_LOGI("OHOSApplication::RegisterElementsCallbacks: observer is null"); + HILOG_INFO("OHOSApplication::RegisterElementsCallbacks: observer is null"); return; } @@ -352,10 +352,10 @@ void OHOSApplication::RegisterElementsCallbacks(const std::shared_ptr &callback) { - APP_LOGI("OHOSApplication::UnregisterElementsCallbacks: called"); + HILOG_INFO("OHOSApplication::UnregisterElementsCallbacks: called"); if (callback == nullptr) { - APP_LOGI("OHOSApplication::UnregisterElementsCallbacks: observer is null"); + HILOG_INFO("OHOSApplication::UnregisterElementsCallbacks: observer is null"); return; } @@ -370,9 +370,9 @@ void OHOSApplication::UnregisterElementsCallbacks(const std::shared_ptrMerge(changeKeyV, config); // Notify all abilities - APP_LOGI("Number of ability to be notified : [%{public}d]", static_cast(abilityRecordMgr_->GetRecordCount())); + HILOG_INFO( + "Number of ability to be notified : [%{public}d]", static_cast(abilityRecordMgr_->GetRecordCount())); for (const auto &abilityToken : abilityRecordMgr_->GetAllTokens()) { auto abilityRecord = abilityRecordMgr_->GetAbilityItem(abilityToken); if (abilityRecord && abilityRecord->GetAbilityThread()) { @@ -391,7 +392,7 @@ void OHOSApplication::OnConfigurationUpdated(const Configuration &config) } // Notify AbilityStage - APP_LOGI("Number of abilityStage to be notified : [%{public}zu]", abilityStages_.size()); + HILOG_INFO("Number of abilityStage to be notified : [%{public}zu]", abilityStages_.size()); for (auto it = abilityStages_.begin(); it != abilityStages_.end(); it++) { auto abilityStage = it->second; if (abilityStage) { @@ -416,7 +417,7 @@ void OHOSApplication::OnConfigurationUpdated(const Configuration &config) */ void OHOSApplication::OnMemoryLevel(int level) { - APP_LOGI("OHOSApplication::OnMemoryLevel: called"); + HILOG_INFO("OHOSApplication::OnMemoryLevel: called"); for (auto callback : elementsCallbacks_) { if (callback != nullptr) { callback->OnMemoryLevel(level); @@ -431,7 +432,7 @@ void OHOSApplication::OnMemoryLevel(int level) */ void OHOSApplication::OnStart() { - APP_LOGI("OHOSApplication::OnStart: called"); + HILOG_INFO("OHOSApplication::OnStart: called"); } /** @@ -441,7 +442,7 @@ void OHOSApplication::OnStart() */ void OHOSApplication::OnTerminate() { - APP_LOGI("OHOSApplication::OnTerminate: called"); + HILOG_INFO("OHOSApplication::OnTerminate: called"); } /** @@ -460,12 +461,12 @@ std::shared_ptr OHOSApplication::AddAbilityStage( const std::shared_ptr &abilityRecord) { if (abilityRecord == nullptr) { - APP_LOGE("AddAbilityStage:abilityRecord is nullptr"); + HILOG_ERROR("AddAbilityStage:abilityRecord is nullptr"); return nullptr; } const std::shared_ptr &abilityInfo = abilityRecord->GetAbilityInfo(); if (abilityInfo == nullptr) { - APP_LOGE("AddAbilityStage:abilityInfo is nullptr"); + HILOG_ERROR("AddAbilityStage:abilityInfo is nullptr"); return nullptr; } std::string moduleName = abilityInfo->moduleName; @@ -478,14 +479,14 @@ std::shared_ptr OHOSApplication::AddAbilityStage( stageContext->SetConfiguration(GetConfiguration()); std::shared_ptr hapModuleInfo = stageContext->GetHapModuleInfo(); if (hapModuleInfo == nullptr) { - APP_LOGE("AddAbilityStage:hapModuleInfo is nullptr"); + HILOG_ERROR("AddAbilityStage:hapModuleInfo is nullptr"); return nullptr; } abilityStage = AbilityRuntime::AbilityStage::Create(runtime_, *hapModuleInfo); abilityStage->Init(stageContext); Want want; if (abilityRecord->GetWant()) { - APP_LOGI("want is ok, transport to abilityStage"); + HILOG_INFO("want is ok, transport to abilityStage"); want = *(abilityRecord->GetWant()); } abilityStage->OnCreate(want); @@ -495,7 +496,7 @@ std::shared_ptr OHOSApplication::AddAbilityStage( } const sptr &token = abilityRecord->GetToken(); if (token == nullptr) { - APP_LOGE("AddAbilityStage:token is null"); + HILOG_ERROR("AddAbilityStage:token is null"); return nullptr; } abilityStage->AddAbility(token, abilityRecord); @@ -504,19 +505,19 @@ std::shared_ptr OHOSApplication::AddAbilityStage( bool OHOSApplication::AddAbilityStage(const AppExecFwk::HapModuleInfo &hapModuleInfo) { - APP_LOGI("OHOSApplication::AddAbilityStage"); + HILOG_INFO("OHOSApplication::AddAbilityStage"); if (abilityRuntimeContext_ == nullptr) { - APP_LOGE("OHOSApplication::AddAbilityStage abilityRuntimeContext_ is nullptr."); + HILOG_ERROR("OHOSApplication::AddAbilityStage abilityRuntimeContext_ is nullptr."); return false; } if (runtime_ == nullptr) { - APP_LOGE("OHOSApplication::AddAbilityStage abilityRuntimeContext_ is nullptr."); + HILOG_ERROR("OHOSApplication::AddAbilityStage abilityRuntimeContext_ is nullptr."); return false; } if (abilityStages_.find(hapModuleInfo.moduleName) != abilityStages_.end()) { - APP_LOGE("OHOSApplication::%{public}s: object already exists ", __func__); + HILOG_ERROR("OHOSApplication::%{public}s: object already exists ", __func__); return false; } @@ -525,7 +526,7 @@ bool OHOSApplication::AddAbilityStage(const AppExecFwk::HapModuleInfo &hapModule stageContext->InitHapModuleInfo(hapModuleInfo); auto moduleInfo = stageContext->GetHapModuleInfo(); if (moduleInfo == nullptr) { - APP_LOGE("OHOSApplication::%{public}s: moduleInfo is nullptr", __func__); + HILOG_ERROR("OHOSApplication::%{public}s: moduleInfo is nullptr", __func__); return false; } auto abilityStage = AbilityRuntime::AbilityStage::Create(runtime_, *moduleInfo); @@ -533,7 +534,7 @@ bool OHOSApplication::AddAbilityStage(const AppExecFwk::HapModuleInfo &hapModule Want want; abilityStage->OnCreate(want); abilityStages_[hapModuleInfo.moduleName] = abilityStage; - APP_LOGE("OHOSApplication::%{public}s: abilityStage insert and initialization", __func__); + HILOG_ERROR("OHOSApplication::%{public}s: abilityStage insert and initialization", __func__); return true; } @@ -541,11 +542,11 @@ void OHOSApplication::CleanAbilityStage(const sptr &token, const std::shared_ptr &abilityInfo) { if (abilityInfo == nullptr) { - APP_LOGE("CleanAbilityStage:abilityInfo is nullptr"); + HILOG_ERROR("CleanAbilityStage:abilityInfo is nullptr"); return; } if (token == nullptr) { - APP_LOGE("CleanAbilityStage:token is nullptr"); + HILOG_ERROR("CleanAbilityStage:token is nullptr"); return; } std::string moduleName = abilityInfo->moduleName; @@ -579,7 +580,7 @@ void OHOSApplication::SetConfiguration(const Configuration &config) void OHOSApplication::ScheduleAcceptWant(const AAFwk::Want &want, const std::string &moduleName, std::string &flag) { - APP_LOGI("OHOSApplication::ScheduleAcceptWant: called"); + HILOG_INFO("OHOSApplication::ScheduleAcceptWant: called"); auto iter = abilityStages_.find(moduleName); if (iter != abilityStages_.end()) { auto abilityStage = iter->second; diff --git a/frameworks/kits/appkit/native/app/src/sys_mgr_client.cpp b/frameworks/kits/appkit/native/app/src/sys_mgr_client.cpp index 5322d19cd9..f9a24ce796 100644 --- a/frameworks/kits/appkit/native/app/src/sys_mgr_client.cpp +++ b/frameworks/kits/appkit/native/app/src/sys_mgr_client.cpp @@ -15,7 +15,7 @@ #include "sys_mgr_client.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "if_system_ability_manager.h" #include "ipc_skeleton.h" #include "iservice_registry.h" @@ -43,7 +43,7 @@ sptr SysMrgClient::GetSystemAbility(const int32_t systemAbilityId if (abilityManager_ == nullptr) { abilityManager_ = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (abilityManager_ == nullptr) { - APP_LOGE("fail to GetSystemAbility abilityManager_ == nullptr."); + HILOG_ERROR("fail to GetSystemAbility abilityManager_ == nullptr."); return nullptr; } } diff --git a/frameworks/kits/appkit/native/app/src/watchdog.cpp b/frameworks/kits/appkit/native/app/src/watchdog.cpp index 2c900857e3..0e7573e5af 100644 --- a/frameworks/kits/appkit/native/app/src/watchdog.cpp +++ b/frameworks/kits/appkit/native/app/src/watchdog.cpp @@ -17,7 +17,7 @@ #include #include "hisysevent.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -60,13 +60,13 @@ void WatchDog::Init(const std::shared_ptr &mainHandler, const std: WatchDog::currentHandler_ = watchDogHandler; if (watchDogThread_ == nullptr) { watchDogThread_ = std::make_shared(&WatchDog::Timer, this); - APP_LOGI("Watchdog is running!"); + HILOG_INFO("Watchdog is running!"); } } void WatchDog::Stop() { - APP_LOGI("Watchdog is stop !"); + HILOG_INFO("Watchdog is stop !"); stopWatchDog_.store(true); if (watchDogThread_ != nullptr && watchDogThread_->joinable()) { watchDogThread_->join(); @@ -120,7 +120,7 @@ bool WatchDog::Timer() EVENT_KEY_PROCESS_NAME, applicationInfo_->process, EVENT_KEY_MESSAGE, msgContent); } - APP_LOGI("Warning : main thread is not response!"); + HILOG_INFO("Warning : main thread is not response!"); }; if (currentHandler_ != nullptr) { currentHandler_->PostTask(timeoutTask, MAIN_THREAD_IS_ALIVE_MSG, MAIN_THREAD_TIMEOUT_TIME); diff --git a/frameworks/kits/appkit/native/test/BUILD.gn b/frameworks/kits/appkit/native/test/BUILD.gn index a3c3703ac2..a85399b543 100644 --- a/frameworks/kits/appkit/native/test/BUILD.gn +++ b/frameworks/kits/appkit/native/test/BUILD.gn @@ -41,8 +41,8 @@ config("module_private_config") { cflags += [ "-DBINDER_IPC_32BIT" ] } defines = [ - "APP_LOG_TAG = \"ApplicationUnitTest\"", - "LOG_DOMAIN = 0xD001151", + "AMS_LOG_TAG = \"ApplicationUnitTest\"", + "AMS_LOG_DOMAIN = 0xD001151", ] } @@ -70,8 +70,8 @@ config("module_context_config") { cflags += [ "-DBINDER_IPC_32BIT" ] } defines = [ - "APP_LOG_TAG = \"ApplicationUnitTest\"", - "LOG_DOMAIN = 0xD001151", + "AMS_LOG_TAG = \"ApplicationUnitTest\"", + "AMS_LOG_DOMAIN = 0xD001151", ] } @@ -141,6 +141,7 @@ ohos_unittest("application_test") { ] external_deps = [ + "ability_base:configuration", "ability_runtime:runtime", "bundle_framework:appexecfwk_core", "hiviewdfx_hilog_native:libhilog", @@ -301,6 +302,7 @@ ohos_unittest("application_impl_test") { ] external_deps = [ + "ability_base:configuration", "ability_runtime:runtime", "bundle_framework:appexecfwk_core", "hiviewdfx_hilog_native:libhilog", diff --git a/frameworks/kits/appkit/test/BUILD.gn b/frameworks/kits/appkit/test/BUILD.gn index 8a17a6557b..f808f00976 100644 --- a/frameworks/kits/appkit/test/BUILD.gn +++ b/frameworks/kits/appkit/test/BUILD.gn @@ -37,8 +37,8 @@ config("module_private_config") { ] defines = [ - "APP_LOG_TAG = \"ApplicationModuleTest\"", - "LOG_DOMAIN = 0xD001152", + "AMS_LOG_TAG = \"ApplicationModuleTest\"", + "AMS_LOG_DOMAIN = 0xD001152", ] } diff --git a/frameworks/kits/appkit/test/Mock/include/mock_app_mgr_service.h b/frameworks/kits/appkit/test/Mock/include/mock_app_mgr_service.h index e196ba7b30..29b708f533 100755 --- a/frameworks/kits/appkit/test/Mock/include/mock_app_mgr_service.h +++ b/frameworks/kits/appkit/test/Mock/include/mock_app_mgr_service.h @@ -21,7 +21,7 @@ #include "semaphore_ex.h" #include "app_scheduler_interface.h" #include "app_mgr_stub.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -227,31 +227,31 @@ public: bool IsAttached() { - APP_LOGI("MockAppMgrService::IsAttached Attached_ = %{public}d", Attached_); + HILOG_INFO("MockAppMgrService::IsAttached Attached_ = %{public}d", Attached_); return Attached_; } bool IsForegrounded() { - APP_LOGI("MockAppMgrService::IsForegrounded Foregrounded_ = %{public}d", Foregrounded_); + HILOG_INFO("MockAppMgrService::IsForegrounded Foregrounded_ = %{public}d", Foregrounded_); return Foregrounded_; } bool IsBackgrounded() { - APP_LOGI("MockAppMgrService::IsBackgrounded Backgrounded_ = %{public}d", Backgrounded_); + HILOG_INFO("MockAppMgrService::IsBackgrounded Backgrounded_ = %{public}d", Backgrounded_); return Backgrounded_; } bool IsTerminated() { - APP_LOGI("MockAppMgrService::IsTerminated Terminated_ = %{public}d", Terminated_); + HILOG_INFO("MockAppMgrService::IsTerminated Terminated_ = %{public}d", Terminated_); return Terminated_; } void init() { - APP_LOGI("MockAppMgrService::init called"); + HILOG_INFO("MockAppMgrService::init called"); Attached_ = false; } diff --git a/frameworks/kits/appkit/test/Mock/include/mock_ipc_object_stub.cpp b/frameworks/kits/appkit/test/Mock/include/mock_ipc_object_stub.cpp index de1ca3d4f2..71e440ded7 100644 --- a/frameworks/kits/appkit/test/Mock/include/mock_ipc_object_stub.cpp +++ b/frameworks/kits/appkit/test/Mock/include/mock_ipc_object_stub.cpp @@ -20,7 +20,7 @@ #include "ipc_thread_skeleton.h" #include "log_tags.h" #include "ipc_skeleton.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #ifdef CONFIG_IPC_RPC #include "dbinder_databus_invoker.h" @@ -43,7 +43,7 @@ IPCObjectStub::IPCObjectStub(std::u16string descriptor) : IRemoteObject(descript IPCObjectStub::~IPCObjectStub() { - APP_LOGI("IPCObjectStub destroyed"); + HILOG_INFO("IPCObjectStub destroyed"); } bool IPCObjectStub::IsDeviceIdIllegal(const std::string &deviceID) @@ -77,14 +77,14 @@ int32_t IPCObjectStub::GetObjectRefCount() int IPCObjectStub::Dump(int fd, const std::vector &args) { const size_t numArgs = args.size(); - APP_LOGI("Invalid call on Stub:fd:%{public}d, args:%{public}zu", fd, numArgs); + HILOG_INFO("Invalid call on Stub:fd:%{public}d, args:%{public}zu", fd, numArgs); return ERR_NONE; } int IPCObjectStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { if (data.ReadInterfaceToken() != GetDescriptor()) { - APP_LOGE("local descriptor is not equal to remote"); + HILOG_ERROR("local descriptor is not equal to remote"); return ERR_TRANSACTION_FAILED; } int result = ERR_NONE; @@ -92,7 +92,7 @@ int IPCObjectStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessagePa #ifdef CONFIG_IPC_RPC case DBINDER_OBITUARY_TRANSACTION: { if (IPCSkeleton::GetCallingUid() != SYSTEM_SERVER_UID) { - APP_LOGI(LABEL, "%s: DBINDER_OBITUARY_TRANSACTION unauthenticated user ", __func__); + HILOG_INFO(LABEL, "%s: DBINDER_OBITUARY_TRANSACTION unauthenticated user ", __func__); result = IPC_STUB_INVALID_DATA_ERR; break; } @@ -106,7 +106,7 @@ int IPCObjectStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessagePa #endif default: result = IPC_STUB_UNKNOW_TRANS_ERR; - APP_LOGI("unknown OnRemoteRequest code = %{public}u", code); + HILOG_INFO("unknown OnRemoteRequest code = %{public}u", code); break; } @@ -142,7 +142,7 @@ int IPCObjectStub::SendRequest(uint32_t code, MessageParcel &data, MessageParcel case INTERFACE_TRANSACTION: { std::u16string descriptor = GetObjectDescriptor(); if (!reply.WriteString16(descriptor)) { - APP_LOGI("write to parcel fail"); + HILOG_INFO("write to parcel fail"); result = IPC_STUB_WRITE_PARCEL_ERR; } break; @@ -158,7 +158,7 @@ int IPCObjectStub::SendRequest(uint32_t code, MessageParcel &data, MessageParcel } case DUMP_TRANSACTION: { if (!IPCSkeleton::IsLocalCalling()) { - APP_LOGI("do not allow dump"); + HILOG_INFO("do not allow dump"); break; } result = OnRemoteDump(code, data, reply, option); @@ -167,7 +167,7 @@ int IPCObjectStub::SendRequest(uint32_t code, MessageParcel &data, MessageParcel #ifdef CONFIG_IPC_RPC case INVOKE_LISTEN_THREAD: { if (!IPCSkeleton::IsLocalCalling() || IPCSkeleton::GetCallingUid() >= ALLOWED_UID) { - APP_LOGI("%s: INVOKE_LISTEN_THREAD unauthenticated user ", __func__); + HILOG_INFO("%s: INVOKE_LISTEN_THREAD unauthenticated user ", __func__); result = IPC_STUB_INVALID_DATA_ERR; break; } @@ -180,7 +180,7 @@ int IPCObjectStub::SendRequest(uint32_t code, MessageParcel &data, MessageParcel } case DBINDER_INCREFS_TRANSACTION: { if (IPCSkeleton::IsLocalCalling()) { - APP_LOGI("%s: cannot be called in same device", __func__); + HILOG_INFO("%s: cannot be called in same device", __func__); result = IPC_STUB_INVALID_DATA_ERR; break; } @@ -189,7 +189,7 @@ int IPCObjectStub::SendRequest(uint32_t code, MessageParcel &data, MessageParcel } case DBINDER_DECREFS_TRANSACTION: { if (IPCSkeleton::IsLocalCalling()) { - APP_LOGI("%s: cannot be called in same device", __func__); + HILOG_INFO("%s: cannot be called in same device", __func__); result = IPC_STUB_INVALID_DATA_ERR; break; } @@ -198,7 +198,7 @@ int IPCObjectStub::SendRequest(uint32_t code, MessageParcel &data, MessageParcel } case DBINDER_ADD_COMMAUTH: { if (IPCSkeleton::IsLocalCalling() || IPCSkeleton::GetCallingUid() >= ALLOWED_UID) { - APP_LOGI("%s: DBINDER_ADD_COMMAUTH unauthenticated user ", __func__); + HILOG_INFO("%s: DBINDER_ADD_COMMAUTH unauthenticated user ", __func__); result = IPC_STUB_INVALID_DATA_ERR; break; } @@ -207,18 +207,18 @@ int IPCObjectStub::SendRequest(uint32_t code, MessageParcel &data, MessageParcel } case GET_UIDPID_INFO: { if (!IPCSkeleton::IsLocalCalling()) { - APP_LOGI("GET_UIDPID_INFO message is not from sa manager"); + HILOG_INFO("GET_UIDPID_INFO message is not from sa manager"); result = IPC_STUB_INVALID_DATA_ERR; break; } std::string sessionName = GetDataBusName(); if (sessionName.empty()) { - APP_LOGI("sessionName is empty"); + HILOG_INFO("sessionName is empty"); result = IPC_STUB_CREATE_BUS_SERVER_ERR; break; } if (!reply.WriteString(sessionName)) { - APP_LOGI("write to parcel fail"); + HILOG_INFO("write to parcel fail"); result = IPC_STUB_INVALID_DATA_ERR; break; } @@ -226,7 +226,7 @@ int IPCObjectStub::SendRequest(uint32_t code, MessageParcel &data, MessageParcel } case GRANT_DATABUS_NAME: { if (!IPCSkeleton::IsLocalCalling() || getuid() != SYSTEM_SERVER_UID) { - APP_LOGI("GRANT_DATABUS_NAME message is excluded in sa manager"); + HILOG_INFO("GRANT_DATABUS_NAME message is excluded in sa manager"); result = IPC_STUB_INVALID_DATA_ERR; break; } @@ -291,9 +291,9 @@ pid_t IPCObjectStub::GetCallingUid() int32_t IPCObjectStub::ProcessProto(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { int result = ERR_NONE; - APP_LOGI("IPCObjectStub::ProcessProto called, type = 0, normal stub object"); + HILOG_INFO("IPCObjectStub::ProcessProto called, type = 0, normal stub object"); if (!reply.WriteUint32(IRemoteObject::IF_PROT_BINDER)) { - APP_LOGI("write to parcel fail"); + HILOG_INFO("write to parcel fail"); result = IPC_STUB_WRITE_PARCEL_ERR; } return result; @@ -305,13 +305,13 @@ int32_t IPCObjectStub::InvokerThread(uint32_t code, MessageParcel &data, Message switch (data.ReadUint32()) { case IRemoteObject::DATABUS_TYPE: { if (InvokerDataBusThread(data, reply) != ERR_NONE) { - APP_LOGI("Invoker databus thread fail"); + HILOG_INFO("Invoker databus thread fail"); return IPC_STUB_INVOKE_THREAD_ERR; } break; } default: { - APP_LOGI("InvokerThread Invalid Type"); + HILOG_INFO("InvokerThread Invalid Type"); return IPC_STUB_INVALID_DATA_ERR; } } @@ -327,34 +327,34 @@ int32_t IPCObjectStub::InvokerDataBusThread(MessageParcel &data, MessageParcel & std::string remoteDeviceId = data.ReadString(); std::string sessionName = data.ReadString(); if (IsDeviceIdIllegal(deviceId) || IsDeviceIdIllegal(remoteDeviceId) || sessionName.empty()) { - APP_LOGI("%s: device ID is invalid or session name nil", __func__); + HILOG_INFO("%s: device ID is invalid or session name nil", __func__); return IPC_STUB_INVALID_DATA_ERR; } IPCProcessSkeleton *current = IPCProcessSkeleton::GetCurrent(); if (current == nullptr) { - APP_LOGI("IPCProcessSkeleton is nullptr"); + HILOG_INFO("IPCProcessSkeleton is nullptr"); return IPC_STUB_CURRENT_NULL_ERR; } if (!current->CreateSoftbusServer(sessionName)) { - APP_LOGI("%s: fail to create databus server", __func__); + HILOG_INFO("%s: fail to create databus server", __func__); return IPC_STUB_CREATE_BUS_SERVER_ERR; } uint64_t stubIndex = current->AddStubByIndex(this); if (stubIndex == 0) { - APP_LOGI("%s: add stub fail", __func__); + HILOG_INFO("%s: add stub fail", __func__); return IPC_STUB_INVALID_DATA_ERR; } if (!reply.WriteUint64(stubIndex) || !reply.WriteString(sessionName) || !reply.WriteString(deviceId)) { - APP_LOGI("%s: write to parcel fail", __func__); + HILOG_INFO("%s: write to parcel fail", __func__); return IPC_STUB_INVALID_DATA_ERR; } if (!current->AttachAppInfoToStubIndex(remotePid, remoteUid, remoteDeviceId, stubIndex)) { - APP_LOGI("fail to attach appinfo to stubIndex, maybe attach already"); + HILOG_INFO("fail to attach appinfo to stubIndex, maybe attach already"); } if (!current->AttachCommAuthInfo(this, remotePid, remoteUid, remoteDeviceId)) { - APP_LOGI("fail to attach comm auth info"); + HILOG_INFO("fail to attach comm auth info"); } return ERR_NONE; @@ -364,20 +364,20 @@ int32_t IPCObjectStub::NoticeServiceDie(MessageParcel &data, MessageParcel &repl { IPCProcessSkeleton *current = IPCProcessSkeleton::GetCurrent(); if (current == nullptr) { - APP_LOGI("%s: current is null", __func__); + HILOG_INFO("%s: current is null", __func__); return IPC_STUB_CURRENT_NULL_ERR; } IPCObjectProxy *ipcProxy = current->QueryCallbackProxy(this); if (ipcProxy == nullptr) { - APP_LOGI("%s: ipc proxy is null", __func__); + HILOG_INFO("%s: ipc proxy is null", __func__); return IPC_STUB_INVALID_DATA_ERR; } ipcProxy->SendObituary(); if (!current->DetachCallbackStub(this)) { - APP_LOGI("%s: fail to detach callback stub", __func__); + HILOG_INFO("%s: fail to detach callback stub", __func__); // do nothing, RemoveDeathRecipient can delete this too } @@ -388,17 +388,17 @@ int32_t IPCObjectStub::IncStubRefs(MessageParcel &data, MessageParcel &reply) { IPCProcessSkeleton *current = IPCProcessSkeleton::GetCurrent(); if (current == nullptr) { - APP_LOGI("%s: current is null", __func__); + HILOG_INFO("%s: current is null", __func__); return IPC_STUB_CURRENT_NULL_ERR; } std::string deviceId = IPCSkeleton::GetCallingDeviceID(); if (deviceId.empty()) { - APP_LOGI("%s: calling error", __func__); + HILOG_INFO("%s: calling error", __func__); return IPC_STUB_INVALID_DATA_ERR; } if (!current->AttachStubRecvRefInfo(this, IPCSkeleton::GetCallingPid(), deviceId)) { - APP_LOGI("%s: attach stub ref info err, already in", __func__); + HILOG_INFO("%s: attach stub ref info err, already in", __func__); return ERR_NONE; } @@ -413,7 +413,7 @@ int32_t IPCObjectStub::DecStubRefs(MessageParcel &data, MessageParcel &reply) { IPCProcessSkeleton *current = IPCProcessSkeleton::GetCurrent(); if (current == nullptr) { - APP_LOGI("%s: current is null", __func__); + HILOG_INFO("%s: current is null", __func__); return IPC_STUB_CURRENT_NULL_ERR; } @@ -428,18 +428,18 @@ int32_t IPCObjectStub::AddAuthInfo(MessageParcel &data, MessageParcel &reply) uint32_t remoteUid = data.ReadUint32(); std::string remoteDeviceId = data.ReadString(); if (IsDeviceIdIllegal(remoteDeviceId)) { - APP_LOGI("%s: remote deviceId is null", __func__); + HILOG_INFO("%s: remote deviceId is null", __func__); return IPC_STUB_INVALID_DATA_ERR; } IPCProcessSkeleton *current = IPCProcessSkeleton::GetCurrent(); if (current == nullptr) { - APP_LOGI("%s: current is null", __func__); + HILOG_INFO("%s: current is null", __func__); return IPC_STUB_CURRENT_NULL_ERR; } if (!current->AttachCommAuthInfo(this, remotePid, remoteUid, remoteDeviceId)) { - APP_LOGI("fail to attach comm auth info fail"); + HILOG_INFO("fail to attach comm auth info fail"); return IPC_STUB_INVALID_DATA_ERR; } return ERR_NONE; @@ -449,7 +449,7 @@ std::string IPCObjectStub::GetDataBusName() { sptr object = IPCProcessSkeleton::GetCurrent()->GetSAMgrObject(); if (object == nullptr) { - APP_LOGI("get object is null"); + HILOG_INFO("get object is null"); return std::string(""); } @@ -463,11 +463,11 @@ int32_t IPCObjectStub::GrantDataBusName(uint32_t code, MessageParcel &data, Mess int uid = IPCSkeleton::GetCallingUid(); std::string sessionName = CreateDatabusName(uid, pid); if (sessionName.empty()) { - APP_LOGI("pid/uid is invalid, pid = {public}%d, uid = {public}%d", pid, uid); + HILOG_INFO("pid/uid is invalid, pid = {public}%d, uid = {public}%d", pid, uid); return IPC_STUB_INVALID_DATA_ERR; } if (!reply.WriteUint32(IRemoteObject::IF_PROT_DATABUS) || !reply.WriteString(sessionName)) { - APP_LOGI("write to parcel fail"); + HILOG_INFO("write to parcel fail"); return IPC_STUB_INVALID_DATA_ERR; } @@ -478,13 +478,13 @@ std::string IPCObjectStub::CreateDatabusName(int uid, int pid) { std::shared_ptr softbusManager = ISessionService::GetInstance(); if (softbusManager == nullptr) { - APP_LOGI("fail to get softbus service"); + HILOG_INFO("fail to get softbus service"); return ""; } std::string sessionName = "DBinder" + std::to_string(uid) + std::string("_") + std::to_string(pid); if (softbusManager->GrantPermission(uid, pid, sessionName) != ERR_NONE) { - APP_LOGI("fail to Grant Permission softbus name"); + HILOG_INFO("fail to Grant Permission softbus name"); return ""; } diff --git a/frameworks/kits/content/cpp/src/ohos/aafwk/content/element_name.cpp b/frameworks/kits/content/cpp/src/ohos/aafwk/content/element_name.cpp index 3f851a8abb..81136897a2 100644 --- a/frameworks/kits/content/cpp/src/ohos/aafwk/content/element_name.cpp +++ b/frameworks/kits/content/cpp/src/ohos/aafwk/content/element_name.cpp @@ -17,8 +17,8 @@ #include "string_ex.h" -#include "app_log_wrapper.h" -#include "parcel_macro.h" +#include "ability_base_log_wrapper.h" +#include "parcel_macro_base.h" namespace OHOS { namespace AppExecFwk { @@ -59,17 +59,17 @@ void ElementName::ClearElement(ElementName *element) ElementName::ElementName(const std::string &deviceId, const std::string &bundleName, const std::string &abilityName) : deviceId_(deviceId), bundleName_(bundleName), abilityName_(abilityName) { - APP_LOGD("instance is created with parameters"); + ABILITYBASE_LOGD("instance is created with parameters"); } ElementName::ElementName() { - APP_LOGD("instance is created without parameter"); + ABILITYBASE_LOGD("instance is created without parameter"); } ElementName::~ElementName() { - APP_LOGD("instance is destroyed"); + ABILITYBASE_LOGD("instance is destroyed"); } std::string ElementName::GetURI() const @@ -95,7 +95,7 @@ ElementName *ElementName::Unmarshalling(Parcel &parcel) { ElementName *elementName = new (std::nothrow) ElementName(); if (elementName && !elementName->ReadFromParcel(parcel)) { - APP_LOGW("read from parcel failed"); + ABILITYBASE_LOGW("read from parcel failed"); delete elementName; elementName = nullptr; } diff --git a/frameworks/kits/content/cpp/src/ohos/aafwk/content/operation.cpp b/frameworks/kits/content/cpp/src/ohos/aafwk/content/operation.cpp index 8895ebb6dc..cb648e6d42 100644 --- a/frameworks/kits/content/cpp/src/ohos/aafwk/content/operation.cpp +++ b/frameworks/kits/content/cpp/src/ohos/aafwk/content/operation.cpp @@ -15,7 +15,7 @@ #include "operation.h" #include "operation_builder.h" -#include "parcel_macro.h" +#include "parcel_macro_base.h" using namespace OHOS::AppExecFwk; namespace OHOS { namespace AAFwk { @@ -373,21 +373,21 @@ void Operation::SetEntities(const std::vector &entities) void Operation::DumpInfo(int level) const { - APP_LOGI("=======Operation::DumpInfo level: %{public}d start=============", level); + ABILITYBASE_LOGI("=======Operation::DumpInfo level: %{public}d start=============", level); - APP_LOGI("===Operation::abilityName_ %{public}s =============", abilityName_.c_str()); - APP_LOGI("===Operation::action_ %{public}s =============", action_.c_str()); - APP_LOGI("===Operation::bundleName_ %{public}s =============", bundleName_.c_str()); - APP_LOGI("===Operation::deviceId_ %{public}s =============", deviceId_.c_str()); + ABILITYBASE_LOGI("===Operation::abilityName_ %{public}s =============", abilityName_.c_str()); + ABILITYBASE_LOGI("===Operation::action_ %{public}s =============", action_.c_str()); + ABILITYBASE_LOGI("===Operation::bundleName_ %{public}s =============", bundleName_.c_str()); + ABILITYBASE_LOGI("===Operation::deviceId_ %{public}s =============", deviceId_.c_str()); long entities_count = entities_.size(); - APP_LOGI("===Operation::entities_: count %{public}ld =============", entities_count); + ABILITYBASE_LOGI("===Operation::entities_: count %{public}ld =============", entities_count); for (long i = 0; i < entities_count; i++) { - APP_LOGI("=Operation::entities_[%{public}ld]:%{public}s =============", i, entities_[i].c_str()); + ABILITYBASE_LOGI("=Operation::entities_[%{public}ld]:%{public}s =============", i, entities_[i].c_str()); } - APP_LOGI("===Operation::flags_ %{public}ud =============", flags_); - APP_LOGI("===Operation::uri_ %{public}s =============", uri_.ToString().c_str()); + ABILITYBASE_LOGI("===Operation::flags_ %{public}ud =============", flags_); + ABILITYBASE_LOGI("===Operation::uri_ %{public}s =============", uri_.ToString().c_str()); - APP_LOGI("=======Operation::DumpInfo level: %{public}d end=============", level); + ABILITYBASE_LOGI("=======Operation::DumpInfo level: %{public}d end=============", level); } } // namespace AAFwk } // namespace OHOS \ No newline at end of file diff --git a/frameworks/kits/content/cpp/src/ohos/aafwk/content/pac_map.cpp b/frameworks/kits/content/cpp/src/ohos/aafwk/content/pac_map.cpp index 111872bad2..8a5122fa56 100644 --- a/frameworks/kits/content/cpp/src/ohos/aafwk/content/pac_map.cpp +++ b/frameworks/kits/content/cpp/src/ohos/aafwk/content/pac_map.cpp @@ -36,7 +36,7 @@ #include "ohos/aafwk/base/user_object_base.h" #include "ohos/aafwk/base/user_object_wrapper.h" #include "ohos/aafwk/base/zchar_wrapper.h" -#include "parcel_macro.h" +#include "parcel_macro_base.h" #include "string_ex.h" using IUserObject = OHOS::AAFwk::IUserObject; diff --git a/frameworks/kits/content/cpp/src/ohos/aafwk/content/patterns_matcher.cpp b/frameworks/kits/content/cpp/src/ohos/aafwk/content/patterns_matcher.cpp index b2a07d762a..2161ff85a8 100644 --- a/frameworks/kits/content/cpp/src/ohos/aafwk/content/patterns_matcher.cpp +++ b/frameworks/kits/content/cpp/src/ohos/aafwk/content/patterns_matcher.cpp @@ -14,7 +14,7 @@ */ #include "ohos/aafwk/content/patterns_matcher.h" -#include "parcel_macro.h" +#include "parcel_macro_base.h" using namespace OHOS::AppExecFwk; namespace OHOS { @@ -116,7 +116,7 @@ bool PatternsMatcher::MatchPattern(std::string pattern, std::string match, Match return GlobPattern(pattern, match); } default: { - APP_LOGE("MatchPattern::The other type"); + ABILITYBASE_LOGE("MatchPattern::The other type"); return false; } } diff --git a/frameworks/kits/content/cpp/src/ohos/aafwk/content/skills.cpp b/frameworks/kits/content/cpp/src/ohos/aafwk/content/skills.cpp index 8fe9002eee..fd863beb3d 100644 --- a/frameworks/kits/content/cpp/src/ohos/aafwk/content/skills.cpp +++ b/frameworks/kits/content/cpp/src/ohos/aafwk/content/skills.cpp @@ -14,7 +14,6 @@ */ #include "ohos/aafwk/content/skills.h" -#include "parcel_macro.h" using namespace OHOS; using namespace OHOS::AppExecFwk; namespace OHOS { diff --git a/frameworks/kits/content/cpp/src/ohos/aafwk/content/want.cpp b/frameworks/kits/content/cpp/src/ohos/aafwk/content/want.cpp index 1548a8992d..2641b5e684 100644 --- a/frameworks/kits/content/cpp/src/ohos/aafwk/content/want.cpp +++ b/frameworks/kits/content/cpp/src/ohos/aafwk/content/want.cpp @@ -33,7 +33,7 @@ #include "ohos/aafwk/base/double_wrapper.h" #include "ohos/aafwk/base/string_wrapper.h" #include "ohos/aafwk/base/zchar_wrapper.h" -#include "parcel_macro.h" +#include "parcel_macro_base.h" #include "string_ex.h" #include "want_params_wrapper.h" @@ -167,7 +167,7 @@ OHOS::AppExecFwk::ElementName Want::GetElement() const Want &Want::SetElementName(const std::string &bundleName, const std::string &abilityName) { if (bundleName.empty() || abilityName.empty()) { - APP_LOGE("Want::SetElementName : The bundleName and abilityName can't be empty."); + ABILITYBASE_LOGE("Want::SetElementName : The bundleName and abilityName can't be empty."); return *this; } @@ -186,7 +186,7 @@ Want &Want::SetElementName(const std::string &bundleName, const std::string &abi Want &Want::SetElementName(const std::string &deviceId, const std::string &bundleName, const std::string &abilityName) { if (bundleName.empty() || abilityName.empty()) { - APP_LOGE("Want::SetElementName : The bundleName and abilityName can't be empty."); + ABILITYBASE_LOGE("Want::SetElementName : The bundleName and abilityName can't be empty."); return *this; } operation_.SetDeviceId(deviceId); @@ -1932,14 +1932,14 @@ bool Want::CheckAndSetParameters(Want &want, const std::string &key, std::string void Want::DumpInfo(int level) const { - APP_LOGI("==================Want::DumpInfo level: %{public}d start=============", level); + ABILITYBASE_LOGI("==================Want::DumpInfo level: %{public}d start=============", level); operation_.DumpInfo(level); parameters_.DumpInfo(level); if (picker_ != nullptr) { picker_->DumpInfo(level + 1); } - APP_LOGI("==================Want::DumpInfo level: %{public}d end=============", level); + ABILITYBASE_LOGI("==================Want::DumpInfo level: %{public}d end=============", level); } nlohmann::json Want::ToJson() const @@ -1980,7 +1980,7 @@ bool Want::ReadFromJson(nlohmann::json &wantJson) || (wantJson.find("action") == jsonObjectEnd) || (wantJson.find("parameters") == jsonObjectEnd) || (wantJson.find("entities") == jsonObjectEnd)) { - APP_LOGE("Incomplete wantJson"); + ABILITYBASE_LOGE("Incomplete wantJson"); return false; } @@ -2022,7 +2022,7 @@ std::string Want::ToString() const Want *Want::FromString(std::string &string) { if (string.empty()) { - APP_LOGE("Invalid string."); + ABILITYBASE_LOGE("Invalid string."); return nullptr; } diff --git a/frameworks/kits/content/cpp/src/ohos/aafwk/content/want_params.cpp b/frameworks/kits/content/cpp/src/ohos/aafwk/content/want_params.cpp index fd1d4a23cf..ecb5205130 100644 --- a/frameworks/kits/content/cpp/src/ohos/aafwk/content/want_params.cpp +++ b/frameworks/kits/content/cpp/src/ohos/aafwk/content/want_params.cpp @@ -15,7 +15,7 @@ #include "want_params.h" -#include "app_log_wrapper.h" +#include "ability_base_log_wrapper.h" #include "ohos/aafwk/base/array_wrapper.h" #include "ohos/aafwk/base/base_interfaces.h" #include "ohos/aafwk/base/base_object.h" @@ -33,8 +33,6 @@ #include "string_ex.h" #include "want_params_wrapper.h" -using namespace OHOS::AppExecFwk; - namespace OHOS { namespace AAFwk { UnsupportedData::~UnsupportedData() @@ -51,7 +49,7 @@ UnsupportedData::UnsupportedData(const UnsupportedData &other) : key(other.key), { buffer = new uint8_t[size]; if (memcpy_s(buffer, size, other.buffer, size) != EOK) { - APP_LOGI("copy construct fail due to memcpy"); + ABILITYBASE_LOGI("copy construct fail due to memcpy"); key.clear(); type = 0; @@ -79,7 +77,7 @@ UnsupportedData &UnsupportedData::operator=(const UnsupportedData &other) size = other.size; buffer = new uint8_t[size]; if (memcpy_s(buffer, size, other.buffer, size) != EOK) { - APP_LOGI("copy assignment fail due to memcpy"); + ABILITYBASE_LOGI("copy assignment fail due to memcpy"); key.clear(); type = 0; @@ -726,7 +724,7 @@ bool WantParams::WriteArrayToParcelBool(Parcel &parcel, IArray *ao) const } for (std::vector::size_type i = 0; i < array.size(); i++) { - APP_LOGI("%{public}s bool of array: %{public}d", __func__, array[i]); + ABILITYBASE_LOGI("%{public}s bool of array: %{public}d", __func__, array[i]); intArray.push_back(array[i]); } return parcel.WriteInt32Vector(intArray); @@ -857,10 +855,10 @@ bool WantParams::WriteArrayToParcel(Parcel &parcel, IArray *ao) const bool WantParams::ReadFromParcelArrayString(Parcel &parcel, sptr &ao) { - APP_LOGI("%{public}s called.", __func__); + ABILITYBASE_LOGI("%{public}s called.", __func__); std::vector value; if (!parcel.ReadString16Vector(&value)) { - APP_LOGI("%{public}s read string of array fail.", __func__); + ABILITYBASE_LOGI("%{public}s read string of array fail.", __func__); return false; } @@ -872,18 +870,18 @@ bool WantParams::ReadFromParcelArrayString(Parcel &parcel, sptr &ao) } return true; } else { - APP_LOGI("%{public}s create string of array fail.", __func__); + ABILITYBASE_LOGI("%{public}s create string of array fail.", __func__); } return false; } bool WantParams::ReadFromParcelArrayBool(Parcel &parcel, sptr &ao) { - APP_LOGI("%{public}s called.", __func__); + ABILITYBASE_LOGI("%{public}s called.", __func__); std::vector value; std::vector boolValue; if (!parcel.ReadInt32Vector(&value)) { - APP_LOGI("%{public}s read bool of array fail.", __func__); + ABILITYBASE_LOGI("%{public}s read bool of array fail.", __func__); return false; } @@ -896,10 +894,10 @@ bool WantParams::ReadFromParcelArrayBool(Parcel &parcel, sptr &ao) bool WantParams::ReadFromParcelArrayByte(Parcel &parcel, sptr &ao) { - APP_LOGI("%{public}s called.", __func__); + ABILITYBASE_LOGI("%{public}s called.", __func__); std::vector value; if (!parcel.ReadInt8Vector(&value)) { - APP_LOGI("%{public}s read byte of array fail.", __func__); + ABILITYBASE_LOGI("%{public}s read byte of array fail.", __func__); return false; } return SetArray(g_IID_IByte, value, ao); @@ -907,10 +905,10 @@ bool WantParams::ReadFromParcelArrayByte(Parcel &parcel, sptr &ao) bool WantParams::ReadFromParcelArrayChar(Parcel &parcel, sptr &ao) { - APP_LOGI("%{public}s called.", __func__); + ABILITYBASE_LOGI("%{public}s called.", __func__); std::vector value; if (!parcel.ReadInt32Vector(&value)) { - APP_LOGI("%{public}s char bool of array fail.", __func__); + ABILITYBASE_LOGI("%{public}s char bool of array fail.", __func__); return false; } return SetArray(g_IID_IChar, value, ao); @@ -918,10 +916,10 @@ bool WantParams::ReadFromParcelArrayChar(Parcel &parcel, sptr &ao) bool WantParams::ReadFromParcelArrayShort(Parcel &parcel, sptr &ao) { - APP_LOGI("%{public}s called.", __func__); + ABILITYBASE_LOGI("%{public}s called.", __func__); std::vector value; if (!parcel.ReadInt16Vector(&value)) { - APP_LOGI("%{public}s read short of array fail.", __func__); + ABILITYBASE_LOGI("%{public}s read short of array fail.", __func__); return false; } return SetArray(g_IID_IShort, value, ao); @@ -929,10 +927,10 @@ bool WantParams::ReadFromParcelArrayShort(Parcel &parcel, sptr &ao) bool WantParams::ReadFromParcelArrayInt(Parcel &parcel, sptr &ao) { - APP_LOGI("%{public}s called.", __func__); + ABILITYBASE_LOGI("%{public}s called.", __func__); std::vector value; if (!parcel.ReadInt32Vector(&value)) { - APP_LOGI("%{public}s read int of array fail.", __func__); + ABILITYBASE_LOGI("%{public}s read int of array fail.", __func__); return false; } return SetArray(g_IID_IInteger, value, ao); @@ -940,10 +938,10 @@ bool WantParams::ReadFromParcelArrayInt(Parcel &parcel, sptr &ao) bool WantParams::ReadFromParcelArrayLong(Parcel &parcel, sptr &ao) { - APP_LOGI("%{public}s called.", __func__); + ABILITYBASE_LOGI("%{public}s called.", __func__); std::vector value; if (!parcel.ReadInt64Vector(&value)) { - APP_LOGI("%{public}s read long of array fail.", __func__); + ABILITYBASE_LOGI("%{public}s read long of array fail.", __func__); return false; } @@ -960,10 +958,10 @@ bool WantParams::ReadFromParcelArrayLong(Parcel &parcel, sptr &ao) bool WantParams::ReadFromParcelArrayFloat(Parcel &parcel, sptr &ao) { - APP_LOGI("%{public}s called.", __func__); + ABILITYBASE_LOGI("%{public}s called.", __func__); std::vector value; if (!parcel.ReadFloatVector(&value)) { - APP_LOGI("%{public}s read float of array fail.", __func__); + ABILITYBASE_LOGI("%{public}s read float of array fail.", __func__); return false; } return SetArray(g_IID_IFloat, value, ao); @@ -971,10 +969,10 @@ bool WantParams::ReadFromParcelArrayFloat(Parcel &parcel, sptr &ao) bool WantParams::ReadFromParcelArrayDouble(Parcel &parcel, sptr &ao) { - APP_LOGI("%{public}s called.", __func__); + ABILITYBASE_LOGI("%{public}s called.", __func__); std::vector value; if (!parcel.ReadDoubleVector(&value)) { - APP_LOGI("%{public}s read double of array fail.", __func__); + ABILITYBASE_LOGI("%{public}s read double of array fail.", __func__); return false; } return SetArray(g_IID_IDouble, value, ao); @@ -985,34 +983,34 @@ bool WantParams::ReadArrayToParcel(Parcel &parcel, int type, sptr &ao) switch (type) { case VALUE_TYPE_STRINGARRAY: case VALUE_TYPE_CHARSEQUENCEARRAY: - APP_LOGI("%{public}s type=VALUE_TYPE_STRINGARRAY|VALUE_TYPE_CHARSEQUENCEARRAY.", __func__); + ABILITYBASE_LOGI("%{public}s type=VALUE_TYPE_STRINGARRAY|VALUE_TYPE_CHARSEQUENCEARRAY.", __func__); return ReadFromParcelArrayString(parcel, ao); case VALUE_TYPE_BOOLEANARRAY: - APP_LOGI("%{public}s type=VALUE_TYPE_BOOLEANARRAY.", __func__); + ABILITYBASE_LOGI("%{public}s type=VALUE_TYPE_BOOLEANARRAY.", __func__); return ReadFromParcelArrayBool(parcel, ao); case VALUE_TYPE_BYTEARRAY: - APP_LOGI("%{public}s type=VALUE_TYPE_BYTEARRAY.", __func__); + ABILITYBASE_LOGI("%{public}s type=VALUE_TYPE_BYTEARRAY.", __func__); return ReadFromParcelArrayByte(parcel, ao); case VALUE_TYPE_CHARARRAY: - APP_LOGI("%{public}s type=VALUE_TYPE_CHARARRAY.", __func__); + ABILITYBASE_LOGI("%{public}s type=VALUE_TYPE_CHARARRAY.", __func__); return ReadFromParcelArrayChar(parcel, ao); case VALUE_TYPE_SHORTARRAY: - APP_LOGI("%{public}s type=VALUE_TYPE_SHORTARRAY.", __func__); + ABILITYBASE_LOGI("%{public}s type=VALUE_TYPE_SHORTARRAY.", __func__); return ReadFromParcelArrayShort(parcel, ao); case VALUE_TYPE_INTARRAY: - APP_LOGI("%{public}s type=VALUE_TYPE_INTARRAY.", __func__); + ABILITYBASE_LOGI("%{public}s type=VALUE_TYPE_INTARRAY.", __func__); return ReadFromParcelArrayInt(parcel, ao); case VALUE_TYPE_LONGARRAY: - APP_LOGI("%{public}s type=VALUE_TYPE_LONGARRAY.", __func__); + ABILITYBASE_LOGI("%{public}s type=VALUE_TYPE_LONGARRAY.", __func__); return ReadFromParcelArrayLong(parcel, ao); case VALUE_TYPE_FLOATARRAY: - APP_LOGI("%{public}s type=VALUE_TYPE_FLOATARRAY.", __func__); + ABILITYBASE_LOGI("%{public}s type=VALUE_TYPE_FLOATARRAY.", __func__); return ReadFromParcelArrayFloat(parcel, ao); case VALUE_TYPE_DOUBLEARRAY: - APP_LOGI("%{public}s type=VALUE_TYPE_DOUBLEARRAY.", __func__); + ABILITYBASE_LOGI("%{public}s type=VALUE_TYPE_DOUBLEARRAY.", __func__); return ReadFromParcelArrayDouble(parcel, ao); default: - APP_LOGI("%{public}s type=UNKNOWN, nothing to do.", __func__); + ABILITYBASE_LOGI("%{public}s type=UNKNOWN, nothing to do.", __func__); break; } @@ -1023,102 +1021,102 @@ bool WantParams::ReadFromParcelString(Parcel &parcel, const std::string &key) { std::u16string value = parcel.ReadString16(); std::string strValue(Str16ToStr8(value)); - APP_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); sptr intf = String::Box(Str16ToStr8(value)); if (intf) { SetParam(key, intf); } else { - APP_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); } return true; } bool WantParams::ReadFromParcelBool(Parcel &parcel, const std::string &key) { - APP_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); int8_t value; if (parcel.ReadInt8(value)) { sptr intf = Boolean::Box(value); if (intf) { SetParam(key, intf); } else { - APP_LOGI("%{public}s insert param fail: key=%{public}s", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s insert param fail: key=%{public}s", __func__, key.c_str()); } return true; } else { - APP_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); return false; } } bool WantParams::ReadFromParcelInt8(Parcel &parcel, const std::string &key) { - APP_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); int8_t value; if (parcel.ReadInt8(value)) { sptr intf = Byte::Box(value); if (intf) { SetParam(key, intf); } else { - APP_LOGI("%{public}s insert param fail: key=%{public}s", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s insert param fail: key=%{public}s", __func__, key.c_str()); } return true; } else { - APP_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); return false; } } bool WantParams::ReadFromParcelChar(Parcel &parcel, const std::string &key) { - APP_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); int32_t value; if (parcel.ReadInt32(value)) { sptr intf = Char::Box(value); if (intf) { SetParam(key, intf); } else { - APP_LOGI("%{public}s insert param fail: key=%{public}s", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s insert param fail: key=%{public}s", __func__, key.c_str()); } return true; } else { - APP_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); return false; } } bool WantParams::ReadFromParcelShort(Parcel &parcel, const std::string &key) { - APP_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); short value; if (parcel.ReadInt16(value)) { sptr intf = Short::Box(value); if (intf) { SetParam(key, intf); } else { - APP_LOGI("%{public}s insert param fail: key=%{public}s", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s insert param fail: key=%{public}s", __func__, key.c_str()); } return true; } else { - APP_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); return false; } } bool WantParams::ReadFromParcelInt(Parcel &parcel, const std::string &key) { - APP_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); int value; if (parcel.ReadInt32(value)) { sptr intf = Integer::Box(value); if (intf) { SetParam(key, intf); } else { - APP_LOGI("%{public}s insert param fail: key=%{public}s", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s insert param fail: key=%{public}s", __func__, key.c_str()); } return true; } else { - APP_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); return false; } } @@ -1133,7 +1131,7 @@ bool WantParams::ReadFromParcelWantParamWrapper(Parcel &parcel, const std::strin } bool WantParams::ReadFromParcelLong(Parcel &parcel, const std::string &key) { - APP_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); int64_t value; if (parcel.ReadInt64(value)) { std::string strValue(std::to_string(value)); @@ -1145,47 +1143,47 @@ bool WantParams::ReadFromParcelLong(Parcel &parcel, const std::string &key) if (intf) { SetParam(key, intf); } else { - APP_LOGI("%{public}s insert param fail: key=%{public}s", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s insert param fail: key=%{public}s", __func__, key.c_str()); } return true; } else { - APP_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); return false; } } bool WantParams::ReadFromParcelFloat(Parcel &parcel, const std::string &key) { - APP_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); float value; if (parcel.ReadFloat(value)) { sptr intf = Float::Box(value); if (intf) { SetParam(key, intf); } else { - APP_LOGI("%{public}s insert param fail: key=%{public}s", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s insert param fail: key=%{public}s", __func__, key.c_str()); } return true; } else { - APP_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); return false; } } bool WantParams::ReadFromParcelDouble(Parcel &parcel, const std::string &key) { - APP_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s key=%{public}s.", __func__, key.c_str()); double value; if (parcel.ReadDouble(value)) { sptr intf = Double::Box(value); if (intf) { SetParam(key, intf); } else { - APP_LOGI("%{public}s insert param fail: key=%{public}s", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s insert param fail: key=%{public}s", __func__, key.c_str()); } return true; } else { - APP_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); + ABILITYBASE_LOGI("%{public}s read data fail: key=%{public}s", __func__, key.c_str()); return false; } } @@ -1280,20 +1278,20 @@ bool WantParams::ReadFromParcel(Parcel &parcel) { int32_t size; if (!parcel.ReadInt32(size)) { - APP_LOGI("%{public}s read size fail.", __func__); + ABILITYBASE_LOGI("%{public}s read size fail.", __func__); return false; } - APP_LOGI("%{public}s size=%{public}d.", __func__, size); + ABILITYBASE_LOGI("%{public}s size=%{public}d.", __func__, size); for (int32_t i = 0; i < size; i++) { - APP_LOGI("%{public}s get i=%{public}d", __func__, i); + ABILITYBASE_LOGI("%{public}s get i=%{public}d", __func__, i); std::u16string key = parcel.ReadString16(); int type; if (!parcel.ReadInt32(type)) { - APP_LOGI("%{public}s read type fail.", __func__); + ABILITYBASE_LOGI("%{public}s read type fail.", __func__); return false; } if (!ReadFromParcelParam(parcel, Str16ToStr8(key), type)) { - APP_LOGI("%{public}s get i=%{public}d fail.", __func__, i); + ABILITYBASE_LOGI("%{public}s get i=%{public}d fail.", __func__, i); return false; } } @@ -1309,26 +1307,26 @@ WantParams *WantParams::Unmarshalling(Parcel &parcel) { int32_t bufferSize; if (!parcel.ReadInt32(bufferSize)) { - APP_LOGI("%{public}s read bufferSize fail.", __func__); + ABILITYBASE_LOGI("%{public}s read bufferSize fail.", __func__); return nullptr; } - APP_LOGI("%{public}s bufferSize=%{public}d.", __func__, bufferSize); + ABILITYBASE_LOGI("%{public}s bufferSize=%{public}d.", __func__, bufferSize); // Corresponding to Parcel#writeByteArray() in Java. int32_t length; if (!parcel.ReadInt32(length)) { - APP_LOGI("%{public}s read length fail.", __func__); + ABILITYBASE_LOGI("%{public}s read length fail.", __func__); return nullptr; } const uint8_t *dataInBytes = parcel.ReadUnpadBuffer(bufferSize); if (dataInBytes == nullptr) { - APP_LOGI("%{public}s read buffer fail.", __func__); + ABILITYBASE_LOGI("%{public}s read buffer fail.", __func__); return nullptr; } Parcel tempParcel; if (!tempParcel.WriteBuffer(dataInBytes, bufferSize)) { - APP_LOGI("%{public}s tempParcel.WriteBuffer fail.", __func__); + ABILITYBASE_LOGI("%{public}s tempParcel.WriteBuffer fail.", __func__); return nullptr; } @@ -1342,21 +1340,22 @@ WantParams *WantParams::Unmarshalling(Parcel &parcel) void WantParams::DumpInfo(int level) const { - APP_LOGI("=======WantParams::DumpInfo level: %{public}d start=============", level); + ABILITYBASE_LOGI("=======WantParams::DumpInfo level: %{public}d start=============", level); int params_size = params_.size(); - APP_LOGI("===WantParams::params_: count %{public}d =============", params_size); + ABILITYBASE_LOGI("===WantParams::params_: count %{public}d =============", params_size); int typeId = VALUE_TYPE_NULL; for (auto it : params_) { typeId = VALUE_TYPE_NULL; typeId = WantParams::GetDataType(it.second); if (typeId != VALUE_TYPE_NULL) { std::string value = WantParams::GetStringByType(it.second, typeId); - APP_LOGI("=WantParams::params_[%{public}s] : %{public}s =============", it.first.c_str(), value.c_str()); + ABILITYBASE_LOGI( + "=WantParams::params_[%{public}s] : %{public}s =============", it.first.c_str(), value.c_str()); } else { - APP_LOGI("=WantParams::params_[%{public}s] : type error =============", it.first.c_str()); + ABILITYBASE_LOGI("=WantParams::params_[%{public}s] : type error =============", it.first.c_str()); } } - APP_LOGI("=======WantParams::DumpInfo level: %{public}d end=============", level); + ABILITYBASE_LOGI("=======WantParams::DumpInfo level: %{public}d end=============", level); } } // namespace AAFwk } // namespace OHOS diff --git a/frameworks/kits/content/cpp/test/BUILD.gn b/frameworks/kits/content/cpp/test/BUILD.gn index aa7651dfc3..21ce9b0b4c 100644 --- a/frameworks/kits/content/cpp/test/BUILD.gn +++ b/frameworks/kits/content/cpp/test/BUILD.gn @@ -28,8 +28,8 @@ config("module_private_config") { ] defines = [ - "APP_LOG_TAG = \"WantUnitTest\"", - "LOG_DOMAIN = 0xD002210", + "ABILITYBASE_LOG_TAG = \"WantUnitTest\"", + "ABILITYBASE_LOG_DOMAIN = 0xD002210", ] } @@ -43,8 +43,8 @@ config("module_private_want_param_wrapper_config") { ] defines = [ - "APP_LOG_TAG = \"WantUnitTest\"", - "LOG_DOMAIN = 0xD002210", + "ABILITYBASE_LOG_TAG = \"WantUnitTest\"", + "ABILITYBASE_LOG_DOMAIN = 0xD002210", ] } diff --git a/frameworks/kits/fmskit/BUILD.gn b/frameworks/kits/fmskit/BUILD.gn index 9056dd3453..fb3a4eb8fe 100644 --- a/frameworks/kits/fmskit/BUILD.gn +++ b/frameworks/kits/fmskit/BUILD.gn @@ -17,13 +17,14 @@ SUBSYSTEM_DIR = "//foundation/aafwk/standard" config("fmskit_config") { defines = [ - "APP_LOG_TAG = \"FmskitNative\"", - "LOG_DOMAIN = 0xD001151", + "AMS_LOG_TAG = \"FmskitNative\"", + "AMS_LOG_DOMAIN = 0xD001151", ] } config("fmskit_public_config") { include_dirs = [ "//foundation/aafwk/standard/frameworks/kits/fmskit/native/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "//foundation/aafwk/standard/interfaces/innerkits/form_manager/include", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base/include", @@ -45,20 +46,18 @@ ohos_shared_library("fmskit_native") { if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } - deps = [ - "${appexecfwk_path}/common:libappexecfwk_common", - "//foundation/aafwk/standard/interfaces/innerkits/form_manager:form_manager", - "//utils/native/base:utils", - ] + deps = [ "${appexecfwk_path}/common:libappexecfwk_common" ] external_deps = [ "ability_base:want", "ability_runtime:app_manager", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", + "form_runtime:form_manager", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "samgr_standard:samgr_proxy", + "utils_base:utils", ] subsystem_name = "aafwk" diff --git a/frameworks/kits/fmskit/native/src/form_host_client.cpp b/frameworks/kits/fmskit/native/src/form_host_client.cpp index 2e872b3d3f..a9ad08d3c7 100755 --- a/frameworks/kits/fmskit/native/src/form_host_client.cpp +++ b/frameworks/kits/fmskit/native/src/form_host_client.cpp @@ -15,7 +15,7 @@ #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "form_host_client.h" namespace OHOS { @@ -56,9 +56,9 @@ sptr FormHostClient::GetInstance() */ void FormHostClient::AddForm(std::shared_ptr formCallback, const int64_t formId) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (formId <= 0 || formCallback == nullptr) { - APP_LOGE("%{public}s error, invalid formId or formCallback.", __func__); + HILOG_ERROR("%{public}s error, invalid formId or formCallback.", __func__); return; } std::lock_guard lock(callbackMutex_); @@ -81,22 +81,22 @@ void FormHostClient::AddForm(std::shared_ptr formCallback */ void FormHostClient::RemoveForm(std::shared_ptr formCallback, const int64_t formId) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (formId <= 0 || formCallback == nullptr) { - APP_LOGE("%{public}s, invalid formId or formCallback.", __func__); + HILOG_ERROR("%{public}s, invalid formId or formCallback.", __func__); return; } std::lock_guard lock(callbackMutex_); auto iter = formCallbackMap_.find(formId); if (iter == formCallbackMap_.end()) { - APP_LOGE("%{public}s, not find formId:%{public}s.", __func__, std::to_string(formId).c_str()); + HILOG_ERROR("%{public}s, not find formId:%{public}s.", __func__, std::to_string(formId).c_str()); return; } iter->second.erase(formCallback); if (iter->second.empty()) { formCallbackMap_.erase(iter); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -107,7 +107,7 @@ void FormHostClient::RemoveForm(std::shared_ptr formCallb */ bool FormHostClient::ContainsForm(int64_t formId) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::lock_guard lock(callbackMutex_); return formCallbackMap_.find(formId) != formCallbackMap_.end(); } @@ -120,21 +120,21 @@ bool FormHostClient::ContainsForm(int64_t formId) */ void FormHostClient::OnAcquired(const FormJsInfo &formJsInfo) { - APP_LOGI("%{public}s called.", __func__); - APP_LOGI("Imamge number is %{public}zu.", formJsInfo.imageDataMap.size()); + HILOG_INFO("%{public}s called.", __func__); + HILOG_INFO("Imamge number is %{public}zu.", formJsInfo.imageDataMap.size()); int64_t formId = formJsInfo.formId; if (formId < 0) { - APP_LOGE("%{public}s error, the passed form id can't be negative.", __func__); + HILOG_ERROR("%{public}s error, the passed form id can't be negative.", __func__); return; } std::lock_guard lock(callbackMutex_); auto iter = formCallbackMap_.find(formId); if (iter == formCallbackMap_.end()) { - APP_LOGE("%{public}s error, not find formId:%{public}s.", __func__, std::to_string(formId).c_str()); + HILOG_ERROR("%{public}s error, not find formId:%{public}s.", __func__, std::to_string(formId).c_str()); return; } for (const auto& callback : iter->second) { - APP_LOGI("%{public}s, formId: %{public}" PRId64 ", jspath: %{public}s, data: %{public}s", + HILOG_INFO("%{public}s, formId: %{public}" PRId64 ", jspath: %{public}s, data: %{public}s", __func__, formId, formJsInfo.jsFormCodePath.c_str(), formJsInfo.formData.c_str()); callback->ProcessFormUpdate(formJsInfo); } @@ -148,21 +148,21 @@ void FormHostClient::OnAcquired(const FormJsInfo &formJsInfo) */ void FormHostClient::OnUpdate(const FormJsInfo &formJsInfo) { - APP_LOGI("%{public}s called.", __func__); - APP_LOGI("Imamge number is %{public}zu.", formJsInfo.imageDataMap.size()); + HILOG_INFO("%{public}s called.", __func__); + HILOG_INFO("Imamge number is %{public}zu.", formJsInfo.imageDataMap.size()); int64_t formId = formJsInfo.formId; if (formId < 0) { - APP_LOGE("%{public}s error, the passed form id can't be negative.", __func__); + HILOG_ERROR("%{public}s error, the passed form id can't be negative.", __func__); return; } std::lock_guard lock(callbackMutex_); auto iter = formCallbackMap_.find(formId); if (iter == formCallbackMap_.end()) { - APP_LOGE("%{public}s error, not find formId:%{public}s.", __func__, std::to_string(formId).c_str()); + HILOG_ERROR("%{public}s error, not find formId:%{public}s.", __func__, std::to_string(formId).c_str()); return; } for (const auto& callback : iter->second) { - APP_LOGI("%{public}s, formId: %{public}" PRId64 ", jspath: %{public}s, data: %{public}s", + HILOG_INFO("%{public}s, formId: %{public}" PRId64 ", jspath: %{public}s, data: %{public}s", __func__, formId, formJsInfo.jsFormCodePath.c_str(), formJsInfo.formData.c_str()); callback->ProcessFormUpdate(formJsInfo); } @@ -176,24 +176,24 @@ void FormHostClient::OnUpdate(const FormJsInfo &formJsInfo) */ void FormHostClient::OnUninstall(const std::vector &formIds) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (formIds.empty()) { - APP_LOGE("%{public}s error, formIds is empty.", __func__); + HILOG_ERROR("%{public}s error, formIds is empty.", __func__); return; } for (auto &formId : formIds) { if (formId < 0) { - APP_LOGE("%{public}s error, the passed form id can't be negative.", __func__); + HILOG_ERROR("%{public}s error, the passed form id can't be negative.", __func__); continue; } std::lock_guard lock(callbackMutex_); auto iter = formCallbackMap_.find(formId); if (iter == formCallbackMap_.end()) { - APP_LOGE("%{public}s error, not find formId:%{public}s.", __func__, std::to_string(formId).c_str()); + HILOG_ERROR("%{public}s error, not find formId:%{public}s.", __func__, std::to_string(formId).c_str()); continue; } for (const auto& callback : iter->second) { - APP_LOGE("%{public}s uninstall formId:%{public}s.", __func__, std::to_string(formId).c_str()); + HILOG_ERROR("%{public}s uninstall formId:%{public}s.", __func__, std::to_string(formId).c_str()); callback->ProcessFormUninstall(formId); } } diff --git a/frameworks/kits/fmskit/native/src/form_mgr.cpp b/frameworks/kits/fmskit/native/src/form_mgr.cpp index 6dc0c35ee1..ce95771d8d 100644 --- a/frameworks/kits/fmskit/native/src/form_mgr.cpp +++ b/frameworks/kits/fmskit/native/src/form_mgr.cpp @@ -17,9 +17,9 @@ #include -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" #include "form_errors.h" +#include "hilog_wrapper.h" #include "if_system_ability_manager.h" #include "ipc_skeleton.h" #include "iservice_registry.h" @@ -63,10 +63,10 @@ int FormMgr::AddForm( const sptr &callerToken, FormJsInfo &formInfo) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s failed errCode:%{public}d.", __func__, errCode); + HILOG_ERROR("%{public}s failed errCode:%{public}d.", __func__, errCode); return errCode; } return remoteProxy_->AddForm(formId, want, callerToken, formInfo); @@ -80,10 +80,10 @@ int FormMgr::AddForm( */ int FormMgr::DeleteForm(const int64_t formId, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s failed errCode:%{public}d.", __func__, errCode); + HILOG_ERROR("%{public}s failed errCode:%{public}d.", __func__, errCode); return errCode; } return remoteProxy_->DeleteForm(formId, callerToken); @@ -98,10 +98,10 @@ int FormMgr::DeleteForm(const int64_t formId, const sptr &callerT */ int FormMgr::ReleaseForm(const int64_t formId, const sptr &callerToken, const bool delCache) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s failed errCode:%{public}d.", __func__, errCode); + HILOG_ERROR("%{public}s failed errCode:%{public}d.", __func__, errCode); return errCode; } return remoteProxy_->ReleaseForm(formId, callerToken, delCache); @@ -116,10 +116,10 @@ int FormMgr::ReleaseForm(const int64_t formId, const sptr &caller */ int FormMgr::UpdateForm(const int64_t formId, const std::string &bundleName, const FormProviderData &formBindingData) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s failed errCode:%{public}d.", __func__, errCode); + HILOG_ERROR("%{public}s failed errCode:%{public}d.", __func__, errCode); return errCode; } return remoteProxy_->UpdateForm(formId, bundleName, formBindingData); @@ -137,10 +137,10 @@ int FormMgr::UpdateForm(const int64_t formId, const std::string &bundleName, con */ int FormMgr::RequestForm(const int64_t formId, const sptr &callerToken, const Want &want) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s failed errCode:%{public}d.", __func__, errCode); + HILOG_ERROR("%{public}s failed errCode:%{public}d.", __func__, errCode); return errCode; } return remoteProxy_->RequestForm(formId, callerToken, want); @@ -158,10 +158,10 @@ int FormMgr::NotifyWhetherVisibleForms( const sptr &callerToken, const int32_t formVisibleType) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s failed errCode:%{public}d.", __func__, errCode); + HILOG_ERROR("%{public}s failed errCode:%{public}d.", __func__, errCode); return errCode; } return remoteProxy_->NotifyWhetherVisibleForms(formIds, callerToken, formVisibleType); @@ -175,10 +175,10 @@ int FormMgr::NotifyWhetherVisibleForms( */ int FormMgr::CastTempForm(const int64_t formId, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s failed errCode:%{public}d.", __func__, errCode); + HILOG_ERROR("%{public}s failed errCode:%{public}d.", __func__, errCode); return errCode; } return remoteProxy_->CastTempForm(formId, callerToken); @@ -191,10 +191,10 @@ int FormMgr::CastTempForm(const int64_t formId, const sptr &calle */ int FormMgr::DumpStorageFormInfos(std::string &formInfos) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s failed errCode:%{public}d.", __func__, errCode); + HILOG_ERROR("%{public}s failed errCode:%{public}d.", __func__, errCode); return errCode; } return remoteProxy_->DumpStorageFormInfos(formInfos); @@ -207,10 +207,10 @@ int FormMgr::DumpStorageFormInfos(std::string &formInfos) */ int FormMgr::DumpFormInfoByBundleName(const std::string bundleName, std::string &formInfos) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s failed errCode:%{public}d.", __func__, errCode); + HILOG_ERROR("%{public}s failed errCode:%{public}d.", __func__, errCode); return errCode; } return remoteProxy_->DumpFormInfoByBundleName(bundleName, formInfos); @@ -223,10 +223,10 @@ int FormMgr::DumpFormInfoByBundleName(const std::string bundleName, std::string */ int FormMgr::DumpFormInfoByFormId(const std::int64_t formId, std::string &formInfo) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s failed errCode:%{public}d.", __func__, errCode); + HILOG_ERROR("%{public}s failed errCode:%{public}d.", __func__, errCode); return errCode; } return remoteProxy_->DumpFormInfoByFormId(formId, formInfo); @@ -239,10 +239,10 @@ int FormMgr::DumpFormInfoByFormId(const std::int64_t formId, std::string &formIn */ int FormMgr::DumpFormTimerByFormId(const std::int64_t formId, std::string &isTimingService) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s failed errCode:%{public}d.", __func__, errCode); + HILOG_ERROR("%{public}s failed errCode:%{public}d.", __func__, errCode); return errCode; } return remoteProxy_->DumpFormTimerByFormId(formId, isTimingService); @@ -256,10 +256,10 @@ int FormMgr::DumpFormTimerByFormId(const std::int64_t formId, std::string &isTim */ int FormMgr::MessageEvent(const int64_t formId, const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s failed errCode:%{public}d.", __func__, errCode); + HILOG_ERROR("%{public}s failed errCode:%{public}d.", __func__, errCode); return errCode; } return remoteProxy_->MessageEvent(formId, want, callerToken); @@ -273,10 +273,10 @@ int FormMgr::MessageEvent(const int64_t formId, const Want &want, const sptrSetNextRefreshTime(formId, nextTime); @@ -294,10 +294,10 @@ int FormMgr::LifecycleUpdate( const sptr &callerToken, const int32_t updateType) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s failed errCode:%{public}d.", __func__, errCode); + HILOG_ERROR("%{public}s failed errCode:%{public}d.", __func__, errCode); return errCode; } return remoteProxy_->LifecycleUpdate(formIds, callerToken, updateType); @@ -309,7 +309,7 @@ int FormMgr::LifecycleUpdate( */ int FormMgr::GetRecoverStatus() { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); return recoverStatus_; } @@ -320,7 +320,7 @@ int FormMgr::GetRecoverStatus() */ void FormMgr::SetRecoverStatus(int recoverStatus) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); recoverStatus_ = recoverStatus; } @@ -332,7 +332,7 @@ void FormMgr::SetRecoverStatus(int recoverStatus) */ std::string FormMgr::GetErrorMessage(int errCode) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); return FormErrors::GetInstance().GetErrorMessage(errCode); } @@ -343,9 +343,9 @@ std::string FormMgr::GetErrorMessage(int errCode) */ void FormMgr::RegisterDeathCallback(const std::shared_ptr &formDeathCallback) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (formDeathCallback == nullptr) { - APP_LOGE("%{public}s error, form death callback is nullptr.", __func__); + HILOG_ERROR("%{public}s error, form death callback is nullptr.", __func__); return; } formDeathCallbacks_.emplace_back(formDeathCallback); @@ -358,9 +358,9 @@ void FormMgr::RegisterDeathCallback(const std::shared_ptr */ void FormMgr::UnRegisterDeathCallback(const std::shared_ptr &formDeathCallback) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (formDeathCallback == nullptr) { - APP_LOGE("%{public}s error, form death callback is nullptr.", __func__); + HILOG_ERROR("%{public}s error, form death callback is nullptr.", __func__); return; } @@ -369,7 +369,7 @@ void FormMgr::UnRegisterDeathCallback(const std::shared_ptr FormMgr::GetDeathRecipient() const */ bool FormMgr::CheckIsDeathCallbackRegistered(const std::shared_ptr &formDeathCallback) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); auto iter = std::find(formDeathCallbacks_.begin(), formDeathCallbacks_.end(), formDeathCallback); if (iter != formDeathCallbacks_.end()) { return true; @@ -402,21 +402,21 @@ bool FormMgr::CheckIsDeathCallbackRegistered(const std::shared_ptr &remote) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (remote == nullptr) { - APP_LOGE("%{public}s failed, remote is nullptr.", __func__); + HILOG_ERROR("%{public}s failed, remote is nullptr.", __func__); return; } if (FormMgr::GetInstance().GetRecoverStatus() == Constants::IN_RECOVERING) { - APP_LOGW("%{public}s, fms in recovering.", __func__); + HILOG_WARN("%{public}s, fms in recovering.", __func__); return; } // Reset proxy FormMgr::GetInstance().ResetProxy(remote); if (!FormMgr::GetInstance().Reconnect()) { - APP_LOGE("%{public}s, form mgr service died, try to reconnect to fms failed.", __func__); + HILOG_ERROR("%{public}s, form mgr service died, try to reconnect to fms failed.", __func__); FormMgr::GetInstance().SetRecoverStatus(Constants::RECOVER_FAIL); return; } @@ -435,18 +435,18 @@ void FormMgr::FormMgrDeathRecipient::OnRemoteDied(const wptr &rem */ bool FormMgr::Reconnect() { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); for (int i = 0; i < Constants::MAX_RETRY_TIME; i++) { // Sleep 1000 milliseconds before reconnect. std::this_thread::sleep_for(std::chrono::milliseconds(Constants::SLEEP_TIME)); // try to connect fms if (Connect() != ERR_OK) { - APP_LOGE("%{public}s, get fms proxy fail, try again.", __func__); + HILOG_ERROR("%{public}s, get fms proxy fail, try again.", __func__); continue; } - APP_LOGI("%{public}s, get fms proxy success.", __func__); + HILOG_INFO("%{public}s, get fms proxy success.", __func__); return true; } @@ -466,26 +466,26 @@ ErrCode FormMgr::Connect() sptr systemManager = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (systemManager == nullptr) { - APP_LOGE("%{private}s fail to get registry", __func__); + HILOG_ERROR("%{private}s fail to get registry", __func__); return ERR_APPEXECFWK_FORM_GET_SYSMGR_FAILED; } sptr remoteObject = systemManager->GetSystemAbility(FORM_MGR_SERVICE_ID); if (remoteObject == nullptr) { - APP_LOGE("%{private}s fail to connect FormMgrService", __func__); + HILOG_ERROR("%{private}s fail to connect FormMgrService", __func__); return ERR_APPEXECFWK_FORM_GET_FMS_FAILED; } deathRecipient_ = sptr(new FormMgrDeathRecipient()); if (deathRecipient_ == nullptr) { - APP_LOGE("%{public}s Failed to create FormMgrDeathRecipient!", __func__); + HILOG_ERROR("%{public}s Failed to create FormMgrDeathRecipient!", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } if ((remoteObject->IsProxyObject()) && (!remoteObject->AddDeathRecipient(deathRecipient_))) { - APP_LOGE("%{public}s Add death recipient to FormMgrService failed.", __func__); + HILOG_ERROR("%{public}s Add death recipient to FormMgrService failed.", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } remoteProxy_ = iface_cast(remoteObject); - APP_LOGD("%{public}s Connecting FormMgrService success.", __func__); + HILOG_DEBUG("%{public}s Connecting FormMgrService success.", __func__); return ERR_OK; } @@ -495,10 +495,10 @@ ErrCode FormMgr::Connect() */ void FormMgr::ResetProxy(const wptr &remote) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::lock_guard lock(connectMutex_); if (remoteProxy_ == nullptr) { - APP_LOGE("%{public}s failed, remote proxy is nullptr.", __func__); + HILOG_ERROR("%{public}s failed, remote proxy is nullptr.", __func__); return; } @@ -519,7 +519,7 @@ void FormMgr::ResetProxy(const wptr &remote) */ void FormMgr::SetFormMgrService(sptr formMgrService) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); remoteProxy_ = formMgrService; } @@ -530,10 +530,10 @@ void FormMgr::SetFormMgrService(sptr formMgrService) */ int FormMgr::DistributedDataAddForm(const Want &want) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s failed errCode:%{public}d.", __func__, errCode); + HILOG_ERROR("%{public}s failed errCode:%{public}d.", __func__, errCode); return errCode; } return remoteProxy_->DistributedDataAddForm(want); @@ -546,10 +546,10 @@ int FormMgr::DistributedDataAddForm(const Want &want) */ int FormMgr::DistributedDataDeleteForm(const std::string &formId) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s failed errCode:%{public}d.", __func__, errCode); + HILOG_ERROR("%{public}s failed errCode:%{public}d.", __func__, errCode); return errCode; } return remoteProxy_->DistributedDataDeleteForm(formId); @@ -562,10 +562,10 @@ int FormMgr::DistributedDataDeleteForm(const std::string &formId) */ int FormMgr::GetAllFormsInfo(std::vector &formInfos) { - APP_LOGI("%{public}s start.", __func__); + HILOG_INFO("%{public}s start.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGI("%{public}s failed, errCode: %{public}d.", __func__, errCode); + HILOG_INFO("%{public}s failed, errCode: %{public}d.", __func__, errCode); return errCode; } return remoteProxy_->GetAllFormsInfo(formInfos); @@ -579,10 +579,10 @@ int FormMgr::GetAllFormsInfo(std::vector &formInfos) */ int FormMgr::GetFormsInfoByApp(std::string &bundleName, std::vector &formInfos) { - APP_LOGI("%{public}s start.", __func__); + HILOG_INFO("%{public}s start.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s failed errCode:%{public}d.", __func__, errCode); + HILOG_ERROR("%{public}s failed errCode:%{public}d.", __func__, errCode); return errCode; } return remoteProxy_->GetFormsInfoByApp(bundleName, formInfos); @@ -597,10 +597,10 @@ int FormMgr::GetFormsInfoByApp(std::string &bundleName, std::vector &f */ int FormMgr::GetFormsInfoByModule(std::string &bundleName, std::string &moduleName, std::vector &formInfos) { - APP_LOGI("%{public}s start.", __func__); + HILOG_INFO("%{public}s start.", __func__); int errCode = Connect(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s failed errCode:%{public}d.", __func__, errCode); + HILOG_ERROR("%{public}s failed errCode:%{public}d.", __func__, errCode); return errCode; } return remoteProxy_->GetFormsInfoByModule(bundleName, moduleName, formInfos); diff --git a/frameworks/kits/test/BUILD.gn b/frameworks/kits/test/BUILD.gn index 26a6bc09f7..9b18d643f9 100644 --- a/frameworks/kits/test/BUILD.gn +++ b/frameworks/kits/test/BUILD.gn @@ -171,6 +171,7 @@ ohos_moduletest("ability_conetxt_test") { ] external_deps = [ + "ability_base:configuration", "bundle_framework:appexecfwk_core", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", @@ -271,6 +272,7 @@ ohos_moduletest("data_ability_operation_moduletest") { ] external_deps = [ + "ability_base:configuration", "bundle_framework:appexecfwk_core", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", diff --git a/frameworks/kits/wantagent/BUILD.gn b/frameworks/kits/wantagent/BUILD.gn index 5756fadedb..4ddc6d643d 100644 --- a/frameworks/kits/wantagent/BUILD.gn +++ b/frameworks/kits/wantagent/BUILD.gn @@ -27,6 +27,7 @@ config("wantagent_innerkits_public_config") { "//foundation/aafwk/standard/interfaces/innerkits/wantagent/include", "//foundation/aafwk/standard/services/abilitymgr/include", "//foundation/aafwk/standard/interfaces/innerkits/app_manager/include/appmgr", + "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base/include", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/include/bundlemgr", "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/aafwk/standard/frameworks/kits/appkit/native/app/include", @@ -36,11 +37,7 @@ config("wantagent_innerkits_public_config") { } ohos_shared_library("wantagent_innerkits") { - include_dirs = [ - "//utils/native/base/include", - "//foundation/aafwk/standard/services/common/include", - "//foundation/distributedschedule/safwk/services/safwk/include", - ] + include_dirs = [ "//foundation/aafwk/standard/services/common/include" ] sources = [ "src/completed_dispatcher.cpp", @@ -56,10 +53,7 @@ ohos_shared_library("wantagent_innerkits") { public_configs = [ ":wantagent_innerkits_public_config" ] - deps = [ - "//foundation/aafwk/standard/frameworks/kits/appkit:app_context", - "//utils/native/base:utils", - ] + deps = [ "//foundation/aafwk/standard/frameworks/kits/appkit:app_context" ] external_deps = [ "ability_base:want", @@ -71,6 +65,7 @@ ohos_shared_library("wantagent_innerkits") { "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "samgr_standard:samgr_proxy", + "utils_base:utils", ] if (is_double_framework) { diff --git a/interfaces/innerkits/ability_manager/BUILD.gn b/interfaces/innerkits/ability_manager/BUILD.gn index 95247b4b89..4d33aaaf35 100644 --- a/interfaces/innerkits/ability_manager/BUILD.gn +++ b/interfaces/innerkits/ability_manager/BUILD.gn @@ -26,6 +26,7 @@ config("ability_manager_public_config") { "//foundation/aafwk/standard/interfaces/innerkits/want/include/ohos/aafwk/content", "//foundation/aafwk/standard/frameworks/kits/ability/native/include", "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", + "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base/include", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/include/bundlemgr", "//foundation/aafwk/standard/interfaces/innerkits/app_manager/include/appmgr", "//foundation/aafwk/standard/frameworks/kits/appkit/native/app/include", @@ -93,30 +94,29 @@ ohos_shared_library("ability_manager") { ] deps = [ - "${innerkits_path}/base:base", - "${innerkits_path}/uri:zuri", - "${innerkits_path}/want:want", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", - "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", "//foundation/appexecfwk/standard/common:libappexecfwk_common", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base", - "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler", - "//foundation/distributeddatamgr/appdatamgr/interfaces/innerkits/native_dataability:native_dataability", - "//foundation/distributeddatamgr/appdatamgr/interfaces/innerkits/native_rdb:native_rdb", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//foundation/multimedia/image_standard/interfaces/innerkits:image_native", "//third_party/jsoncpp:jsoncpp", - "//utils/native/base:utils", ] external_deps = [ + "ability_base:base", + "ability_base:configuration", + "ability_base:want", + "ability_base:zuri", + "ability_runtime:app_manager", + "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "bytrace_standard:bytrace_core", + "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "multimedia_image_standard:image_native", "native_appdatamgr:native_appdatafwk", "native_appdatamgr:native_dataability", "native_appdatamgr:native_rdb", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] subsystem_name = "aafwk" diff --git a/interfaces/innerkits/app_manager/BUILD.gn b/interfaces/innerkits/app_manager/BUILD.gn index 19ae968ddf..1f3f270490 100644 --- a/interfaces/innerkits/app_manager/BUILD.gn +++ b/interfaces/innerkits/app_manager/BUILD.gn @@ -19,6 +19,7 @@ config("appmgr_sdk_config") { "include/appmgr", "//foundation/aafwk/standard/frameworks/kits/ability/native/include", "//foundation/aafwk/standard/interfaces/innerkits/ability_manager/include", + "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base/include", ] } @@ -30,7 +31,7 @@ ohos_shared_library("app_manager") { include_dirs = [ "//third_party/json/include", "${aafwk_path}/services/appmgr/include", - "//utils/system/safwk/native/include", + "${aafwk_path}/services/common/include", ] sources = [ @@ -54,7 +55,6 @@ ohos_shared_library("app_manager") { "src/appmgr/app_task_info.cpp", "src/appmgr/application_state_observer_proxy.cpp", "src/appmgr/application_state_observer_stub.cpp", - "src/appmgr/configuration.cpp", "src/appmgr/priority_object.cpp", "src/appmgr/process_data.cpp", "src/appmgr/process_info.cpp", @@ -75,27 +75,28 @@ ohos_shared_library("app_manager") { defines = [ "APP_LOG_TAG = \"AppexecfwkCore\"", "LOG_DOMAIN = 0xD001100", + "AMS_LOG_TAG = \"AppexecfwkCore\"", + "AMS_LOG_DOMAIN = 0xD001100", ] cflags = [] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } - deps = [ - "//foundation/aafwk/standard/interfaces/innerkits/base:base", - "//foundation/aafwk/standard/interfaces/innerkits/want:want", - "//foundation/appexecfwk/standard/common:libappexecfwk_common", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//utils/native/base:utils", - ] + deps = [ "//foundation/appexecfwk/standard/common:libappexecfwk_common" ] external_deps = [ + "ability_base:base", + "ability_base:configuration", + "ability_base:want", + "bundle_framework:appexecfwk_base", "bytrace_standard:bytrace_core", "ces_standard:cesfwk_core", "ces_standard:cesfwk_innerkits", "hiviewdfx_hilog_native:libhilog", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] subsystem_name = "aafwk" @@ -105,16 +106,12 @@ ohos_shared_library("app_manager") { config("configuration_sdk_config") { include_dirs = [ "include/appmgr", - "//foundation/aafwk/standard/frameworks/kits/ability/native/include", - "//foundation/aafwk/standard/interfaces/innerkits/ability_manager/include", + "//foundation/aafwk/standard/interfaces/innerkits/log/include", "//third_party/json/include", ] } ohos_shared_library("configuration") { - include_dirs = - [ "//base/global/resmgr_standard/interfaces/innerkits/include" ] - sources = [ "src/appmgr/configuration.cpp", "src/appmgr/configuration_convertor.cpp", @@ -123,19 +120,19 @@ ohos_shared_library("configuration") { public_configs = [ ":configuration_sdk_config" ] defines = [ - "APP_LOG_TAG = \"Configuration\"", - "LOG_DOMAIN = 0xD001100", + "ABILITYBASE_LOG_TAG = \"Configuration\"", + "ABILITYBASE_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } - deps = [ - "//foundation/appexecfwk/standard/common:libappexecfwk_common", - "//utils/native/base:utils", - ] - external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + external_deps = [ + "hiviewdfx_hilog_native:libhilog", + "resmgr_standard:global_resmgr", + "utils_base:utils", + ] subsystem_name = "aafwk" part_name = "ability_base" diff --git a/interfaces/innerkits/app_manager/src/appmgr/ability_controller_proxy.cpp b/interfaces/innerkits/app_manager/src/appmgr/ability_controller_proxy.cpp index d868ab3a60..ec0aa13a00 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/ability_controller_proxy.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/ability_controller_proxy.cpp @@ -15,8 +15,9 @@ #include "ability_controller_proxy.h" +#include "hilog_wrapper.h" #include "ipc_types.h" -#include "app_log_wrapper.h" + namespace OHOS { namespace AppExecFwk { @@ -27,7 +28,7 @@ AbilityControllerProxy::AbilityControllerProxy( bool AbilityControllerProxy::WriteInterfaceToken(MessageParcel &data) { if (!data.WriteInterfaceToken(AbilityControllerProxy::GetDescriptor())) { - APP_LOGE("write interface token failed"); + HILOG_ERROR("write interface token failed"); return false; } return true; @@ -45,14 +46,14 @@ bool AbilityControllerProxy::AllowAbilityStart(const Want &want, const std::stri data.WriteString(bundleName); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return true; } int32_t ret = remote->SendRequest( static_cast(IAbilityController::Message::TRANSACT_ON_ALLOW_ABILITY_START), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); return true; } return reply.ReadBool(); @@ -69,14 +70,14 @@ bool AbilityControllerProxy::AllowAbilityBackground(const std::string &bundleNam data.WriteString(bundleName); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return true; } int32_t ret = remote->SendRequest( static_cast(IAbilityController::Message::TRANSACT_ON_ALLOW_ABILITY_BACKGROUND), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); return true; } return reply.ReadBool(); diff --git a/interfaces/innerkits/app_manager/src/appmgr/ability_controller_stub.cpp b/interfaces/innerkits/app_manager/src/appmgr/ability_controller_stub.cpp index a3cdfd92c5..e9b3a04d80 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/ability_controller_stub.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/ability_controller_stub.cpp @@ -15,7 +15,7 @@ #include "ability_controller_stub.h" #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "iremote_object.h" @@ -39,11 +39,11 @@ AbilityControllerStub::~AbilityControllerStub() int AbilityControllerStub::OnRemoteRequest( uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - APP_LOGI("AbilityControllerStub::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); + HILOG_INFO("AbilityControllerStub::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); std::u16string descriptor = AbilityControllerStub::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { - APP_LOGE("local descriptor is not equal to remote"); + HILOG_ERROR("local descriptor is not equal to remote"); return ERR_INVALID_STATE; } @@ -69,10 +69,10 @@ bool AbilityControllerStub::AllowAbilityBackground(const std::string &bundleName int32_t AbilityControllerStub::HandleAllowAbilityStart(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("HandleAllowAbilityStart"); + HILOG_INFO("HandleAllowAbilityStart"); std::unique_ptr want(data.ReadParcelable()); if (!want) { - APP_LOGE("ReadParcelable failed"); + HILOG_ERROR("ReadParcelable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } std::string pkg = data.ReadString(); @@ -83,7 +83,7 @@ int32_t AbilityControllerStub::HandleAllowAbilityStart(MessageParcel &data, Mess int32_t AbilityControllerStub::HandleAllowAbilityBackground(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("HandleAllowAbilityBackground"); + HILOG_INFO("HandleAllowAbilityBackground"); std::string pkg = data.ReadString(); bool ret = AllowAbilityBackground(pkg); reply.WriteBool(ret); diff --git a/interfaces/innerkits/app_manager/src/appmgr/ability_state_data.cpp b/interfaces/innerkits/app_manager/src/appmgr/ability_state_data.cpp index 8741a02d71..081b84758c 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/ability_state_data.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/ability_state_data.cpp @@ -15,7 +15,7 @@ #include "ability_state_data.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -48,7 +48,7 @@ AbilityStateData *AbilityStateData::Unmarshalling(Parcel &parcel) { AbilityStateData *abilityStateData = new (std::nothrow) AbilityStateData(); if (abilityStateData && !abilityStateData->ReadFromParcel(parcel)) { - APP_LOGW("AbilityStateData failed, because ReadFromParcel failed"); + HILOG_WARN("AbilityStateData failed, because ReadFromParcel failed"); delete abilityStateData; abilityStateData = nullptr; } diff --git a/interfaces/innerkits/app_manager/src/appmgr/ams_mgr_proxy.cpp b/interfaces/innerkits/app_manager/src/appmgr/ams_mgr_proxy.cpp index f0801563e3..850d6777cc 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/ams_mgr_proxy.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/ams_mgr_proxy.cpp @@ -18,8 +18,8 @@ #include "iremote_object.h" #include "string_ex.h" -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -29,7 +29,7 @@ AmsMgrProxy::AmsMgrProxy(const sptr &impl) : IRemoteProxy &token, const sptr &abilityInfo, const std::shared_ptr &appInfo, const std::shared_ptr &want) { - APP_LOGD("start"); + HILOG_DEBUG("start"); if (!abilityInfo || !appInfo) { - APP_LOGE("param error"); + HILOG_ERROR("param error"); return; } @@ -56,24 +56,24 @@ void AmsMgrProxy::LoadAbility(const sptr &token, const sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest(static_cast(IAmsMgr::Message::LOAD_ABILITY), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void AmsMgrProxy::TerminateAbility(const sptr &token) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -83,20 +83,20 @@ void AmsMgrProxy::TerminateAbility(const sptr &token) data.WriteParcelable(token.GetRefPtr()); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest(static_cast(IAmsMgr::Message::TERMINATE_ABILITY), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void AmsMgrProxy::UpdateAbilityState(const sptr &token, const AbilityState state) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -107,20 +107,20 @@ void AmsMgrProxy::UpdateAbilityState(const sptr &token, const Abi data.WriteInt32(static_cast(state)); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest(static_cast(IAmsMgr::Message::UPDATE_ABILITY_STATE), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void AmsMgrProxy::UpdateExtensionState(const sptr &token, const ExtensionState state) { - APP_LOGD("UpdateExtensionState start"); + HILOG_DEBUG("UpdateExtensionState start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -131,22 +131,22 @@ void AmsMgrProxy::UpdateExtensionState(const sptr &token, const E data.WriteInt32(static_cast(state)); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest(static_cast(IAmsMgr::Message::UPDATE_EXTENSION_STATE), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void AmsMgrProxy::RegisterAppStateCallback(const sptr &callback) { - APP_LOGD("start"); + HILOG_DEBUG("start"); if (!callback) { - APP_LOGE("callback is nullptr"); + HILOG_ERROR("callback is nullptr"); return; } @@ -159,21 +159,21 @@ void AmsMgrProxy::RegisterAppStateCallback(const sptr &callba data.WriteParcelable(callback->AsObject()); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is nullptr"); + HILOG_ERROR("Remote() is nullptr"); return; } int32_t ret = remote->SendRequest( static_cast(IAmsMgr::Message::REGISTER_APP_STATE_CALLBACK), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void AmsMgrProxy::AbilityBehaviorAnalysis(const sptr &token, const sptr &preToken, const int32_t visibility, const int32_t perceptibility, const int32_t connectionState) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -187,20 +187,20 @@ void AmsMgrProxy::AbilityBehaviorAnalysis(const sptr &token, cons data.WriteInt32(static_cast(connectionState)); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest(static_cast(IAmsMgr::Message::TERMINATE_ABILITY), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void AmsMgrProxy::KillProcessByAbilityToken(const sptr &token) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -210,20 +210,20 @@ void AmsMgrProxy::KillProcessByAbilityToken(const sptr &token) data.WriteParcelable(token.GetRefPtr()); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest(static_cast(IAmsMgr::Message::TERMINATE_ABILITY), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void AmsMgrProxy::KillProcessesByUserId(int32_t userId) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -231,25 +231,25 @@ void AmsMgrProxy::KillProcessesByUserId(int32_t userId) return; } if (!data.WriteInt32(userId)) { - APP_LOGE("parcel WriteInt32 failed"); + HILOG_ERROR("parcel WriteInt32 failed"); return; } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest(static_cast(IAmsMgr::Message::KILL_PROCESSES_BY_USERID), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } int32_t AmsMgrProxy::KillProcessWithAccount(const std::string &bundleName, const int accountId) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; @@ -260,35 +260,35 @@ int32_t AmsMgrProxy::KillProcessWithAccount(const std::string &bundleName, const sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return ERR_NULL_OBJECT; } if (!data.WriteString(bundleName)) { - APP_LOGE("parcel WriteString failed"); + HILOG_ERROR("parcel WriteString failed"); return ERR_FLATTEN_OBJECT; } if (!data.WriteInt32(accountId)) { - APP_LOGE("parcel WriteInt32 failed"); + HILOG_ERROR("parcel WriteInt32 failed"); return ERR_FLATTEN_OBJECT; } int32_t ret = remote->SendRequest(static_cast(IAmsMgr::Message::KILL_PROCESS_WITH_ACCOUNT), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); return ret; } - APP_LOGD("end"); + HILOG_DEBUG("end"); return reply.ReadInt32(); } int32_t AmsMgrProxy::KillApplication(const std::string &bundleName) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -297,17 +297,17 @@ int32_t AmsMgrProxy::KillApplication(const std::string &bundleName) } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return ERR_NULL_OBJECT; } if (!data.WriteString(bundleName)) { - APP_LOGE("parcel WriteString failed"); + HILOG_ERROR("parcel WriteString failed"); return ERR_FLATTEN_OBJECT; } int32_t ret = remote->SendRequest(static_cast(IAmsMgr::Message::KILL_APPLICATION), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); return ret; } return reply.ReadInt32(); @@ -315,7 +315,7 @@ int32_t AmsMgrProxy::KillApplication(const std::string &bundleName) int32_t AmsMgrProxy::KillApplicationByUid(const std::string &bundleName, const int uid) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -324,21 +324,21 @@ int32_t AmsMgrProxy::KillApplicationByUid(const std::string &bundleName, const i } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return ERR_NULL_OBJECT; } if (!data.WriteString(bundleName)) { - APP_LOGE("parcel WriteString failed"); + HILOG_ERROR("parcel WriteString failed"); return ERR_FLATTEN_OBJECT; } if (!data.WriteInt32(uid)) { - APP_LOGE("uid write failed."); + HILOG_ERROR("uid write failed."); return ERR_FLATTEN_OBJECT; } int32_t ret = remote->SendRequest(static_cast(IAmsMgr::Message::KILL_APPLICATION_BYUID), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); return ret; } return reply.ReadInt32(); @@ -346,7 +346,7 @@ int32_t AmsMgrProxy::KillApplicationByUid(const std::string &bundleName, const i void AmsMgrProxy::AbilityAttachTimeOut(const sptr &token) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -356,20 +356,20 @@ void AmsMgrProxy::AbilityAttachTimeOut(const sptr &token) data.WriteParcelable(token.GetRefPtr()); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest(static_cast(IAmsMgr::Message::ABILITY_ATTACH_TIMEOUT), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void AmsMgrProxy::PrepareTerminate(const sptr &token) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -379,21 +379,21 @@ void AmsMgrProxy::PrepareTerminate(const sptr &token) data.WriteParcelable(token.GetRefPtr()); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest(static_cast(IAmsMgr::Message::PREPARE_TERMINATE_ABILITY), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } int AmsMgrProxy::CompelVerifyPermission(const std::string &permission, int pid, int uid, std::string &message) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -401,18 +401,18 @@ int AmsMgrProxy::CompelVerifyPermission(const std::string &permission, int pid, return ERR_INVALID_DATA; } if (!data.WriteString16(Str8ToStr16(permission)) || !data.WriteInt32(pid) || !data.WriteInt32(uid)) { - APP_LOGE("%{public}s, write failed", __func__); + HILOG_ERROR("%{public}s, write failed", __func__); return ERR_INVALID_DATA; } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return ERR_NULL_OBJECT; } auto ret = remote->SendRequest(static_cast(IAmsMgr::Message::COMPEL_VERIFY_PERMISSION), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); return ERR_INVALID_DATA; } message = Str16ToStr8(reply.ReadString16()); @@ -435,19 +435,19 @@ void AmsMgrProxy::GetRunningProcessInfoByToken( auto remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } auto ret = remote->SendRequest( static_cast(IAmsMgr::Message::GET_RUNNING_PROCESS_INFO_BY_TOKEN), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); return; } std::unique_ptr processInfo(reply.ReadParcelable()); if (processInfo == nullptr) { - APP_LOGE("recv process info faild"); + HILOG_ERROR("recv process info faild"); return; } @@ -465,27 +465,27 @@ void AmsMgrProxy::StartSpecifiedAbility(const AAFwk::Want &want, const AppExecFw } if (!data.WriteParcelable(&want) || !data.WriteParcelable(&abilityInfo)) { - APP_LOGE("Write data failed."); + HILOG_ERROR("Write data failed."); return; } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote is nullptr."); + HILOG_ERROR("Remote is nullptr."); return; } auto ret = remote->SendRequest( static_cast(IAmsMgr::Message::START_SPECIFIED_ABILITY), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } } void AmsMgrProxy::RegisterStartSpecifiedAbilityResponse(const sptr &response) { - APP_LOGD("Register multi instances response by proxy."); + HILOG_DEBUG("Register multi instances response by proxy."); if (!response) { - APP_LOGE("response is nullptr"); + HILOG_ERROR("response is nullptr"); return; } @@ -499,19 +499,19 @@ void AmsMgrProxy::RegisterStartSpecifiedAbilityResponse(const sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote is nullptr."); + HILOG_ERROR("Remote is nullptr."); return; } int32_t ret = remote->SendRequest( static_cast(IAmsMgr::Message::REGISTER_START_SPECIFIED_ABILITY_RESPONSE), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } } void AmsMgrProxy::UpdateConfiguration(const Configuration &config) { - APP_LOGI("UpdateConfiguration start"); + HILOG_INFO("UpdateConfiguration start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -519,51 +519,51 @@ void AmsMgrProxy::UpdateConfiguration(const Configuration &config) return; } if (!data.WriteParcelable(&config)) { - APP_LOGE("parcel config failed"); + HILOG_ERROR("parcel config failed"); return; } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest(static_cast(IAmsMgr::Message::UPDATE_CONFIGURATION), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGI("UpdateConfiguration end"); + HILOG_INFO("UpdateConfiguration end"); } int AmsMgrProxy::GetConfiguration(Configuration &config) { - APP_LOGI("GetConfiguration start"); + HILOG_INFO("GetConfiguration start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); if (!WriteInterfaceToken(data)) { - APP_LOGE("parcel data failed"); + HILOG_ERROR("parcel data failed"); return ERR_INVALID_DATA; } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return ERR_INVALID_DATA; } int32_t ret = remote->SendRequest(static_cast(IAmsMgr::Message::GET_CONFIGURATION), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); return ERR_INVALID_DATA; } std::unique_ptr info(reply.ReadParcelable()); if (!info) { - APP_LOGE("read configuration failed."); + HILOG_ERROR("read configuration failed."); return ERR_UNKNOWN_OBJECT; } config = *info; - APP_LOGI("GetConfiguration end"); + HILOG_INFO("GetConfiguration end"); return NO_ERROR; } } // namespace AppExecFwk diff --git a/interfaces/innerkits/app_manager/src/appmgr/ams_mgr_stub.cpp b/interfaces/innerkits/app_manager/src/appmgr/ams_mgr_stub.cpp index ec7cc1ef19..71d298be2e 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/ams_mgr_stub.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/ams_mgr_stub.cpp @@ -20,11 +20,11 @@ #include "iremote_object.h" #include "ability_info.h" -#include "app_log_wrapper.h" #include "app_mgr_proxy.h" #include "app_scheduler_interface.h" #include "appexecfwk_errors.h" #include "bytrace.h" +#include "hilog_wrapper.h" #include "iapp_state_callback.h" namespace OHOS { @@ -76,11 +76,11 @@ AmsMgrStub::~AmsMgrStub() int AmsMgrStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - APP_LOGI("AmsMgrStub::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); + HILOG_INFO("AmsMgrStub::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); std::u16string descriptor = AmsMgrStub::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { - APP_LOGE("local descriptor is not equal to remote"); + HILOG_ERROR("local descriptor is not equal to remote"); return ERR_INVALID_STATE; } @@ -101,19 +101,19 @@ ErrCode AmsMgrStub::HandleLoadAbility(MessageParcel &data, MessageParcel &reply) sptr preToke = data.ReadParcelable(); std::shared_ptr abilityInfo(data.ReadParcelable()); if (!abilityInfo) { - APP_LOGE("ReadParcelable failed"); + HILOG_ERROR("ReadParcelable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } std::shared_ptr appInfo(data.ReadParcelable()); if (!appInfo) { - APP_LOGE("ReadParcelable failed"); + HILOG_ERROR("ReadParcelable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } std::shared_ptr want(data.ReadParcelable()); if (!want) { - APP_LOGE("ReadParcelable want failed"); + HILOG_ERROR("ReadParcelable want failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -188,19 +188,19 @@ ErrCode AmsMgrStub::HandleKillProcessesByUserId(MessageParcel &data, MessageParc ErrCode AmsMgrStub::HandleKillProcessWithAccount(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("enter"); + HILOG_INFO("enter"); BYTRACE(BYTRACE_TAG_APP); std::string bundleName = data.ReadString(); int accountId = data.ReadInt32(); - APP_LOGI("bundleName = %{public}s, accountId = %{public}d", bundleName.c_str(), accountId); + HILOG_INFO("bundleName = %{public}s, accountId = %{public}d", bundleName.c_str(), accountId); int32_t result = KillProcessWithAccount(bundleName, accountId); reply.WriteInt32(result); - APP_LOGI("end"); + HILOG_INFO("end"); return NO_ERROR; } @@ -261,7 +261,7 @@ int32_t AmsMgrStub::HandleGetRunningProcessInfoByToken(MessageParcel &data, Mess auto token = data.ReadParcelable(); GetRunningProcessInfoByToken(token, processInfo); if (reply.WriteParcelable(&processInfo)) { - APP_LOGE("process info write failed."); + HILOG_ERROR("process info write failed."); return ERR_INVALID_VALUE; } return NO_ERROR; @@ -271,13 +271,13 @@ int32_t AmsMgrStub::HandleStartSpecifiedAbility(MessageParcel &data, MessageParc { AAFwk::Want *want = data.ReadParcelable(); if (want == nullptr) { - APP_LOGE("want is nullptr"); + HILOG_ERROR("want is nullptr"); return ERR_INVALID_VALUE; } AbilityInfo *abilityInfo = data.ReadParcelable(); if (abilityInfo == nullptr) { - APP_LOGE("abilityInfo is nullptr."); + HILOG_ERROR("abilityInfo is nullptr."); return ERR_INVALID_VALUE; } StartSpecifiedAbility(*want, *abilityInfo); @@ -307,11 +307,11 @@ int32_t AmsMgrStub::HandleGetConfiguration(MessageParcel &data, MessageParcel &r Configuration config; int ret = GetConfiguration(config); if (ret != ERR_OK) { - APP_LOGE("GetConfiguration error"); + HILOG_ERROR("GetConfiguration error"); return ERR_INVALID_VALUE; } if (!reply.WriteParcelable(&config)) { - APP_LOGE("GetConfiguration error"); + HILOG_ERROR("GetConfiguration error"); return ERR_INVALID_VALUE; } return NO_ERROR; diff --git a/interfaces/innerkits/app_manager/src/appmgr/app_launch_data.cpp b/interfaces/innerkits/app_manager/src/appmgr/app_launch_data.cpp index b302cca8b0..8ad2de1802 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/app_launch_data.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/app_launch_data.cpp @@ -15,7 +15,7 @@ #include "app_launch_data.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -69,12 +69,12 @@ bool AppLaunchData::Marshalling(Parcel &parcel) const bool valid = userTestRecord_ ? true : false; if (!parcel.WriteBool(valid)) { - APP_LOGE("Failed to write the flag which indicate whether userTestRecord_ is null"); + HILOG_ERROR("Failed to write the flag which indicate whether userTestRecord_ is null"); return false; } if (valid) { if (!parcel.WriteParcelable(userTestRecord_.get())) { - APP_LOGE("Failed to write userTestRecord_"); + HILOG_ERROR("Failed to write userTestRecord_"); return false; } } @@ -85,21 +85,21 @@ bool AppLaunchData::ReadFromParcel(Parcel &parcel) { std::unique_ptr applicationInfoRead(parcel.ReadParcelable()); if (!applicationInfoRead) { - APP_LOGE("failed, applicationInfoRead is nullptr"); + HILOG_ERROR("failed, applicationInfoRead is nullptr"); return false; } applicationInfo_ = *applicationInfoRead; std::unique_ptr profileRead(parcel.ReadParcelable()); if (!profileRead) { - APP_LOGE("failed, profileRead is nullptr"); + HILOG_ERROR("failed, profileRead is nullptr"); return false; } profile_ = *profileRead; std::unique_ptr processInfoRead(parcel.ReadParcelable()); if (!processInfoRead) { - APP_LOGE("failed, processInfoRead is nullptr"); + HILOG_ERROR("failed, processInfoRead is nullptr"); return false; } processInfo_ = *processInfoRead; @@ -111,7 +111,7 @@ bool AppLaunchData::ReadFromParcel(Parcel &parcel) if (valid) { userTestRecord_ = std::shared_ptr(parcel.ReadParcelable()); if (!userTestRecord_) { - APP_LOGE("failed, userTestRecord is nullptr"); + HILOG_ERROR("failed, userTestRecord is nullptr"); return false; } } @@ -122,7 +122,7 @@ AppLaunchData *AppLaunchData::Unmarshalling(Parcel &parcel) { AppLaunchData *appLaunchData = new (std::nothrow) AppLaunchData(); if (appLaunchData && !appLaunchData->ReadFromParcel(parcel)) { - APP_LOGW("failed, because ReadFromParcel failed"); + HILOG_WARN("failed, because ReadFromParcel failed"); delete appLaunchData; appLaunchData = nullptr; } @@ -132,25 +132,25 @@ AppLaunchData *AppLaunchData::Unmarshalling(Parcel &parcel) bool UserTestRecord::Marshalling(Parcel &parcel) const { if (!parcel.WriteParcelable(&want)) { - APP_LOGE("Failed to write want"); + HILOG_ERROR("Failed to write want"); return false; } auto valid = observer ? true : false; if (!parcel.WriteBool(valid)) { - APP_LOGE("Failed to write the flag which indicate whether observer is null"); + HILOG_ERROR("Failed to write the flag which indicate whether observer is null"); return false; } if (valid) { if (!parcel.WriteParcelable(observer)) { - APP_LOGE("Failed to write observer"); + HILOG_ERROR("Failed to write observer"); return false; } } if (!parcel.WriteBool(isFinished)) { - APP_LOGE("Failed to write isFinished"); + HILOG_ERROR("Failed to write isFinished"); return false; } return true; @@ -160,7 +160,7 @@ UserTestRecord *UserTestRecord::Unmarshalling(Parcel &parcel) { UserTestRecord *userTestRecord = new (std::nothrow) UserTestRecord(); if (userTestRecord && !userTestRecord->ReadFromParcel(parcel)) { - APP_LOGW("failed, because ReadFromParcel failed"); + HILOG_WARN("failed, because ReadFromParcel failed"); delete userTestRecord; userTestRecord = nullptr; } @@ -171,7 +171,7 @@ bool UserTestRecord::ReadFromParcel(Parcel &parcel) { AAFwk::Want *wantPtr = parcel.ReadParcelable(); if (wantPtr == nullptr) { - APP_LOGE("wantPtr is nullptr"); + HILOG_ERROR("wantPtr is nullptr"); return ERR_INVALID_VALUE; } want = *wantPtr; @@ -181,7 +181,7 @@ bool UserTestRecord::ReadFromParcel(Parcel &parcel) if (valid) { observer = parcel.ReadParcelable(); if (!observer) { - APP_LOGE("observer is nullptr"); + HILOG_ERROR("observer is nullptr"); return false; } } diff --git a/interfaces/innerkits/app_manager/src/appmgr/app_mgr_client.cpp b/interfaces/innerkits/app_manager/src/appmgr/app_mgr_client.cpp index 8c40716594..ce9ece8a85 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/app_mgr_client.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/app_mgr_client.cpp @@ -22,9 +22,9 @@ #include "if_system_ability_manager.h" #include "ipc_skeleton.h" -#include "app_log_wrapper.h" #include "app_mgr_interface.h" #include "app_service_manager.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -302,7 +302,7 @@ void AppMgrClient::GetSystemMemoryAttr(SystemMemoryAttr &memoryInfo, std::string { sptr service = iface_cast(remote_); if (service == nullptr) { - APP_LOGE("service is nullptr"); + HILOG_ERROR("service is nullptr"); return; } @@ -324,7 +324,7 @@ void AppMgrClient::AddAbilityStageDone(const int32_t recordId) { sptr service = iface_cast(remote_); if (service == nullptr) { - APP_LOGE("service is nullptr"); + HILOG_ERROR("service is nullptr"); return; } @@ -335,7 +335,7 @@ void AppMgrClient::StartupResidentProcess(const std::vector service = iface_cast(remote_); if (service == nullptr) { - APP_LOGE("service is nullptr"); + HILOG_ERROR("service is nullptr"); return; } @@ -347,7 +347,7 @@ int AppMgrClient::StartUserTestProcess(const AAFwk::Want &want, const sptr service = iface_cast(remote_); if (service == nullptr) { - APP_LOGE("service is nullptr"); + HILOG_ERROR("service is nullptr"); return AppMgrResultCode::ERROR_SERVICE_NOT_READY; } return service->StartUserTestProcess(want, observer, bundleInfo); @@ -358,7 +358,7 @@ int AppMgrClient::FinishUserTest( { sptr service = iface_cast(remote_); if (service == nullptr) { - APP_LOGE("service is nullptr"); + HILOG_ERROR("service is nullptr"); return AppMgrResultCode::ERROR_SERVICE_NOT_READY; } return service->FinishUserTest(msg, resultCode, bundleName, pid); @@ -394,7 +394,7 @@ void AppMgrClient::ScheduleAcceptWantDone(const int32_t recordId, const AAFwk::W { sptr service = iface_cast(remote_); if (service == nullptr) { - APP_LOGE("service is nullptr"); + HILOG_ERROR("service is nullptr"); return; } @@ -419,7 +419,7 @@ int AppMgrClient::GetAbilityRecordsByProcessID(const int pid, std::vector service = iface_cast(remote_); if (service == nullptr) { - APP_LOGE("service is nullptr"); + HILOG_ERROR("service is nullptr"); return AppMgrResultCode::ERROR_SERVICE_NOT_CONNECTED; } @@ -443,7 +443,7 @@ int AppMgrClient::StartRenderProcess(const std::string &renderParam, int32_t ipc void AppMgrClient::AttachRenderProcess(const sptr &renderScheduler) { if (!renderScheduler) { - APP_LOGI("renderScheduler is nullptr"); + HILOG_INFO("renderScheduler is nullptr"); return; } @@ -453,7 +453,7 @@ void AppMgrClient::AttachRenderProcess(const sptr &renderSched sptr service = iface_cast(remote_); if (service != nullptr) { - APP_LOGI("AttachRenderProcess"); + HILOG_INFO("AttachRenderProcess"); service->AttachRenderProcess(renderScheduler->AsObject()); } } diff --git a/interfaces/innerkits/app_manager/src/appmgr/app_mgr_proxy.cpp b/interfaces/innerkits/app_manager/src/appmgr/app_mgr_proxy.cpp index 22a1a16305..b572646338 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/app_mgr_proxy.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/app_mgr_proxy.cpp @@ -15,9 +15,8 @@ #include "app_mgr_proxy.h" -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" - +#include "hilog_wrapper.h" #include "ipc_types.h" #include "iremote_object.h" @@ -29,7 +28,7 @@ AppMgrProxy::AppMgrProxy(const sptr &impl) : IRemoteProxy &obj) { - APP_LOGD("AppMgrProxy::AttachApplication start"); + HILOG_DEBUG("AppMgrProxy::AttachApplication start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -47,20 +46,20 @@ void AppMgrProxy::AttachApplication(const sptr &obj) data.WriteParcelable(obj.GetRefPtr()); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest(static_cast(IAppMgr::Message::APP_ATTACH_APPLICATION), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void AppMgrProxy::ApplicationForegrounded(const int32_t recordId) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -70,20 +69,20 @@ void AppMgrProxy::ApplicationForegrounded(const int32_t recordId) data.WriteInt32(recordId); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IAppMgr::Message::APP_APPLICATION_FOREGROUNDED), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void AppMgrProxy::ApplicationBackgrounded(const int32_t recordId) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -93,20 +92,20 @@ void AppMgrProxy::ApplicationBackgrounded(const int32_t recordId) data.WriteInt32(recordId); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IAppMgr::Message::APP_APPLICATION_BACKGROUNDED), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void AppMgrProxy::ApplicationTerminated(const int32_t recordId) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -116,20 +115,20 @@ void AppMgrProxy::ApplicationTerminated(const int32_t recordId) data.WriteInt32(recordId); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IAppMgr::Message::APP_APPLICATION_TERMINATED), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } int32_t AppMgrProxy::CheckPermission(const int32_t recordId, const std::string &permission) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; @@ -141,22 +140,22 @@ int32_t AppMgrProxy::CheckPermission(const int32_t recordId, const std::string & data.WriteString(permission); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return ERR_PERMISSION_DENIED; } int32_t ret = remote->SendRequest(static_cast(IAppMgr::Message::APP_CHECK_PERMISSION), data, reply, option); if (ret != NO_ERROR) { - APP_LOGE("SendRequest is failed, error code: %{public}d", ret); + HILOG_ERROR("SendRequest is failed, error code: %{public}d", ret); return ERR_PERMISSION_DENIED; } - APP_LOGD("end"); + HILOG_DEBUG("end"); return reply.ReadInt32(); } void AppMgrProxy::AbilityCleaned(const sptr &token) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -166,20 +165,20 @@ void AppMgrProxy::AbilityCleaned(const sptr &token) data.WriteParcelable(token.GetRefPtr()); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest(static_cast(IAppMgr::Message::APP_ABILITY_CLEANED), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } sptr AppMgrProxy::GetAmsMgr() { - APP_LOGD("begin to get Ams instance"); + HILOG_DEBUG("begin to get Ams instance"); MessageParcel data; MessageParcel reply; if (!WriteInterfaceToken(data)) { @@ -191,16 +190,16 @@ sptr AppMgrProxy::GetAmsMgr() sptr object = reply.ReadParcelable(); sptr amsMgr = iface_cast(object); if (!amsMgr) { - APP_LOGE("ams instance is nullptr"); + HILOG_ERROR("ams instance is nullptr"); return nullptr; } - APP_LOGD("get ams instance success"); + HILOG_DEBUG("get ams instance success"); return amsMgr; } int32_t AppMgrProxy::ClearUpApplicationData(const std::string &bundleName) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -209,26 +208,26 @@ int32_t AppMgrProxy::ClearUpApplicationData(const std::string &bundleName) } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return ERR_NULL_OBJECT; } if (!data.WriteString(bundleName)) { - APP_LOGE("parcel WriteString failed"); + HILOG_ERROR("parcel WriteString failed"); return ERR_FLATTEN_OBJECT; } int32_t ret = remote->SendRequest( static_cast(IAppMgr::Message::APP_CLEAR_UP_APPLICATION_DATA), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); return ret; } - APP_LOGD("end"); + HILOG_DEBUG("end"); return reply.ReadInt32(); } int32_t AppMgrProxy::GetAllRunningProcesses(std::vector &info) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -237,7 +236,7 @@ int32_t AppMgrProxy::GetAllRunningProcesses(std::vector &inf } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return ERR_NULL_OBJECT; } if (!SendTransactCmd(IAppMgr::Message::APP_GET_ALL_RUNNING_PROCESSES, data, reply)) { @@ -245,17 +244,17 @@ int32_t AppMgrProxy::GetAllRunningProcesses(std::vector &inf } auto error = GetParcelableInfos(reply, info); if (error != NO_ERROR) { - APP_LOGE("GetParcelableInfos fail, error: %{public}d", error); + HILOG_ERROR("GetParcelableInfos fail, error: %{public}d", error); return error; } int result = reply.ReadInt32(); - APP_LOGD("end"); + HILOG_DEBUG("end"); return result; } int32_t AppMgrProxy::GetProcessRunningInfosByUserId(std::vector &info, int32_t userId) { - APP_LOGD("start"); + HILOG_DEBUG("start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -266,7 +265,7 @@ int32_t AppMgrProxy::GetProcessRunningInfosByUserId(std::vector remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return ERR_NULL_OBJECT; } if (!SendTransactCmd(IAppMgr::Message::APP_GET_RUNNING_PROCESSES_BY_USER_ID, data, reply)) { @@ -274,11 +273,11 @@ int32_t AppMgrProxy::GetProcessRunningInfosByUserId(std::vector(reply, info); if (error != NO_ERROR) { - APP_LOGE("GetParcelableInfos fail, error: %{public}d", error); + HILOG_ERROR("GetParcelableInfos fail, error: %{public}d", error); return error; } int result = reply.ReadInt32(); - APP_LOGD("end"); + HILOG_DEBUG("end"); return result; } @@ -287,12 +286,12 @@ bool AppMgrProxy::SendTransactCmd(IAppMgr::Message code, MessageParcel &data, Me MessageOption option(MessageOption::TF_SYNC); sptr remote = Remote(); if (!remote) { - APP_LOGE("fail to send transact cmd %{public}d due to remote object", code); + HILOG_ERROR("fail to send transact cmd %{public}d due to remote object", code); return false; } int32_t result = remote->SendRequest(static_cast(code), data, reply, option); if (result != NO_ERROR) { - APP_LOGE("receive error transact code %{public}d in transact cmd %{public}d", result, code); + HILOG_ERROR("receive error transact code %{public}d in transact cmd %{public}d", result, code); return false; } return true; @@ -307,23 +306,23 @@ void AppMgrProxy::GetSystemMemoryAttr(SystemMemoryAttr &memoryInfo, std::string MessageParcel data; MessageParcel reply; if (!WriteInterfaceToken(data)) { - APP_LOGE("WriteInterfaceToken failed"); + HILOG_ERROR("WriteInterfaceToken failed"); return; } if (!data.WriteString(strConfig)) { - APP_LOGE("want write failed."); + HILOG_ERROR("want write failed."); return; } if (!SendTransactCmd(IAppMgr::Message::APP_GET_SYSTEM_MEMORY_ATTR, data, reply)) { - APP_LOGE("SendTransactCmd failed"); + HILOG_ERROR("SendTransactCmd failed"); return; } std::shared_ptr remoteRetsult(reply.ReadParcelable()); if (remoteRetsult == nullptr) { - APP_LOGE("recv SystemMemoryAttr failed"); + HILOG_ERROR("recv SystemMemoryAttr failed"); return; } @@ -335,17 +334,17 @@ void AppMgrProxy::AddAbilityStageDone(const int32_t recordId) MessageParcel data; MessageParcel reply; if (!WriteInterfaceToken(data)) { - APP_LOGE("WriteInterfaceToken failed"); + HILOG_ERROR("WriteInterfaceToken failed"); return; } if (!data.WriteInt32(recordId)) { - APP_LOGE("want write failed."); + HILOG_ERROR("want write failed."); return; } if (!SendTransactCmd(IAppMgr::Message::APP_ADD_ABILITY_STAGE_INFO_DONE, data, reply)) { - APP_LOGE("SendTransactCmd failed"); + HILOG_ERROR("SendTransactCmd failed"); return; } return; @@ -356,24 +355,24 @@ void AppMgrProxy::StartupResidentProcess(const std::vector &parcel for (int32_t i = 0; i < infoSize; i++) { std::unique_ptr info(reply.ReadParcelable()); if (!info) { - APP_LOGE("Read Parcelable infos failed"); + HILOG_ERROR("Read Parcelable infos failed"); return ERR_INVALID_VALUE; } parcelableInfos.emplace_back(*info); } - APP_LOGD("get parcelable infos success"); + HILOG_DEBUG("get parcelable infos success"); return NO_ERROR; } @@ -399,10 +398,10 @@ int AppMgrProxy::RegisterApplicationStateObserver( const sptr &observer) { if (!observer) { - APP_LOGE("observer null"); + HILOG_ERROR("observer null"); return ERR_INVALID_VALUE; } - APP_LOGD("RegisterApplicationStateObserver start"); + HILOG_DEBUG("RegisterApplicationStateObserver start"); MessageParcel data; MessageParcel reply; MessageOption option; @@ -410,14 +409,14 @@ int AppMgrProxy::RegisterApplicationStateObserver( return ERR_FLATTEN_OBJECT; } if (!data.WriteParcelable(observer->AsObject())) { - APP_LOGE("observer write failed."); + HILOG_ERROR("observer write failed."); return ERR_FLATTEN_OBJECT; } auto error = Remote()->SendRequest(static_cast(IAppMgr::Message::REGISTER_APPLICATION_STATE_OBSERVER), data, reply, option); if (error != NO_ERROR) { - APP_LOGE("Send request error: %{public}d", error); + HILOG_ERROR("Send request error: %{public}d", error); return error; } return reply.ReadInt32(); @@ -427,10 +426,10 @@ int AppMgrProxy::UnregisterApplicationStateObserver( const sptr &observer) { if (!observer) { - APP_LOGE("observer null"); + HILOG_ERROR("observer null"); return ERR_INVALID_VALUE; } - APP_LOGD("UnregisterApplicationStateObserver start"); + HILOG_DEBUG("UnregisterApplicationStateObserver start"); MessageParcel data; MessageParcel reply; MessageOption option; @@ -438,14 +437,14 @@ int AppMgrProxy::UnregisterApplicationStateObserver( return ERR_FLATTEN_OBJECT; } if (!data.WriteParcelable(observer->AsObject())) { - APP_LOGE("observer write failed."); + HILOG_ERROR("observer write failed."); return ERR_FLATTEN_OBJECT; } auto error = Remote()->SendRequest(static_cast(IAppMgr::Message::UNREGISTER_APPLICATION_STATE_OBSERVER), data, reply, option); if (error != NO_ERROR) { - APP_LOGE("Send request error: %{public}d", error); + HILOG_ERROR("Send request error: %{public}d", error); return error; } return reply.ReadInt32(); @@ -453,7 +452,7 @@ int AppMgrProxy::UnregisterApplicationStateObserver( int AppMgrProxy::GetForegroundApplications(std::vector &list) { - APP_LOGD("GetForegroundApplications start"); + HILOG_DEBUG("GetForegroundApplications start"); MessageParcel data; MessageParcel reply; MessageOption option; @@ -463,14 +462,14 @@ int AppMgrProxy::GetForegroundApplications(std::vector &list) auto error = Remote()->SendRequest(static_cast(IAppMgr::Message::GET_FOREGROUND_APPLICATIONS), data, reply, option); if (error != NO_ERROR) { - APP_LOGE("GetForegroundApplications fail, error: %{public}d", error); + HILOG_ERROR("GetForegroundApplications fail, error: %{public}d", error); return error; } int32_t infoSize = reply.ReadInt32(); for (int32_t i = 0; i < infoSize; i++) { std::unique_ptr info(reply.ReadParcelable()); if (!info) { - APP_LOGE("Read Parcelable infos failed."); + HILOG_ERROR("Read Parcelable infos failed."); return ERR_INVALID_VALUE; } list.emplace_back(*info); @@ -489,21 +488,21 @@ int AppMgrProxy::StartUserTestProcess(const AAFwk::Want &want, const sptrSendRequest(static_cast(IAppMgr::Message::START_USER_TEST_PROCESS), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); return ret; } return reply.ReadInt32(); @@ -520,25 +519,25 @@ int AppMgrProxy::FinishUserTest( return ERR_FLATTEN_OBJECT; } if (!data.WriteString(msg)) { - APP_LOGE("msg write failed."); + HILOG_ERROR("msg write failed."); return ERR_FLATTEN_OBJECT; } if (!data.WriteInt32(resultCode)) { - APP_LOGE("resultCode:WriteInt32 fail."); + HILOG_ERROR("resultCode:WriteInt32 fail."); return ERR_FLATTEN_OBJECT; } if (!data.WriteString(bundleName)) { - APP_LOGE("bundleName write failed."); + HILOG_ERROR("bundleName write failed."); return ERR_FLATTEN_OBJECT; } if (!data.WriteInt32(pid)) { - APP_LOGE("pid write failed."); + HILOG_ERROR("pid write failed."); return ERR_FLATTEN_OBJECT; } int32_t ret = Remote()->SendRequest(static_cast(IAppMgr::Message::FINISH_USER_TEST), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); return ret; } return reply.ReadInt32(); @@ -549,17 +548,17 @@ void AppMgrProxy::ScheduleAcceptWantDone(const int32_t recordId, const AAFwk::Wa MessageParcel data; MessageParcel reply; if (!WriteInterfaceToken(data)) { - APP_LOGE("WriteInterfaceToken failed"); + HILOG_ERROR("WriteInterfaceToken failed"); return; } if (!data.WriteInt32(recordId) || !data.WriteParcelable(&want) || !data.WriteString(flag)) { - APP_LOGE("want write failed."); + HILOG_ERROR("want write failed."); return; } if (!SendTransactCmd(IAppMgr::Message::SCHEDULE_ACCEPT_WANT_DONE, data, reply)) { - APP_LOGE("SendTransactCmd failed"); + HILOG_ERROR("SendTransactCmd failed"); return; } } @@ -589,7 +588,7 @@ int AppMgrProxy::StartRenderProcess(const std::string &renderParam, int32_t ipcF int32_t sharedFd, pid_t &renderPid) { if (renderParam.empty() || ipcFd <= 0 || sharedFd <= 0) { - APP_LOGE("Invalid params, renderParam:%{public}s, ipcFd:%{public}d, sharedFd:%{public}d", + HILOG_ERROR("Invalid params, renderParam:%{public}s, ipcFd:%{public}d, sharedFd:%{public}d", renderParam.c_str(), ipcFd, sharedFd); return -1; } @@ -598,31 +597,31 @@ int AppMgrProxy::StartRenderProcess(const std::string &renderParam, int32_t ipcF MessageParcel reply; MessageOption option; if (!WriteInterfaceToken(data)) { - APP_LOGE("WriteInterfaceToken failed"); + HILOG_ERROR("WriteInterfaceToken failed"); return ERR_FLATTEN_OBJECT; } if (!data.WriteString(renderParam)) { - APP_LOGE("want paramSize failed."); + HILOG_ERROR("want paramSize failed."); return -1; } if (!data.WriteFileDescriptor(ipcFd) || !data.WriteFileDescriptor(sharedFd)) { - APP_LOGE("want fd failed, ipcFd:%{public}d, sharedFd:%{public}d", ipcFd, sharedFd); + HILOG_ERROR("want fd failed, ipcFd:%{public}d, sharedFd:%{public}d", ipcFd, sharedFd); return -1; } int32_t ret = Remote()->SendRequest(static_cast(IAppMgr::Message::START_RENDER_PROCESS), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("StartRenderProcess SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("StartRenderProcess SendRequest is failed, error code: %{public}d", ret); return ret; } auto result = reply.ReadInt32(); renderPid = reply.ReadInt32(); if (result != 0) { - APP_LOGW("StartRenderProcess failed, result: %{public}d", ret); + HILOG_WARN("StartRenderProcess failed, result: %{public}d", ret); return ret; } return 0; @@ -631,11 +630,11 @@ int AppMgrProxy::StartRenderProcess(const std::string &renderParam, int32_t ipcF void AppMgrProxy::AttachRenderProcess(const sptr &renderScheduler) { if (!renderScheduler) { - APP_LOGE("renderScheduler is null"); + HILOG_ERROR("renderScheduler is null"); return; } - APP_LOGD("AttachRenderProcess start"); + HILOG_DEBUG("AttachRenderProcess start"); MessageParcel data; MessageParcel reply; MessageOption option; @@ -643,12 +642,12 @@ void AppMgrProxy::AttachRenderProcess(const sptr &renderScheduler return; } if (!data.WriteParcelable(renderScheduler)) { - APP_LOGE("renderScheduler write failed."); + HILOG_ERROR("renderScheduler write failed."); return; } if (!SendTransactCmd(IAppMgr::Message::ATTACH_RENDER_PROCESS, data, reply)) { - APP_LOGE("SendTransactCmd ATTACH_RENDER_PROCESS failed"); + HILOG_ERROR("SendTransactCmd ATTACH_RENDER_PROCESS failed"); return; } } diff --git a/interfaces/innerkits/app_manager/src/appmgr/app_mgr_stub.cpp b/interfaces/innerkits/app_manager/src/appmgr/app_mgr_stub.cpp index 936f8477d4..bad33a92ec 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/app_mgr_stub.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/app_mgr_stub.cpp @@ -20,11 +20,11 @@ #include "iremote_object.h" #include "ability_info.h" -#include "app_log_wrapper.h" #include "app_mgr_proxy.h" #include "app_scheduler_interface.h" #include "appexecfwk_errors.h" #include "bytrace.h" +#include "hilog_wrapper.h" #include "iapp_state_callback.h" #include "want.h" #include "bundle_info.h" @@ -85,11 +85,11 @@ AppMgrStub::~AppMgrStub() int AppMgrStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - APP_LOGI("AppMgrStub::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); + HILOG_INFO("AppMgrStub::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); std::u16string descriptor = AppMgrStub::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { - APP_LOGE("local descriptor is not equal to remote"); + HILOG_ERROR("local descriptor is not equal to remote"); return ERR_INVALID_STATE; } @@ -156,11 +156,11 @@ int32_t AppMgrStub::HandleGetAmsMgr(MessageParcel &data, MessageParcel &reply) int32_t result = NO_ERROR; sptr amsMgr = GetAmsMgr(); if (!amsMgr) { - APP_LOGE("abilitymgr instance is nullptr"); + HILOG_ERROR("abilitymgr instance is nullptr"); result = ERR_NO_INIT; } else { if (!reply.WriteParcelable(amsMgr->AsObject())) { - APP_LOGE("failed to reply abilitymgr instance to client, for write parcel error"); + HILOG_ERROR("failed to reply abilitymgr instance to client, for write parcel error"); result = ERR_APPEXECFWK_PARCEL_ERROR; } } @@ -220,7 +220,7 @@ int32_t AppMgrStub::HandleGetSystemMemoryAttr(MessageParcel &data, MessageParcel data.ReadString(strConfig); GetSystemMemoryAttr(memoryInfo, strConfig); if (reply.WriteParcelable(&memoryInfo)) { - APP_LOGE("want write failed."); + HILOG_ERROR("want write failed."); return ERR_INVALID_VALUE; } return NO_ERROR; @@ -241,7 +241,7 @@ int32_t AppMgrStub::HandleStartupResidentProcess(MessageParcel &data, MessagePar for (int32_t i = 0; i < infoSize; i++) { std::unique_ptr bundleInfo(data.ReadParcelable()); if (!bundleInfo) { - APP_LOGE("Read Parcelable infos failed."); + HILOG_ERROR("Read Parcelable infos failed."); return ERR_INVALID_VALUE; } bundleInfos.emplace_back(*bundleInfo); @@ -287,12 +287,12 @@ int32_t AppMgrStub::HandleStartUserTestProcess(MessageParcel &data, MessageParce { AAFwk::Want *want = data.ReadParcelable(); if (want == nullptr) { - APP_LOGE("want is nullptr"); + HILOG_ERROR("want is nullptr"); return ERR_INVALID_VALUE; } BundleInfo *bundleInfo = data.ReadParcelable(); if (want == nullptr) { - APP_LOGE("want is nullptr"); + HILOG_ERROR("want is nullptr"); return ERR_INVALID_VALUE; } auto observer = data.ReadParcelable(); @@ -333,7 +333,7 @@ int32_t AppMgrStub::HandleScheduleAcceptWantDone(MessageParcel &data, MessagePar auto recordId = data.ReadInt32(); AAFwk::Want *want = data.ReadParcelable(); if (want == nullptr) { - APP_LOGE("want is nullptr"); + HILOG_ERROR("want is nullptr"); return ERR_INVALID_VALUE; } auto flag = data.ReadString(); @@ -351,7 +351,7 @@ int32_t AppMgrStub::HandleGetAbilityRecordsByProcessID(MessageParcel &data, Mess reply.WriteInt32(tokens.size()); for (auto &it : tokens) { if (!reply.WriteRemoteObject(it)) { - APP_LOGE("failed to write query result."); + HILOG_ERROR("failed to write query result."); return ERR_FLATTEN_OBJECT; } } @@ -369,11 +369,11 @@ int32_t AppMgrStub::HandleStartRenderProcess(MessageParcel &data, MessageParcel int32_t renderPid = 0; int32_t result = StartRenderProcess(renderParam, ipcFd, sharedFd, renderPid); if (!reply.WriteInt32(result)) { - APP_LOGE("write result error."); + HILOG_ERROR("write result error."); return ERR_INVALID_VALUE; } if (!reply.WriteInt32(renderPid)) { - APP_LOGE("write renderPid error."); + HILOG_ERROR("write renderPid error."); return ERR_INVALID_VALUE; } return result; diff --git a/interfaces/innerkits/app_manager/src/appmgr/app_process_data.cpp b/interfaces/innerkits/app_manager/src/appmgr/app_process_data.cpp index aaa30c12a3..2483847c36 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/app_process_data.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/app_process_data.cpp @@ -15,7 +15,7 @@ #include "app_process_data.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "nlohmann/json.hpp" #include "string_ex.h" @@ -75,7 +75,7 @@ AppProcessData *AppProcessData::Unmarshalling(Parcel &parcel) { AppProcessData *appProcessData = new (std::nothrow) AppProcessData(); if (appProcessData && !appProcessData->ReadFromParcel(parcel)) { - APP_LOGW("failed, because ReadFromParcel failed"); + HILOG_WARN("failed, because ReadFromParcel failed"); delete appProcessData; appProcessData = nullptr; } diff --git a/interfaces/innerkits/app_manager/src/appmgr/app_resident_process_info.cpp b/interfaces/innerkits/app_manager/src/appmgr/app_resident_process_info.cpp index 9242a24ac7..9f39e9ea31 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/app_resident_process_info.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/app_resident_process_info.cpp @@ -14,7 +14,7 @@ */ #include "app_resident_process_info.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -30,7 +30,7 @@ AppResidentProcessInfo *AppResidentProcessInfo::Unmarshalling(Parcel &parcel) bool AppResidentProcessInfo::Marshalling(Parcel &parcel) const { - APP_LOGW("Marshalling"); + HILOG_WARN("Marshalling"); parcel.WriteBool(isKeepAliveApp_); parcel.WriteInt32(abilityStage_.size()); for (auto &info : abilityStage_) { @@ -48,7 +48,7 @@ bool AppResidentProcessInfo::ReadFromParcel(Parcel &parcel) for (int32_t i = 0; i < size; i++) { std::unique_ptr hapModuleInfo(parcel.ReadParcelable()); if (!hapModuleInfo) { - APP_LOGE("ReadParcelable failed"); + HILOG_ERROR("ReadParcelable failed"); return false; } abilityStage_.emplace_back(*hapModuleInfo); diff --git a/interfaces/innerkits/app_manager/src/appmgr/app_scheduler_host.cpp b/interfaces/innerkits/app_manager/src/appmgr/app_scheduler_host.cpp index a9213ed3a1..a2aa882fce 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/app_scheduler_host.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/app_scheduler_host.cpp @@ -15,9 +15,9 @@ #include "app_scheduler_host.h" #include "ability_info.h" -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" #include "bytrace.h" +#include "hilog_wrapper.h" #include "ipc_types.h" namespace OHOS { @@ -59,11 +59,11 @@ AppSchedulerHost::~AppSchedulerHost() int AppSchedulerHost::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - APP_LOGI("AppSchedulerHost::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); + HILOG_INFO("AppSchedulerHost::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); std::u16string descriptor = AppSchedulerHost::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { - APP_LOGE("local descriptor is not equal to remote"); + HILOG_ERROR("local descriptor is not equal to remote"); return ERR_INVALID_STATE; } @@ -117,7 +117,7 @@ int32_t AppSchedulerHost::HandleScheduleLaunchAbility(MessageParcel &data, Messa BYTRACE(BYTRACE_TAG_APP); std::unique_ptr abilityInfo(data.ReadParcelable()); if (!abilityInfo) { - APP_LOGE("ReadParcelable failed"); + HILOG_ERROR("ReadParcelable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -141,11 +141,11 @@ int32_t AppSchedulerHost::HandleScheduleLaunchApplication(MessageParcel &data, M std::unique_ptr launchData(data.ReadParcelable()); std::unique_ptr config(data.ReadParcelable()); if (!launchData) { - APP_LOGE("ReadParcelable failed"); + HILOG_ERROR("ReadParcelable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!config) { - APP_LOGE("ReadParcelable failed"); + HILOG_ERROR("ReadParcelable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -158,7 +158,7 @@ int32_t AppSchedulerHost::HandleScheduleAbilityStage(MessageParcel &data, Messag BYTRACE(BYTRACE_TAG_APP); std::unique_ptr abilityStage(data.ReadParcelable()); if (!abilityStage) { - APP_LOGE("ReadParcelable failed"); + HILOG_ERROR("ReadParcelable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -171,7 +171,7 @@ int32_t AppSchedulerHost::HandleScheduleProfileChanged(MessageParcel &data, Mess BYTRACE(BYTRACE_TAG_APP); std::unique_ptr profile(data.ReadParcelable()); if (!profile) { - APP_LOGE("ReadParcelable failed"); + HILOG_ERROR("ReadParcelable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -184,7 +184,7 @@ int32_t AppSchedulerHost::HandleScheduleConfigurationUpdated(MessageParcel &data BYTRACE(BYTRACE_TAG_APP); std::unique_ptr configuration(data.ReadParcelable()); if (!configuration) { - APP_LOGE("ReadParcelable failed"); + HILOG_ERROR("ReadParcelable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -204,7 +204,7 @@ int32_t AppSchedulerHost::HandleScheduleAcceptWant(MessageParcel &data, MessageP BYTRACE(BYTRACE_TAG_APP); AAFwk::Want *want = data.ReadParcelable(); if (want == nullptr) { - APP_LOGE("want is nullptr"); + HILOG_ERROR("want is nullptr"); return ERR_INVALID_VALUE; } auto moduleName = data.ReadString(); diff --git a/interfaces/innerkits/app_manager/src/appmgr/app_scheduler_proxy.cpp b/interfaces/innerkits/app_manager/src/appmgr/app_scheduler_proxy.cpp index 14ec665538..1305571339 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/app_scheduler_proxy.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/app_scheduler_proxy.cpp @@ -15,7 +15,7 @@ #include "app_scheduler_proxy.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "iremote_object.h" @@ -27,7 +27,7 @@ AppSchedulerProxy::AppSchedulerProxy(const sptr &impl) : IRemoteP bool AppSchedulerProxy::WriteInterfaceToken(MessageParcel &data) { if (!data.WriteInterfaceToken(AppSchedulerProxy::GetDescriptor())) { - APP_LOGE("write interface token failed"); + HILOG_ERROR("write interface token failed"); return false; } return true; @@ -43,7 +43,7 @@ void AppSchedulerProxy::ScheduleForegroundApplication() } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = @@ -52,7 +52,7 @@ void AppSchedulerProxy::ScheduleForegroundApplication() reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } } @@ -66,7 +66,7 @@ void AppSchedulerProxy::ScheduleBackgroundApplication() } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = @@ -75,7 +75,7 @@ void AppSchedulerProxy::ScheduleBackgroundApplication() reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } } @@ -89,13 +89,13 @@ void AppSchedulerProxy::ScheduleTerminateApplication() } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IAppScheduler::Message::SCHEDULE_TERMINATE_APPLICATION_TRANSACTION), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } } @@ -109,13 +109,13 @@ void AppSchedulerProxy::ScheduleLowMemory() } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IAppScheduler::Message::SCHEDULE_LOWMEMORY_APPLICATION_TRANSACTION), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } } @@ -130,7 +130,7 @@ void AppSchedulerProxy::ScheduleShrinkMemory(const int32_t level) data.WriteInt32(level); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( @@ -139,7 +139,7 @@ void AppSchedulerProxy::ScheduleShrinkMemory(const int32_t level) reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } } @@ -155,18 +155,18 @@ void AppSchedulerProxy::ScheduleLaunchAbility(const AbilityInfo &info, const spt data.WriteParcelable(&info); data.WriteParcelable(token.GetRefPtr()); if (!data.WriteParcelable(want.get())) { - APP_LOGE("write want fail."); + HILOG_ERROR("write want fail."); return; } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IAppScheduler::Message::SCHEDULE_LAUNCH_ABILITY_TRANSACTION), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } } @@ -181,19 +181,19 @@ void AppSchedulerProxy::ScheduleCleanAbility(const sptr &token) data.WriteParcelable(token.GetRefPtr()); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IAppScheduler::Message::SCHEDULE_CLEAN_ABILITY_TRANSACTION), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } } void AppSchedulerProxy::ScheduleLaunchApplication(const AppLaunchData &launchData, const Configuration &config) { - APP_LOGI("AppSchedulerProxy ScheduleLaunchApplication start"); + HILOG_INFO("AppSchedulerProxy ScheduleLaunchApplication start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -202,32 +202,32 @@ void AppSchedulerProxy::ScheduleLaunchApplication(const AppLaunchData &launchDat } if (!data.WriteParcelable(&launchData)) { - APP_LOGE("WriteParcelable launchData failed"); + HILOG_ERROR("WriteParcelable launchData failed"); return ; } if (!data.WriteParcelable(&config)) { - APP_LOGE("WriteParcelable config failed"); + HILOG_ERROR("WriteParcelable config failed"); return ; } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IAppScheduler::Message::SCHEDULE_LAUNCH_APPLICATION_TRANSACTION), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGI("AppSchedulerProxy ScheduleLaunchApplication end"); + HILOG_INFO("AppSchedulerProxy ScheduleLaunchApplication end"); } void AppSchedulerProxy::ScheduleAbilityStage(const HapModuleInfo &abilityStage) { - APP_LOGI("AppSchedulerProxy ScheduleAbilityStage start"); + HILOG_INFO("AppSchedulerProxy ScheduleAbilityStage start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -241,15 +241,15 @@ void AppSchedulerProxy::ScheduleAbilityStage(const HapModuleInfo &abilityStage) sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IAppScheduler::Message::SCHEDULE_ABILITY_STAGE_INFO), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGI("AppSchedulerProxy ScheduleAbilityStage end"); + HILOG_INFO("AppSchedulerProxy ScheduleAbilityStage end"); } void AppSchedulerProxy::ScheduleProfileChanged(const Profile &profile) @@ -263,13 +263,13 @@ void AppSchedulerProxy::ScheduleProfileChanged(const Profile &profile) data.WriteParcelable(&profile); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IAppScheduler::Message::SCHEDULE_PROFILE_CHANGED_TRANSACTION), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } } @@ -284,13 +284,13 @@ void AppSchedulerProxy::ScheduleConfigurationUpdated(const Configuration &config data.WriteParcelable(&config); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IAppScheduler::Message::SCHEDULE_CONFIGURATION_UPDATED), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } } @@ -304,13 +304,13 @@ void AppSchedulerProxy::ScheduleProcessSecurityExit() } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IAppScheduler::Message::SCHEDULE_PROCESS_SECURITY_EXIT_TRANSACTION), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } } @@ -328,13 +328,13 @@ void AppSchedulerProxy::ScheduleAcceptWant(const AAFwk::Want &want, const std::s } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IAppScheduler::Message::SCHEDULE_ACCEPT_WANT), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } } } // namespace AppExecFwk diff --git a/interfaces/innerkits/app_manager/src/appmgr/app_state_callback_host.cpp b/interfaces/innerkits/app_manager/src/appmgr/app_state_callback_host.cpp index 2a953aff5b..9636dbaf4a 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/app_state_callback_host.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/app_state_callback_host.cpp @@ -15,9 +15,9 @@ #include "app_state_callback_host.h" -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" #include "bytrace.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "iremote_object.h" @@ -41,11 +41,11 @@ AppStateCallbackHost::~AppStateCallbackHost() int AppStateCallbackHost::OnRemoteRequest( uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - APP_LOGI("AppStateCallbackHost::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); + HILOG_INFO("AppStateCallbackHost::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); std::u16string descriptor = AppStateCallbackHost::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { - APP_LOGE("local descriptor is not equal to remote"); + HILOG_ERROR("local descriptor is not equal to remote"); return ERR_INVALID_STATE; } @@ -61,12 +61,12 @@ int AppStateCallbackHost::OnRemoteRequest( void AppStateCallbackHost::OnAbilityRequestDone(const sptr &, const AbilityState) { - APP_LOGD("called"); + HILOG_DEBUG("called"); } void AppStateCallbackHost::OnAppStateChanged(const AppProcessData &) { - APP_LOGD("called"); + HILOG_DEBUG("called"); } int32_t AppStateCallbackHost::HandleOnAppStateChanged(MessageParcel &data, MessageParcel &reply) @@ -74,7 +74,7 @@ int32_t AppStateCallbackHost::HandleOnAppStateChanged(MessageParcel &data, Messa BYTRACE(BYTRACE_TAG_APP); std::unique_ptr processData(data.ReadParcelable()); if (!processData) { - APP_LOGE("ReadParcelable failed"); + HILOG_ERROR("ReadParcelable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } diff --git a/interfaces/innerkits/app_manager/src/appmgr/app_state_callback_proxy.cpp b/interfaces/innerkits/app_manager/src/appmgr/app_state_callback_proxy.cpp index 9d2a8eeb1f..c388d485db 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/app_state_callback_proxy.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/app_state_callback_proxy.cpp @@ -17,7 +17,7 @@ #include "ipc_types.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -27,7 +27,7 @@ AppStateCallbackProxy::AppStateCallbackProxy(const sptr &impl) : bool AppStateCallbackProxy::WriteInterfaceToken(MessageParcel &data) { if (!data.WriteInterfaceToken(AppStateCallbackProxy::GetDescriptor())) { - APP_LOGE("write interface token failed"); + HILOG_ERROR("write interface token failed"); return false; } return true; @@ -35,7 +35,7 @@ bool AppStateCallbackProxy::WriteInterfaceToken(MessageParcel &data) void AppStateCallbackProxy::OnAbilityRequestDone(const sptr &token, const AbilityState state) { - APP_LOGD("begin"); + HILOG_DEBUG("begin"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -47,20 +47,20 @@ void AppStateCallbackProxy::OnAbilityRequestDone(const sptr &toke data.WriteInt32(abilityState); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IAppStateCallback::Message::TRANSACT_ON_ABILITY_REQUEST_DONE), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void AppStateCallbackProxy::OnAppStateChanged(const AppProcessData &appProcessData) { - APP_LOGD("begin"); + HILOG_DEBUG("begin"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -70,15 +70,15 @@ void AppStateCallbackProxy::OnAppStateChanged(const AppProcessData &appProcessDa data.WriteParcelable(&appProcessData); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IAppStateCallback::Message::TRANSACT_ON_APP_STATE_CHANGED), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } } // namespace AppExecFwk } // namespace OHOS diff --git a/interfaces/innerkits/app_manager/src/appmgr/app_state_data.cpp b/interfaces/innerkits/app_manager/src/appmgr/app_state_data.cpp index c32eb0f895..cdef569225 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/app_state_data.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/app_state_data.cpp @@ -15,7 +15,7 @@ #include "app_state_data.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -37,7 +37,7 @@ AppStateData *AppStateData::Unmarshalling(Parcel &parcel) { AppStateData *appStateData = new (std::nothrow) AppStateData(); if (appStateData && !appStateData->ReadFromParcel(parcel)) { - APP_LOGW("appStateData failed, because ReadFromParcel failed"); + HILOG_WARN("appStateData failed, because ReadFromParcel failed"); delete appStateData; appStateData = nullptr; } diff --git a/interfaces/innerkits/app_manager/src/appmgr/app_task_info.cpp b/interfaces/innerkits/app_manager/src/appmgr/app_task_info.cpp index 6a81cd2c21..8307f27bd1 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/app_task_info.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/app_task_info.cpp @@ -15,7 +15,7 @@ #include "app_task_info.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -75,7 +75,7 @@ AppTaskInfo *AppTaskInfo::Unmarshalling(Parcel &parcel) { AppTaskInfo *appTaskInfo = new (std::nothrow) AppTaskInfo(); if (appTaskInfo && !appTaskInfo->ReadFromParcel(parcel)) { - APP_LOGW("failed, because ReadFromParcel failed"); + HILOG_WARN("failed, because ReadFromParcel failed"); delete appTaskInfo; appTaskInfo = nullptr; } diff --git a/interfaces/innerkits/app_manager/src/appmgr/application_state_observer_proxy.cpp b/interfaces/innerkits/app_manager/src/appmgr/application_state_observer_proxy.cpp index 00f373e13e..265c60cdbf 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/application_state_observer_proxy.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/application_state_observer_proxy.cpp @@ -15,9 +15,9 @@ #include "application_state_observer_proxy.h" +#include "hilog_wrapper.h" #include "ipc_types.h" -#include "app_log_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -28,7 +28,7 @@ ApplicationStateObserverProxy::ApplicationStateObserverProxy( bool ApplicationStateObserverProxy::WriteInterfaceToken(MessageParcel &data) { if (!data.WriteInterfaceToken(ApplicationStateObserverProxy::GetDescriptor())) { - APP_LOGE("write interface token failed"); + HILOG_ERROR("write interface token failed"); return false; } return true; @@ -36,7 +36,7 @@ bool ApplicationStateObserverProxy::WriteInterfaceToken(MessageParcel &data) void ApplicationStateObserverProxy::OnForegroundApplicationChanged(const AppStateData &appStateData) { - APP_LOGD("begin"); + HILOG_DEBUG("begin"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_ASYNC); @@ -46,21 +46,21 @@ void ApplicationStateObserverProxy::OnForegroundApplicationChanged(const AppStat data.WriteParcelable(&appStateData); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IApplicationStateObserver::Message::TRANSACT_ON_FOREGROUND_APPLICATION_CHANGED), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void ApplicationStateObserverProxy::OnAbilityStateChanged(const AbilityStateData &abilityStateData) { - APP_LOGD("OnAbilityStateChanged begin"); + HILOG_DEBUG("OnAbilityStateChanged begin"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_ASYNC); @@ -70,21 +70,21 @@ void ApplicationStateObserverProxy::OnAbilityStateChanged(const AbilityStateData data.WriteParcelable(&abilityStateData); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IApplicationStateObserver::Message::TRANSACT_ON_ABILITY_STATE_CHANGED), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void ApplicationStateObserverProxy::OnExtensionStateChanged(const AbilityStateData &abilityStateData) { - APP_LOGD("OnExtensionStateChanged begin"); + HILOG_DEBUG("OnExtensionStateChanged begin"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_ASYNC); @@ -94,21 +94,21 @@ void ApplicationStateObserverProxy::OnExtensionStateChanged(const AbilityStateDa data.WriteParcelable(&abilityStateData); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IApplicationStateObserver::Message::TRANSACT_ON_EXTENSION_STATE_CHANGED), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void ApplicationStateObserverProxy::OnProcessCreated(const ProcessData &processData) { - APP_LOGD("begin"); + HILOG_DEBUG("begin"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_ASYNC); @@ -118,21 +118,21 @@ void ApplicationStateObserverProxy::OnProcessCreated(const ProcessData &processD data.WriteParcelable(&processData); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IApplicationStateObserver::Message::TRANSACT_ON_PROCESS_CREATED), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void ApplicationStateObserverProxy::OnProcessDied(const ProcessData &processData) { - APP_LOGD("begin"); + HILOG_DEBUG("begin"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_ASYNC); @@ -142,21 +142,21 @@ void ApplicationStateObserverProxy::OnProcessDied(const ProcessData &processData data.WriteParcelable(&processData); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IApplicationStateObserver::Message::TRANSACT_ON_PROCESS_DIED), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void ApplicationStateObserverProxy::OnApplicationStateChanged(const AppStateData &appStateData) { - APP_LOGI("begin"); + HILOG_INFO("begin"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_ASYNC); @@ -166,16 +166,16 @@ void ApplicationStateObserverProxy::OnApplicationStateChanged(const AppStateData data.WriteParcelable(&appStateData); sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IApplicationStateObserver::Message::TRANSACT_ON_APPLICATION_STATE_CHANGED), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGI("end"); + HILOG_INFO("end"); } } // namespace AppExecFwk } // namespace OHOS diff --git a/interfaces/innerkits/app_manager/src/appmgr/application_state_observer_stub.cpp b/interfaces/innerkits/app_manager/src/appmgr/application_state_observer_stub.cpp index f168db54b0..3bf6e6e6bc 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/application_state_observer_stub.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/application_state_observer_stub.cpp @@ -15,7 +15,7 @@ #include "application_state_observer_stub.h" #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "iremote_object.h" @@ -52,11 +52,11 @@ ApplicationStateObserverStub::~ApplicationStateObserverStub() int ApplicationStateObserverStub::OnRemoteRequest( uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - APP_LOGI("ApplicationStateObserverStub::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); + HILOG_INFO("ApplicationStateObserverStub::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); std::u16string descriptor = ApplicationStateObserverStub::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { - APP_LOGE("local descriptor is not equal to remote"); + HILOG_ERROR("local descriptor is not equal to remote"); return ERR_INVALID_STATE; } @@ -92,7 +92,7 @@ int32_t ApplicationStateObserverStub::HandleOnForegroundApplicationChanged(Messa { std::unique_ptr processData(data.ReadParcelable()); if (!processData) { - APP_LOGE("ReadParcelable failed"); + HILOG_ERROR("ReadParcelable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -104,7 +104,7 @@ int32_t ApplicationStateObserverStub::HandleOnAbilityStateChanged(MessageParcel { std::unique_ptr abilityStateData(data.ReadParcelable()); if (!abilityStateData) { - APP_LOGE("ReadParcelable failed"); + HILOG_ERROR("ReadParcelable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -116,7 +116,7 @@ int32_t ApplicationStateObserverStub::HandleOnExtensionStateChanged(MessageParce { std::unique_ptr abilityStateData(data.ReadParcelable()); if (!abilityStateData) { - APP_LOGE("ReadParcelable failed"); + HILOG_ERROR("ReadParcelable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -128,7 +128,7 @@ int32_t ApplicationStateObserverStub::HandleOnProcessCreated(MessageParcel &data { std::unique_ptr processData(data.ReadParcelable()); if (!processData) { - APP_LOGE("ReadParcelable failed"); + HILOG_ERROR("ReadParcelable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -140,7 +140,7 @@ int32_t ApplicationStateObserverStub::HandleOnProcessDied(MessageParcel &data, M { std::unique_ptr processData(data.ReadParcelable()); if (!processData) { - APP_LOGE("ReadParcelable failed"); + HILOG_ERROR("ReadParcelable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -152,7 +152,7 @@ int32_t ApplicationStateObserverStub::HandleOnApplicationStateChanged(MessagePar { std::unique_ptr processData(data.ReadParcelable()); if (!processData) { - APP_LOGE("ReadParcelable failed"); + HILOG_ERROR("ReadParcelable failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -162,7 +162,7 @@ int32_t ApplicationStateObserverStub::HandleOnApplicationStateChanged(MessagePar void ApplicationStateObserverRecipient::OnRemoteDied(const wptr &__attribute__((unused)) remote) { - APP_LOGE("ApplicationStateObserverRecipient On remote died."); + HILOG_ERROR("ApplicationStateObserverRecipient On remote died."); if (handler_) { handler_(remote); } diff --git a/interfaces/innerkits/app_manager/src/appmgr/configuration.cpp b/interfaces/innerkits/app_manager/src/appmgr/configuration.cpp index b6b96e4e25..ea76fae366 100755 --- a/interfaces/innerkits/app_manager/src/appmgr/configuration.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/configuration.cpp @@ -17,7 +17,7 @@ #include -#include "app_log_wrapper.h" +#include "ability_base_log_wrapper.h" #include "string_ex.h" namespace OHOS { @@ -62,7 +62,7 @@ bool Configuration::MakeTheKey(std::string &getKey, int id, const std::string &p getKey += std::to_string(id); getKey += ConfigurationInner::CONNECTION_SYMBOL; getKey += param; - APP_LOGW(" getKey [%{public}s]", getKey.c_str()); + ABILITYBASE_LOGW(" getKey [%{public}s]", getKey.c_str()); return true; } @@ -134,7 +134,7 @@ void Configuration::CompareDifferent(std::vector &diffKeyV, const C std::vector otherk; other.GetAllKey(otherk); for (const auto &iter : otherk) { - APP_LOGW(" iter : [%{public}s] | Val: [%{public}s]", iter.c_str(), other.GetValue(iter).c_str()); + ABILITYBASE_LOGW(" iter : [%{public}s] | Val: [%{public}s]", iter.c_str(), other.GetValue(iter).c_str()); // Insert new content directly auto pair = configParameter_.insert(std::make_pair(iter, other.GetValue(iter))); if (pair.second) { @@ -201,7 +201,7 @@ const std::string& Configuration::GetName() const bool Configuration::ReadFromParcel(Parcel &parcel) { - APP_LOGW("ReadFromParcel"); + ABILITYBASE_LOGW("ReadFromParcel"); defaultDisplayId_ = parcel.ReadInt32(); int32_t configSize = parcel.ReadInt32(); std::vector keys; @@ -209,17 +209,17 @@ bool Configuration::ReadFromParcel(Parcel &parcel) keys.clear(); values.clear(); if (!parcel.ReadStringVector(&keys)) { - APP_LOGE("ReadStringVector for keys failed."); + ABILITYBASE_LOGE("ReadStringVector for keys failed."); return false; } if (!parcel.ReadStringVector(&values)) { - APP_LOGE("ReadStringVector for values failed."); + ABILITYBASE_LOGE("ReadStringVector for values failed."); return false; } int32_t keySize = keys.size(); int32_t valueSize = values.size(); if (keySize != valueSize || configSize != valueSize) { - APP_LOGE("ReadFromParcel failed, invalid size."); + ABILITYBASE_LOGE("ReadFromParcel failed, invalid size."); return false; } std::string key; @@ -244,7 +244,7 @@ Configuration *Configuration::Unmarshalling(Parcel &parcel) bool Configuration::Marshalling(Parcel &parcel) const { - APP_LOGW("Marshalling"); + ABILITYBASE_LOGW("Marshalling"); std::vector keys; std::vector values; keys.clear(); diff --git a/interfaces/innerkits/app_manager/src/appmgr/priority_object.cpp b/interfaces/innerkits/app_manager/src/appmgr/priority_object.cpp index 23298807f9..e3a93a562c 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/priority_object.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/priority_object.cpp @@ -15,7 +15,7 @@ #include "priority_object.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -133,7 +133,7 @@ PriorityObject *PriorityObject::Unmarshalling(Parcel &parcel) { PriorityObject *priorityObject = new (std::nothrow) PriorityObject(); if (priorityObject && !priorityObject->ReadFromParcel(parcel)) { - APP_LOGW("failed, because ReadFromParcel failed"); + HILOG_WARN("failed, because ReadFromParcel failed"); delete priorityObject; priorityObject = nullptr; } diff --git a/interfaces/innerkits/app_manager/src/appmgr/process_data.cpp b/interfaces/innerkits/app_manager/src/appmgr/process_data.cpp index d44edbf0e8..ab37f920e3 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/process_data.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/process_data.cpp @@ -15,7 +15,7 @@ #include "process_data.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -37,7 +37,7 @@ ProcessData *ProcessData::Unmarshalling(Parcel &parcel) { ProcessData *processData = new (std::nothrow) ProcessData(); if (processData && !processData->ReadFromParcel(parcel)) { - APP_LOGW("processData failed, because ReadFromParcel failed"); + HILOG_WARN("processData failed, because ReadFromParcel failed"); delete processData; processData = nullptr; } diff --git a/interfaces/innerkits/app_manager/src/appmgr/process_info.cpp b/interfaces/innerkits/app_manager/src/appmgr/process_info.cpp index de768ed077..0efb228bab 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/process_info.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/process_info.cpp @@ -15,7 +15,7 @@ #include "process_info.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "string_ex.h" namespace OHOS { @@ -45,7 +45,7 @@ ProcessInfo *ProcessInfo::Unmarshalling(Parcel &parcel) { ProcessInfo *processInfo = new (std::nothrow) ProcessInfo(); if (processInfo && !processInfo->ReadFromParcel(parcel)) { - APP_LOGE("ProcessInfo::Unmarshalling ReadFromParcel failed"); + HILOG_ERROR("ProcessInfo::Unmarshalling ReadFromParcel failed"); delete processInfo; processInfo = nullptr; } diff --git a/interfaces/innerkits/app_manager/src/appmgr/profile.cpp b/interfaces/innerkits/app_manager/src/appmgr/profile.cpp index 8025773b66..d866151441 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/profile.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/profile.cpp @@ -17,7 +17,7 @@ #include "string_ex.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -35,7 +35,7 @@ Profile *Profile::Unmarshalling(Parcel &parcel) { Profile *profile = new (std::nothrow) Profile(); if (profile && !profile->ReadFromParcel(parcel)) { - APP_LOGW("failed, because ReadFromParcel failed"); + HILOG_WARN("failed, because ReadFromParcel failed"); delete profile; profile = nullptr; } diff --git a/interfaces/innerkits/app_manager/src/appmgr/render_scheduler_host.cpp b/interfaces/innerkits/app_manager/src/appmgr/render_scheduler_host.cpp index 91a2db26d8..d2118654f7 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/render_scheduler_host.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/render_scheduler_host.cpp @@ -15,7 +15,7 @@ #include "render_scheduler_host.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ipc_types.h" namespace OHOS { @@ -34,11 +34,11 @@ RenderSchedulerHost::~RenderSchedulerHost() int RenderSchedulerHost::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - APP_LOGI("RenderSchedulerHost::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); + HILOG_INFO("RenderSchedulerHost::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); std::u16string descriptor = RenderSchedulerHost::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { - APP_LOGE("local descriptor is not equal to remote"); + HILOG_ERROR("local descriptor is not equal to remote"); return ERR_INVALID_STATE; } diff --git a/interfaces/innerkits/app_manager/src/appmgr/render_scheduler_proxy.cpp b/interfaces/innerkits/app_manager/src/appmgr/render_scheduler_proxy.cpp index e409655b64..b11580b4b3 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/render_scheduler_proxy.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/render_scheduler_proxy.cpp @@ -15,9 +15,9 @@ #include "render_scheduler_proxy.h" +#include "hilog_wrapper.h" #include "ipc_types.h" -#include "app_log_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -28,7 +28,7 @@ RenderSchedulerProxy::RenderSchedulerProxy( bool RenderSchedulerProxy::WriteInterfaceToken(MessageParcel &data) { if (!data.WriteInterfaceToken(RenderSchedulerProxy::GetDescriptor())) { - APP_LOGE("write interface token failed"); + HILOG_ERROR("write interface token failed"); return false; } return true; @@ -36,7 +36,7 @@ bool RenderSchedulerProxy::WriteInterfaceToken(MessageParcel &data) void RenderSchedulerProxy::NotifyBrowserFd(int32_t ipcFd, int32_t sharedFd) { - APP_LOGD("NotifyBrowserFd start"); + HILOG_DEBUG("NotifyBrowserFd start"); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_ASYNC); @@ -45,22 +45,22 @@ void RenderSchedulerProxy::NotifyBrowserFd(int32_t ipcFd, int32_t sharedFd) } if (!data.WriteFileDescriptor(ipcFd) || !data.WriteFileDescriptor(sharedFd)) { - APP_LOGE("want fd failed, ipcFd:%{public}d, sharedFd:%{public}d", ipcFd, sharedFd); + HILOG_ERROR("want fd failed, ipcFd:%{public}d, sharedFd:%{public}d", ipcFd, sharedFd); return; } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote() is NULL"); + HILOG_ERROR("Remote() is NULL"); return; } int32_t ret = remote->SendRequest( static_cast(IRenderScheduler::Message::NOTIFY_BROWSER_FD), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } - APP_LOGD("NotifyBrowserFd end"); + HILOG_DEBUG("NotifyBrowserFd end"); } } // namespace AppExecFwk } // namespace OHOS diff --git a/interfaces/innerkits/app_manager/src/appmgr/running_process_info.cpp b/interfaces/innerkits/app_manager/src/appmgr/running_process_info.cpp index 880717e582..440ea94263 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/running_process_info.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/running_process_info.cpp @@ -18,7 +18,7 @@ #include "nlohmann/json.hpp" #include "string_ex.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "parcel_macro.h" namespace OHOS { @@ -48,7 +48,7 @@ RunningProcessInfo *RunningProcessInfo::Unmarshalling(Parcel &parcel) { RunningProcessInfo *info = new (std::nothrow) RunningProcessInfo(); if (info && !info->ReadFromParcel(parcel)) { - APP_LOGW("read from parcel failed"); + HILOG_WARN("read from parcel failed"); delete info; info = nullptr; } diff --git a/interfaces/innerkits/app_manager/src/appmgr/start_specified_ability_response_proxy.cpp b/interfaces/innerkits/app_manager/src/appmgr/start_specified_ability_response_proxy.cpp index f0c3bdccc4..a2fdeb985e 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/start_specified_ability_response_proxy.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/start_specified_ability_response_proxy.cpp @@ -15,7 +15,7 @@ #include "start_specified_ability_response_proxy.h" #include "ipc_types.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -26,7 +26,7 @@ StartSpecifiedAbilityResponseProxy::StartSpecifiedAbilityResponseProxy(const spt bool StartSpecifiedAbilityResponseProxy::WriteInterfaceToken(MessageParcel &data) { if (!data.WriteInterfaceToken(StartSpecifiedAbilityResponseProxy::GetDescriptor())) { - APP_LOGE("write interface token failed"); + HILOG_ERROR("write interface token failed"); return false; } return true; @@ -35,7 +35,7 @@ bool StartSpecifiedAbilityResponseProxy::WriteInterfaceToken(MessageParcel &data void StartSpecifiedAbilityResponseProxy::OnAcceptWantResponse( const AAFwk::Want &want, const std::string &flag) { - APP_LOGD("On accept want by proxy."); + HILOG_DEBUG("On accept want by proxy."); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -43,25 +43,25 @@ void StartSpecifiedAbilityResponseProxy::OnAcceptWantResponse( return; } if (!data.WriteParcelable(&want) || !data.WriteString(flag)) { - APP_LOGE("Write data failed."); + HILOG_ERROR("Write data failed."); return; } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote is nullptr."); + HILOG_ERROR("Remote is nullptr."); return; } int32_t ret = remote->SendRequest( static_cast(IStartSpecifiedAbilityResponse::Message::ON_ACCEPT_WANT_RESPONSE), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } } void StartSpecifiedAbilityResponseProxy::OnTimeoutResponse(const AAFwk::Want &want) { - APP_LOGD("On timeout response by proxy."); + HILOG_DEBUG("On timeout response by proxy."); MessageParcel data; MessageParcel reply; MessageOption option(MessageOption::TF_SYNC); @@ -69,19 +69,19 @@ void StartSpecifiedAbilityResponseProxy::OnTimeoutResponse(const AAFwk::Want &wa return; } if (!data.WriteParcelable(&want)) { - APP_LOGE("Write data failed."); + HILOG_ERROR("Write data failed."); return; } sptr remote = Remote(); if (remote == nullptr) { - APP_LOGE("Remote is nullptr."); + HILOG_ERROR("Remote is nullptr."); return; } int32_t ret = remote->SendRequest(static_cast( IStartSpecifiedAbilityResponse::Message::ON_TIMEOUT_RESPONSE), data, reply, option); if (ret != NO_ERROR) { - APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + HILOG_WARN("SendRequest is failed, error code: %{public}d", ret); } } } // namespace AppExecFwk diff --git a/interfaces/innerkits/app_manager/src/appmgr/start_specified_ability_response_stub.cpp b/interfaces/innerkits/app_manager/src/appmgr/start_specified_ability_response_stub.cpp index 3749d5ff13..94ce53749b 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/start_specified_ability_response_stub.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/start_specified_ability_response_stub.cpp @@ -15,7 +15,7 @@ #include "start_specified_ability_response_stub.h" #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "iremote_object.h" @@ -41,7 +41,7 @@ int32_t StartSpecifiedAbilityResponseStub::HandleOnAcceptWantResponse(MessagePar { AAFwk::Want *want = data.ReadParcelable(); if (want == nullptr) { - APP_LOGE("want is nullptr"); + HILOG_ERROR("want is nullptr"); return ERR_INVALID_VALUE; } @@ -54,7 +54,7 @@ int32_t StartSpecifiedAbilityResponseStub::HandleOnTimeoutResponse(MessageParcel { AAFwk::Want *want = data.ReadParcelable(); if (want == nullptr) { - APP_LOGE("want is nullptr"); + HILOG_ERROR("want is nullptr"); return ERR_INVALID_VALUE; } @@ -65,12 +65,12 @@ int32_t StartSpecifiedAbilityResponseStub::HandleOnTimeoutResponse(MessageParcel int StartSpecifiedAbilityResponseStub::OnRemoteRequest( uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - APP_LOGI("StartSpecifiedAbilityResponseStub::OnReceived, code = %{public}d, flags= %{public}d.", + HILOG_INFO("StartSpecifiedAbilityResponseStub::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); std::u16string descriptor = StartSpecifiedAbilityResponseStub::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { - APP_LOGE("local descriptor is not equal to remote"); + HILOG_ERROR("local descriptor is not equal to remote"); return ERR_INVALID_STATE; } diff --git a/interfaces/innerkits/app_manager/src/appmgr/system_memory_attr.cpp b/interfaces/innerkits/app_manager/src/appmgr/system_memory_attr.cpp index d098170ca9..b4798e1a15 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/system_memory_attr.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/system_memory_attr.cpp @@ -14,7 +14,7 @@ */ #include "system_memory_attr.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -28,7 +28,7 @@ bool SystemMemoryAttr::ReadFromParcel(Parcel &parcel) parcel.ReadInt64(threshold_); isSysInlowMem_ = parcel.ReadBool(); - APP_LOGD("SystemMemoryAttr::ReadFromParcel %{public}zu %{public}zu %{public}zu %{public}s", + HILOG_DEBUG("SystemMemoryAttr::ReadFromParcel %{public}zu %{public}zu %{public}zu %{public}s", static_cast(availSysMem_), static_cast(totalSysMem_), static_cast(threshold_), @@ -58,7 +58,7 @@ bool SystemMemoryAttr::Marshalling(Parcel &parcel) const parcel.WriteInt64(threshold_); parcel.WriteBool(isSysInlowMem_); - APP_LOGD("SystemMemoryAttr::Marshalling %{public}zu %{public}zu %{public}zu %{public}s", + HILOG_DEBUG("SystemMemoryAttr::Marshalling %{public}zu %{public}zu %{public}zu %{public}s", static_cast(availSysMem_), static_cast(totalSysMem_), static_cast(threshold_), diff --git a/interfaces/innerkits/base/BUILD.gn b/interfaces/innerkits/base/BUILD.gn index 640bf2990c..ffb17e6984 100644 --- a/interfaces/innerkits/base/BUILD.gn +++ b/interfaces/innerkits/base/BUILD.gn @@ -15,7 +15,6 @@ import("//build/ohos.gni") config("base_config") { visibility = [ ":*" ] - include_dirs = [ "//utils/native/base/include" ] } config("base_public_config") { @@ -47,7 +46,7 @@ ohos_shared_library("base") { ] configs = [ ":base_config" ] public_configs = [ ":base_public_config" ] - deps = [ "//utils/native/base:utils" ] + external_deps = [ "utils_base:utils" ] subsystem_name = "aafwk" part_name = "ability_base" diff --git a/interfaces/innerkits/dataobs_manager/BUILD.gn b/interfaces/innerkits/dataobs_manager/BUILD.gn index b054012543..556817dc06 100644 --- a/interfaces/innerkits/dataobs_manager/BUILD.gn +++ b/interfaces/innerkits/dataobs_manager/BUILD.gn @@ -43,17 +43,15 @@ ohos_shared_library("dataobs_manager") { "${services_path}/dataobsmgr:dataobsms_config", ] - deps = [ - "//foundation/appexecfwk/standard/common:libappexecfwk_common", - "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//utils/native/base:utils", - ] + deps = [ "//foundation/appexecfwk/standard/common:libappexecfwk_common" ] external_deps = [ "ability_base:zuri", + "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] subsystem_name = "aafwk" diff --git a/interfaces/innerkits/form_manager/BUILD.gn b/interfaces/innerkits/form_manager/BUILD.gn index 37ce56ecbc..c7e99326ca 100644 --- a/interfaces/innerkits/form_manager/BUILD.gn +++ b/interfaces/innerkits/form_manager/BUILD.gn @@ -19,11 +19,10 @@ config("formmgr_sdk_config") { include_dirs = [ "include/", "//third_party/json/include", - "//utils/system/safwk/native/include", "//foundation/aafwk/standard/frameworks/kits/ability/native/include", "//foundation/aafwk/standard/interfaces/innerkits/ability_manager/include", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base/include", "//foundation/aafwk/standard/interfaces/innerkits/app_manager/include/appmgr", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "//foundation/aafwk/standard/services/common/include", ] @@ -57,13 +56,12 @@ ohos_shared_library("form_manager") { deps = [ "${appexecfwk_path}/common:libappexecfwk_common", - "${innerkits_path}/want:want", - "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", "//third_party/jsoncpp:jsoncpp", - "//utils/native/base:utils", ] external_deps = [ + "ability_base:want", + "ability_runtime:app_manager", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "hiviewdfx_hilog_native:libhilog", @@ -71,6 +69,7 @@ ohos_shared_library("form_manager") { "native_appdatamgr:native_appdatafwk", "native_appdatamgr:native_dataability", "native_appdatamgr:native_rdb", + "utils_base:utils", ] subsystem_name = "aafwk" diff --git a/interfaces/innerkits/form_manager/include/form_host_proxy.h b/interfaces/innerkits/form_manager/include/form_host_proxy.h index 255fa5d39e..ac981ca91a 100644 --- a/interfaces/innerkits/form_manager/include/form_host_proxy.h +++ b/interfaces/innerkits/form_manager/include/form_host_proxy.h @@ -16,8 +16,8 @@ #ifndef FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_FORMMGR_FORM_HOST_PROXY_H #define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_FORMMGR_FORM_HOST_PROXY_H -#include "app_log_wrapper.h" #include "form_host_interface.h" +#include "hilog_wrapper.h" #include "iremote_proxy.h" namespace OHOS { diff --git a/interfaces/innerkits/form_manager/include/form_provider_proxy.h b/interfaces/innerkits/form_manager/include/form_provider_proxy.h index 36d777f295..547aa3295a 100644 --- a/interfaces/innerkits/form_manager/include/form_provider_proxy.h +++ b/interfaces/innerkits/form_manager/include/form_provider_proxy.h @@ -16,8 +16,8 @@ #ifndef FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_FORMMGR_FORM_PROVIDER_PROXY_H #define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_FORMMGR_FORM_PROVIDER_PROXY_H -#include "app_log_wrapper.h" #include "form_provider_interface.h" +#include "hilog_wrapper.h" #include "iremote_proxy.h" namespace OHOS { diff --git a/interfaces/innerkits/form_manager/include/form_supply_proxy.h b/interfaces/innerkits/form_manager/include/form_supply_proxy.h index fae7b2543a..e6654a7bad 100644 --- a/interfaces/innerkits/form_manager/include/form_supply_proxy.h +++ b/interfaces/innerkits/form_manager/include/form_supply_proxy.h @@ -16,8 +16,8 @@ #ifndef FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_FORMMGR_FORM_SUPPLY_PROXY_H #define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_FORMMGR_FORM_SUPPLY_PROXY_H -#include "app_log_wrapper.h" #include "form_supply_interface.h" +#include "hilog_wrapper.h" #include "iremote_proxy.h" namespace OHOS { diff --git a/interfaces/innerkits/form_manager/src/form_host_proxy.cpp b/interfaces/innerkits/form_manager/src/form_host_proxy.cpp index 48bf9d8f12..f9734391bc 100644 --- a/interfaces/innerkits/form_manager/src/form_host_proxy.cpp +++ b/interfaces/innerkits/form_manager/src/form_host_proxy.cpp @@ -31,11 +31,11 @@ void FormHostProxy::OnAcquired(const FormJsInfo &formInfo) MessageOption option; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); } if (!data.WriteParcelable(&formInfo)) { - APP_LOGE("%{public}s, failed to write formInfo", __func__); + HILOG_ERROR("%{public}s, failed to write formInfo", __func__); } error = Remote()->SendRequest( @@ -44,7 +44,7 @@ void FormHostProxy::OnAcquired(const FormJsInfo &formInfo) reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); } } @@ -61,16 +61,16 @@ void FormHostProxy::OnUpdate(const FormJsInfo &formInfo) MessageOption option; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); } if (!data.WriteParcelable(&formInfo)) { - APP_LOGE("%{public}s, failed to write formInfo", __func__); + HILOG_ERROR("%{public}s, failed to write formInfo", __func__); } error = Remote()->SendRequest(static_cast(IFormHost::Message::FORM_HOST_ON_UPDATE), data, reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); } } @@ -87,11 +87,11 @@ void FormHostProxy::OnUninstall(const std::vector &formIds) MessageOption option; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); } if (!data.WriteInt64Vector(formIds)) { - APP_LOGE("%{public}s, failed to write formIds", __func__); + HILOG_ERROR("%{public}s, failed to write formIds", __func__); } error = Remote()->SendRequest( @@ -100,7 +100,7 @@ void FormHostProxy::OnUninstall(const std::vector &formIds) reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); } } @@ -111,19 +111,19 @@ int FormHostProxy::GetParcelableInfos(MessageParcel &reply, std::vector &par for (int32_t i = 0; i < infoSize; i++) { std::unique_ptr info(reply.ReadParcelable()); if (!info) { - APP_LOGE("%{public}s, failed to read Parcelable infos", __func__); + HILOG_ERROR("%{public}s, failed to read Parcelable infos", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } parcelableInfos.emplace_back(*info); } - APP_LOGI("%{public}s, get parcelable infos success", __func__); + HILOG_INFO("%{public}s, get parcelable infos success", __func__); return ERR_OK; } bool FormHostProxy::WriteInterfaceToken(MessageParcel &data) { if (!data.WriteInterfaceToken(FormHostProxy::GetDescriptor())) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return false; } return true; diff --git a/interfaces/innerkits/form_manager/src/form_host_stub.cpp b/interfaces/innerkits/form_manager/src/form_host_stub.cpp index 066c32df93..fcbcfa72e5 100644 --- a/interfaces/innerkits/form_manager/src/form_host_stub.cpp +++ b/interfaces/innerkits/form_manager/src/form_host_stub.cpp @@ -14,10 +14,10 @@ */ #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "app_scheduler_interface.h" #include "errors.h" #include "form_host_stub.h" +#include "hilog_wrapper.h" #include "ipc_skeleton.h" #include "ipc_types.h" #include "iremote_object.h" @@ -47,11 +47,11 @@ FormHostStub::~FormHostStub() */ int FormHostStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - APP_LOGI("FormHostStub::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); + HILOG_INFO("FormHostStub::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); std::u16string descriptor = FormHostStub::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { - APP_LOGE("%{public}s failed, local descriptor is not equal to remote", __func__); + HILOG_ERROR("%{public}s failed, local descriptor is not equal to remote", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } @@ -75,7 +75,7 @@ int FormHostStub::HandleAcquired(MessageParcel &data, MessageParcel &reply) { std::unique_ptr formInfo(data.ReadParcelable()); if (!formInfo) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } OnAcquired(*formInfo); @@ -92,7 +92,7 @@ int FormHostStub::HandleOnUpdate(MessageParcel &data, MessageParcel &reply) { std::unique_ptr formInfo(data.ReadParcelable()); if (!formInfo) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } OnUpdate(*formInfo); diff --git a/interfaces/innerkits/form_manager/src/form_mgr_proxy.cpp b/interfaces/innerkits/form_manager/src/form_mgr_proxy.cpp index ec68b0181c..ba46c343a8 100644 --- a/interfaces/innerkits/form_manager/src/form_mgr_proxy.cpp +++ b/interfaces/innerkits/form_manager/src/form_mgr_proxy.cpp @@ -14,8 +14,8 @@ */ #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "form_mgr_proxy.h" +#include "hilog_wrapper.h" #include "string_ex.h" namespace OHOS { @@ -38,26 +38,26 @@ int FormMgrProxy::AddForm( { MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(formId)) { - APP_LOGE("%{public}s, failed to write formId", __func__); + HILOG_ERROR("%{public}s, failed to write formId", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(&want)) { - APP_LOGE("%{public}s, failed to write want", __func__); + HILOG_ERROR("%{public}s, failed to write want", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(callerToken)) { - APP_LOGE("%{public}s, failed to write callerToken", __func__); + HILOG_ERROR("%{public}s, failed to write callerToken", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } int error = GetParcelableInfo(IFormMgr::Message::FORM_MGR_ADD_FORM, data, formInfo); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); } return error; @@ -73,15 +73,15 @@ int FormMgrProxy::DeleteForm(const int64_t formId, const sptr &ca { MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(formId)) { - APP_LOGE("%{public}s, failed to write want", __func__); + HILOG_ERROR("%{public}s, failed to write want", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(callerToken)) { - APP_LOGE("%{public}s, failed to write callerToken", __func__); + HILOG_ERROR("%{public}s, failed to write callerToken", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } MessageParcel reply; @@ -92,7 +92,7 @@ int FormMgrProxy::DeleteForm(const int64_t formId, const sptr &ca reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return ERR_APPEXECFWK_FORM_SEND_FMS_MSG; } return reply.ReadInt32(); @@ -109,19 +109,19 @@ int FormMgrProxy::ReleaseForm(const int64_t formId, const sptr &c { MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(formId)) { - APP_LOGE("%{public}s, failed to write want", __func__); + HILOG_ERROR("%{public}s, failed to write want", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(callerToken)) { - APP_LOGE("%{public}s, failed to write callerToken", __func__); + HILOG_ERROR("%{public}s, failed to write callerToken", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteBool(delCache)) { - APP_LOGE("%{public}s, failed to write delCache", __func__); + HILOG_ERROR("%{public}s, failed to write delCache", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -133,7 +133,7 @@ int FormMgrProxy::ReleaseForm(const int64_t formId, const sptr &c reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return ERR_APPEXECFWK_FORM_SEND_FMS_MSG; } return reply.ReadInt32(); @@ -153,20 +153,20 @@ int FormMgrProxy::UpdateForm( { MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(formId)) { - APP_LOGE("%{public}s, failed to write formId", __func__); + HILOG_ERROR("%{public}s, failed to write formId", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteString(bundleName)) { - APP_LOGE("%{public}s, failed to write bundleName", __func__); + HILOG_ERROR("%{public}s, failed to write bundleName", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(&FormProviderData)) { - APP_LOGE("%{public}s, failed to write formBindingData", __func__); + HILOG_ERROR("%{public}s, failed to write formBindingData", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } MessageParcel reply; @@ -177,7 +177,7 @@ int FormMgrProxy::UpdateForm( reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return ERR_APPEXECFWK_FORM_SEND_FMS_MSG; } return reply.ReadInt32(); @@ -196,15 +196,15 @@ int FormMgrProxy::SetNextRefreshTime(const int64_t formId, const int64_t nextTim MessageParcel reply; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(formId)) { - APP_LOGE("%{public}s, failed to write formId", __func__); + HILOG_ERROR("%{public}s, failed to write formId", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(nextTime)) { - APP_LOGE("%{public}s, failed to write nextTime", __func__); + HILOG_ERROR("%{public}s, failed to write nextTime", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } MessageOption option; @@ -214,7 +214,7 @@ int FormMgrProxy::SetNextRefreshTime(const int64_t formId, const int64_t nextTim reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return ERR_APPEXECFWK_FORM_SEND_FMS_MSG; } return reply.ReadInt32(); @@ -235,19 +235,19 @@ int FormMgrProxy::LifecycleUpdate( MessageParcel reply; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64Vector(formIds)) { - APP_LOGE("%{public}s, failed to write formId", __func__); + HILOG_ERROR("%{public}s, failed to write formId", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(callerToken)) { - APP_LOGE("%{public}s, failed to write bundleName", __func__); + HILOG_ERROR("%{public}s, failed to write bundleName", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt32(updateType)) { - APP_LOGE("%{public}s, failed to write nextTime", __func__); + HILOG_ERROR("%{public}s, failed to write nextTime", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } MessageOption option; @@ -257,7 +257,7 @@ int FormMgrProxy::LifecycleUpdate( reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return ERR_APPEXECFWK_FORM_SEND_FMS_MSG; } @@ -272,23 +272,23 @@ int FormMgrProxy::LifecycleUpdate( */ int FormMgrProxy::RequestForm(const int64_t formId, const sptr &callerToken, const Want &want) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(formId)) { - APP_LOGE("%{public}s, failed to write formId", __func__); + HILOG_ERROR("%{public}s, failed to write formId", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(callerToken)) { - APP_LOGE("%{public}s, failed to write callerToken", __func__); + HILOG_ERROR("%{public}s, failed to write callerToken", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(&want)) { - APP_LOGE("%{public}s, failed to write want", __func__); + HILOG_ERROR("%{public}s, failed to write want", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -300,7 +300,7 @@ int FormMgrProxy::RequestForm(const int64_t formId, const sptr &c reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return ERR_APPEXECFWK_FORM_SEND_FMS_MSG; } return reply.ReadInt32(); @@ -320,22 +320,22 @@ int FormMgrProxy::NotifyWhetherVisibleForms( { MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64Vector(formIds)) { - APP_LOGE("%{public}s, failed to write formIds", __func__); + HILOG_ERROR("%{public}s, failed to write formIds", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(callerToken)) { - APP_LOGE("%{public}s, failed to write callerToken", __func__); + HILOG_ERROR("%{public}s, failed to write callerToken", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt32(formVisibleType)) { - APP_LOGE("%{public}s, failed to write formVisibleType", __func__); + HILOG_ERROR("%{public}s, failed to write formVisibleType", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -347,7 +347,7 @@ int FormMgrProxy::NotifyWhetherVisibleForms( reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return ERR_APPEXECFWK_FORM_SEND_FMS_MSG; } return reply.ReadInt32(); @@ -363,15 +363,15 @@ int FormMgrProxy::CastTempForm(const int64_t formId, const sptr & { MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(formId)) { - APP_LOGE("%{public}s, failed to write want", __func__); + HILOG_ERROR("%{public}s, failed to write want", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(callerToken)) { - APP_LOGE("%{public}s, failed to write callerToken", __func__); + HILOG_ERROR("%{public}s, failed to write callerToken", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -384,7 +384,7 @@ int FormMgrProxy::CastTempForm(const int64_t formId, const sptr & reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return ERR_APPEXECFWK_FORM_SEND_FMS_MSG; } return reply.ReadInt32(); @@ -398,13 +398,13 @@ int FormMgrProxy::DumpStorageFormInfos(std::string &formInfos) { MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } int error = GetStringInfo(IFormMgr::Message::FORM_MGR_STORAGE_FORM_INFOS, data, formInfos); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to GetStringInfo: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to GetStringInfo: %{public}d", __func__, error); } return error; @@ -419,18 +419,18 @@ int FormMgrProxy::DumpFormInfoByBundleName(const std::string &bundleName, std::s { MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteString(bundleName)) { - APP_LOGE("%{public}s, failed to write bundleName", __func__); + HILOG_ERROR("%{public}s, failed to write bundleName", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } int error = GetStringInfo(IFormMgr::Message::FORM_MGR_FORM_INFOS_BY_NAME, data, formInfos); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to GetStringInfo: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to GetStringInfo: %{public}d", __func__, error); } return error; @@ -445,17 +445,17 @@ int FormMgrProxy::DumpFormInfoByFormId(const std::int64_t formId, std::string &f { MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(formId)) { - APP_LOGE("%{public}s, failed to write formId", __func__); + HILOG_ERROR("%{public}s, failed to write formId", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } int error = GetStringInfo(IFormMgr::Message::FORM_MGR_FORM_INFOS_BY_ID, data, formInfo); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to GetStringInfo: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to GetStringInfo: %{public}d", __func__, error); } return error; @@ -470,17 +470,17 @@ int FormMgrProxy::DumpFormTimerByFormId(const std::int64_t formId, std::string & { MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(formId)) { - APP_LOGE("%{public}s, failed to write formId", __func__); + HILOG_ERROR("%{public}s, failed to write formId", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } int error = GetStringInfo(IFormMgr::Message::FORM_MGR_FORM_TIMER_INFO_BY_ID, data, isTimingService); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to GetStringInfo: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to GetStringInfo: %{public}d", __func__, error); } return error; @@ -496,20 +496,20 @@ int FormMgrProxy::MessageEvent(const int64_t formId, const Want &want, const spt { MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(formId)) { - APP_LOGE("%{public}s, failed to write formId", __func__); + HILOG_ERROR("%{public}s, failed to write formId", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(&want)) { - APP_LOGE("%{public}s, failed to write want", __func__); + HILOG_ERROR("%{public}s, failed to write want", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(callerToken)) { - APP_LOGE("%{public}s, failed to write callerToken", __func__); + HILOG_ERROR("%{public}s, failed to write callerToken", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -518,7 +518,7 @@ int FormMgrProxy::MessageEvent(const int64_t formId, const Want &want, const spt int error = Remote()->SendRequest(static_cast(IFormMgr::Message::FORM_MGR_MESSAGE_EVENT), data, reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return ERR_APPEXECFWK_FORM_SEND_FMS_MSG; } return reply.ReadInt32(); @@ -551,18 +551,18 @@ int FormMgrProxy::GetParcelableInfos(MessageParcel &reply, std::vector &parc for (int32_t i = 0; i < infoSize; i++) { std::unique_ptr info(reply.ReadParcelable()); if (!info) { - APP_LOGE("%{public}s, failed to Read Parcelable infos", __func__); + HILOG_ERROR("%{public}s, failed to Read Parcelable infos", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } parcelableInfos.emplace_back(*info); } - APP_LOGI("get parcelable infos success"); + HILOG_INFO("get parcelable infos success"); return ERR_OK; } bool FormMgrProxy::WriteInterfaceToken(MessageParcel &data) { if (!data.WriteInterfaceToken(IFormMgr::GetDescriptor())) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return false; } return true; @@ -578,22 +578,22 @@ int FormMgrProxy::GetStringInfo(IFormMgr::Message code, MessageParcel &data, std error = reply.ReadInt32(); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to read reply result", __func__); + HILOG_ERROR("%{public}s, failed to read reply result", __func__); return error; } std::vector stringInfoList; if (!reply.ReadStringVector(&stringInfoList)) { - APP_LOGE("%{public}s, failed to read string vector from reply", __func__); + HILOG_ERROR("%{public}s, failed to read string vector from reply", __func__); return false; } if (stringInfoList.empty()) { - APP_LOGI("%{public}s, No string info", __func__); + HILOG_INFO("%{public}s, No string info", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } for (auto &info : stringInfoList) { stringInfo += info; } - APP_LOGD("get string info success"); + HILOG_DEBUG("get string info success"); return ERR_OK; } int FormMgrProxy::GetFormsInfo(IFormMgr::Message code, MessageParcel &data, std::vector &formInfos) @@ -607,7 +607,7 @@ int FormMgrProxy::GetFormsInfo(IFormMgr::Message code, MessageParcel &data, std: error = reply.ReadInt32(); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to read reply result", __func__); + HILOG_ERROR("%{public}s, failed to read reply result", __func__); return error; } @@ -625,17 +625,17 @@ int FormMgrProxy::GetParcelableInfo(IFormMgr::Message code, MessageParcel &data, error = reply.ReadInt32(); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to read reply result", __func__); + HILOG_ERROR("%{public}s, failed to read reply result", __func__); return error; } std::unique_ptr info(reply.ReadParcelable()); if (!info) { - APP_LOGE("%{public}s, failed to readParcelableInfo", __func__); + HILOG_ERROR("%{public}s, failed to readParcelableInfo", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } parcelableInfo = *info; - APP_LOGD("get parcelable info success"); + HILOG_DEBUG("get parcelable info success"); return ERR_OK; } int FormMgrProxy::SendTransactCmd(IFormMgr::Message code, MessageParcel &data, MessageParcel &reply) @@ -644,12 +644,12 @@ int FormMgrProxy::SendTransactCmd(IFormMgr::Message code, MessageParcel &data, M sptr remote = Remote(); if (!remote) { - APP_LOGE("%{public}s, failed to get remote object, cmd: %{public}d", __func__, code); + HILOG_ERROR("%{public}s, failed to get remote object, cmd: %{public}d", __func__, code); return ERR_APPEXECFWK_SERVICE_NOT_CONNECTED; } int32_t result = remote->SendRequest(static_cast(code), data, reply, option); if (result != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d, cmd: %{public}d", __func__, result, code); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d, cmd: %{public}d", __func__, result, code); return ERR_APPEXECFWK_FORM_SEND_FMS_MSG; } return ERR_OK; @@ -664,11 +664,11 @@ int FormMgrProxy::DistributedDataAddForm(const Want &want) { MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(&want)) { - APP_LOGE("%{public}s, failed to write want", __func__); + HILOG_ERROR("%{public}s, failed to write want", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -680,7 +680,7 @@ int FormMgrProxy::DistributedDataAddForm(const Want &want) reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return ERR_APPEXECFWK_FORM_SEND_FMS_MSG; } return reply.ReadInt32(); @@ -695,11 +695,11 @@ int FormMgrProxy::DistributedDataDeleteForm(const std::string &formId) { MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(std::stoll(formId))) { - APP_LOGE("%{public}s, failed to write formId", __func__); + HILOG_ERROR("%{public}s, failed to write formId", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -711,7 +711,7 @@ int FormMgrProxy::DistributedDataDeleteForm(const std::string &formId) reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return ERR_APPEXECFWK_FORM_SEND_FMS_MSG; } return reply.ReadInt32(); @@ -726,13 +726,13 @@ int FormMgrProxy::GetAllFormsInfo(std::vector &formInfos) { MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } int error = GetFormsInfo(IFormMgr::Message::FORM_MGR_GET_ALL_FORMS_INFO, data, formInfos); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to GetAllFormsInfo: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to GetAllFormsInfo: %{public}d", __func__, error); } return error; @@ -748,18 +748,18 @@ int FormMgrProxy::GetFormsInfoByApp(std::string &bundleName, std::vector &strings) if ((source.size() % LIMIT_PARCEL_SIZE) != 0) { splitSize++; } - APP_LOGD("the dump string split into %{public}d size", splitSize); + HILOG_DEBUG("the dump string split into %{public}d size", splitSize); for (int i = 0; i < splitSize; i++) { int32_t start = LIMIT_PARCEL_SIZE * i; strings.emplace_back(source.substr(start, LIMIT_PARCEL_SIZE)); @@ -98,11 +98,11 @@ FormMgrStub::~FormMgrStub() */ int FormMgrStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - APP_LOGI("FormMgrStub::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); + HILOG_INFO("FormMgrStub::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); std::u16string descriptor = FormMgrStub::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { - APP_LOGE("%{public}s failed, local descriptor is not equal to remote", __func__); + HILOG_ERROR("%{public}s failed, local descriptor is not equal to remote", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } @@ -126,13 +126,13 @@ int32_t FormMgrStub::HandleAddForm(MessageParcel &data, MessageParcel &reply) int64_t formId = data.ReadInt64(); std::unique_ptr want(data.ReadParcelable()); if (!want) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } sptr client = data.ReadParcelable(); if (client == nullptr) { - APP_LOGE("%{public}s, failed to RemoteObject invalidate", __func__); + HILOG_ERROR("%{public}s, failed to RemoteObject invalidate", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -223,7 +223,7 @@ int32_t FormMgrStub::HandleLifecycleUpdate(MessageParcel &data, MessageParcel &r } sptr client = data.ReadParcelable(); if (client == nullptr) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } int32_t updateType = data.ReadInt32(); @@ -239,19 +239,19 @@ int32_t FormMgrStub::HandleLifecycleUpdate(MessageParcel &data, MessageParcel &r */ int32_t FormMgrStub::HandleRequestForm(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int64_t formId = data.ReadInt64(); sptr client = data.ReadParcelable(); if (client == nullptr) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } std::unique_ptr want(data.ReadParcelable()); if (!want) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -317,7 +317,7 @@ int32_t FormMgrStub::HandleDumpStorageFormInfos(MessageParcel &data, MessageParc std::vector dumpInfos; SplitString(formInfos, dumpInfos); if (!reply.WriteStringVector(dumpInfos)) { - APP_LOGE("%{public}s, failed to WriteStringVector", __func__); + HILOG_ERROR("%{public}s, failed to WriteStringVector", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } } @@ -337,11 +337,11 @@ int32_t FormMgrStub::HandleDumpFormInfoByBundleName(MessageParcel &data, Message int32_t result = DumpFormInfoByBundleName(bundleName, formInfos); reply.WriteInt32(result); if (result == ERR_OK) { - APP_LOGD("%{public}s, formInfos: %{public}s", __func__, formInfos.c_str()); + HILOG_DEBUG("%{public}s, formInfos: %{public}s", __func__, formInfos.c_str()); std::vector dumpInfos; SplitString(formInfos, dumpInfos); if (!reply.WriteStringVector(dumpInfos)) { - APP_LOGE("%{public}s, failed to WriteStringVector", __func__); + HILOG_ERROR("%{public}s, failed to WriteStringVector", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } } @@ -364,7 +364,7 @@ int32_t FormMgrStub::HandleDumpFormInfoByFormId(MessageParcel &data, MessageParc std::vector dumpInfos; SplitString(formInfo, dumpInfos); if (!reply.WriteStringVector(dumpInfos)) { - APP_LOGE("%{public}s, failed to WriteStringVector", __func__); + HILOG_ERROR("%{public}s, failed to WriteStringVector", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } } @@ -386,7 +386,7 @@ int32_t FormMgrStub::HandleDumpFormTimerByFormId(MessageParcel &data, MessagePar std::vector dumpInfos; SplitString(isTimingService, dumpInfos); if (!reply.WriteStringVector(dumpInfos)) { - APP_LOGE("%{public}s, failed to WriteStringVector", __func__); + HILOG_ERROR("%{public}s, failed to WriteStringVector", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } } @@ -401,17 +401,17 @@ int32_t FormMgrStub::HandleDumpFormTimerByFormId(MessageParcel &data, MessagePar */ int32_t FormMgrStub::HandleMessageEvent(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int64_t formId = data.ReadInt64(); std::unique_ptr want(data.ReadParcelable()); if (!want) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } sptr client = data.ReadParcelable(); if (client == nullptr) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -428,10 +428,10 @@ int32_t FormMgrStub::HandleMessageEvent(MessageParcel &data, MessageParcel &repl */ int32_t FormMgrStub::HandleBatchAddFormRecords(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::unique_ptr want(data.ReadParcelable()); if (!want) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -448,7 +448,7 @@ int32_t FormMgrStub::HandleBatchAddFormRecords(MessageParcel &data, MessageParce */ int32_t FormMgrStub::HandleClearFormRecords(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int32_t result = ClearFormRecords(); reply.WriteInt32(result); return result; @@ -462,11 +462,11 @@ int32_t FormMgrStub::HandleClearFormRecords(MessageParcel &data, MessageParcel & */ int32_t FormMgrStub::HandleDistributedDataAddForm(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::unique_ptr want(data.ReadParcelable()); if (!want) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -483,11 +483,11 @@ int32_t FormMgrStub::HandleDistributedDataAddForm(MessageParcel &data, MessagePa */ int32_t FormMgrStub::HandleDistributedDataDeleteForm(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::string formId = data.ReadString(); if (formId.empty()) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -504,13 +504,13 @@ int32_t FormMgrStub::HandleDistributedDataDeleteForm(MessageParcel &data, Messag */ int32_t FormMgrStub::HandleGetAllFormsInfo(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::vector infos; int32_t result = GetAllFormsInfo(infos); reply.WriteInt32(result); if (result == ERR_OK) { if (!WriteParcelableVector(infos, reply)) { - APP_LOGE("write failed"); + HILOG_ERROR("write failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } } @@ -525,14 +525,14 @@ int32_t FormMgrStub::HandleGetAllFormsInfo(MessageParcel &data, MessageParcel &r */ int32_t FormMgrStub::HandleGetFormsInfoByApp(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::string bundleName = data.ReadString(); std::vector infos; int32_t result = GetFormsInfoByApp(bundleName, infos); reply.WriteInt32(result); if (result == ERR_OK) { if (!WriteParcelableVector(infos, reply)) { - APP_LOGE("write failed"); + HILOG_ERROR("write failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } } @@ -547,7 +547,7 @@ int32_t FormMgrStub::HandleGetFormsInfoByApp(MessageParcel &data, MessageParcel */ int32_t FormMgrStub::HandleGetFormsInfoByModule(MessageParcel &data, MessageParcel &reply) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::string bundleName = data.ReadString(); std::string moduleName = data.ReadString(); std::vector infos; @@ -555,7 +555,7 @@ int32_t FormMgrStub::HandleGetFormsInfoByModule(MessageParcel &data, MessageParc reply.WriteInt32(result); if (result == ERR_OK) { if (!WriteParcelableVector(infos, reply)) { - APP_LOGE("write failed"); + HILOG_ERROR("write failed"); return ERR_APPEXECFWK_PARCEL_ERROR; } } @@ -572,13 +572,13 @@ template bool FormMgrStub::WriteParcelableVector(std::vector &parcelableVector, Parcel &reply) { if (!reply.WriteInt32(parcelableVector.size())) { - APP_LOGE("write ParcelableVector failed"); + HILOG_ERROR("write ParcelableVector failed"); return false; } for (auto &parcelable: parcelableVector) { if (!reply.WriteParcelable(&parcelable)) { - APP_LOGE("write ParcelableVector failed"); + HILOG_ERROR("write ParcelableVector failed"); return false; } } diff --git a/interfaces/innerkits/form_manager/src/form_provider_proxy.cpp b/interfaces/innerkits/form_manager/src/form_provider_proxy.cpp index 5aee19cf26..5dc73b8499 100644 --- a/interfaces/innerkits/form_manager/src/form_provider_proxy.cpp +++ b/interfaces/innerkits/form_manager/src/form_provider_proxy.cpp @@ -36,20 +36,20 @@ int FormProviderProxy::AcquireProviderFormInfo( MessageOption option; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(formId)) { - APP_LOGE("%{public}s fail, write want error", __func__); + HILOG_ERROR("%{public}s fail, write want error", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(&want)) { - APP_LOGE("%{public}s, failed to write want", __func__); + HILOG_ERROR("%{public}s, failed to write want", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(callerToken)) { - APP_LOGE("%{public}s, failed to write callerToken", __func__); + HILOG_ERROR("%{public}s, failed to write callerToken", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -59,7 +59,7 @@ int FormProviderProxy::AcquireProviderFormInfo( reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return error; } return ERR_OK; @@ -80,19 +80,19 @@ int FormProviderProxy::NotifyFormDelete(const int64_t formId, const Want &want, MessageOption option; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(formId)) { - APP_LOGE("%{public}s, failed to write formId", __func__); + HILOG_ERROR("%{public}s, failed to write formId", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(&want)) { - APP_LOGE("%{public}s, failed to write want", __func__); + HILOG_ERROR("%{public}s, failed to write want", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(callerToken)) { - APP_LOGE("%{public}s, failed to write callerToken", __func__); + HILOG_ERROR("%{public}s, failed to write callerToken", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -102,7 +102,7 @@ int FormProviderProxy::NotifyFormDelete(const int64_t formId, const Want &want, reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return error; } return ERR_OK; @@ -125,19 +125,19 @@ int FormProviderProxy::NotifyFormsDelete( MessageOption option; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64Vector(formIds)) { - APP_LOGE("%{public}s, failed to write formIds", __func__); + HILOG_ERROR("%{public}s, failed to write formIds", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(&want)) { - APP_LOGE("%{public}s, failed to write want", __func__); + HILOG_ERROR("%{public}s, failed to write want", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(callerToken)) { - APP_LOGE("%{public}s, failed to write callerToken", __func__); + HILOG_ERROR("%{public}s, failed to write callerToken", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -147,7 +147,7 @@ int FormProviderProxy::NotifyFormsDelete( reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return error; } return ERR_OK; @@ -168,21 +168,21 @@ int FormProviderProxy::NotifyFormUpdate(const int64_t formId, const Want &want, MessageOption option; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token.", __func__); + HILOG_ERROR("%{public}s, failed to write interface token.", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(formId)) { - APP_LOGE("%{public}s, failed to write formId.", __func__); + HILOG_ERROR("%{public}s, failed to write formId.", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(&want)) { - APP_LOGE("%{public}s, failed to write want.", __func__); + HILOG_ERROR("%{public}s, failed to write want.", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(callerToken)) { - APP_LOGE("%{public}s, failed to write callerToken.", __func__); + HILOG_ERROR("%{public}s, failed to write callerToken.", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -192,7 +192,7 @@ int FormProviderProxy::NotifyFormUpdate(const int64_t formId, const Want &want, reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return error; } return ERR_OK; @@ -216,27 +216,27 @@ int FormProviderProxy::EventNotify(const std::vector &formIds, const in MessageOption option; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token.", __func__); + HILOG_ERROR("%{public}s, failed to write interface token.", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64Vector(formIds)) { - APP_LOGE("%{public}s, failed to write formIds.", __func__); + HILOG_ERROR("%{public}s, failed to write formIds.", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt32(formVisibleType)) { - APP_LOGE("%{public}s, failed to write formVisibleType.", __func__); + HILOG_ERROR("%{public}s, failed to write formVisibleType.", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(&want)) { - APP_LOGE("%{public}s, failed to write want.", __func__); + HILOG_ERROR("%{public}s, failed to write want.", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(callerToken)) { - APP_LOGE("%{public}s, failed to write callerToken.", __func__); + HILOG_ERROR("%{public}s, failed to write callerToken.", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -246,7 +246,7 @@ int FormProviderProxy::EventNotify(const std::vector &formIds, const in reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return error; } return ERR_OK; @@ -270,20 +270,20 @@ int FormProviderProxy::NotifyFormCastTempForm( MessageOption option; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(formId)) { - APP_LOGE("%{public}s, failed to write formId", __func__); + HILOG_ERROR("%{public}s, failed to write formId", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(&want)) { - APP_LOGE("%{public}s, failed to write want", __func__); + HILOG_ERROR("%{public}s, failed to write want", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(callerToken)) { - APP_LOGE("%{public}s, failed to write callerToken", __func__); + HILOG_ERROR("%{public}s, failed to write callerToken", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -293,7 +293,7 @@ int FormProviderProxy::NotifyFormCastTempForm( reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return error; } return ERR_OK; @@ -315,23 +315,23 @@ int FormProviderProxy::FireFormEvent( { MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(formId)) { - APP_LOGE("%{public}s, failed to write formId", __func__); + HILOG_ERROR("%{public}s, failed to write formId", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteString(message)) { - APP_LOGE("%{public}s, failed to write message", __func__); + HILOG_ERROR("%{public}s, failed to write message", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(&want)) { - APP_LOGE("%{public}s, failed to write want", __func__); + HILOG_ERROR("%{public}s, failed to write want", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(callerToken)) { - APP_LOGE("%{public}s, failed to write callerToken", __func__); + HILOG_ERROR("%{public}s, failed to write callerToken", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } MessageParcel reply; @@ -342,7 +342,7 @@ int FormProviderProxy::FireFormEvent( reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return error; } return ERR_OK; @@ -355,19 +355,19 @@ int FormProviderProxy::GetParcelableInfos(MessageParcel &reply, std::vector for (int32_t i = 0; i < infoSize; i++) { std::unique_ptr info(reply.ReadParcelable()); if (!info) { - APP_LOGE("%{public}s, failed to Read Parcelable infos", __func__); + HILOG_ERROR("%{public}s, failed to Read Parcelable infos", __func__); return ERR_NULL_OBJECT; } parcelableInfos.emplace_back(*info); } - APP_LOGI("%{public}s, get parcelable infos success", __func__); + HILOG_INFO("%{public}s, get parcelable infos success", __func__); return ERR_OK; } bool FormProviderProxy::WriteInterfaceToken(MessageParcel &data) { if (!data.WriteInterfaceToken(FormProviderProxy::GetDescriptor())) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return false; } return true; diff --git a/interfaces/innerkits/form_manager/src/form_provider_stub.cpp b/interfaces/innerkits/form_manager/src/form_provider_stub.cpp index 5577337a20..aae547f49c 100644 --- a/interfaces/innerkits/form_manager/src/form_provider_stub.cpp +++ b/interfaces/innerkits/form_manager/src/form_provider_stub.cpp @@ -13,10 +13,10 @@ * limitations under the License. */ #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "app_scheduler_interface.h" #include "errors.h" #include "form_provider_stub.h" +#include "hilog_wrapper.h" #include "ipc_skeleton.h" #include "ipc_types.h" #include "iremote_object.h" @@ -54,11 +54,11 @@ FormProviderStub::~FormProviderStub() */ int FormProviderStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - APP_LOGI("FormProviderStub::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); + HILOG_INFO("FormProviderStub::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); std::u16string descriptor = FormProviderStub::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { - APP_LOGE("%{public}s failed, local descriptor is not equal to remote", __func__); + HILOG_ERROR("%{public}s failed, local descriptor is not equal to remote", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } @@ -83,13 +83,13 @@ int FormProviderStub::HandleAcquireProviderFormInfo(MessageParcel &data, Message int64_t formId = data.ReadInt64(); std::unique_ptr want(data.ReadParcelable()); if (!want) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } sptr client = data.ReadParcelable(); if (client == nullptr) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -108,13 +108,13 @@ int FormProviderStub::HandleNotifyFormDelete(MessageParcel &data, MessageParcel int64_t formId = data.ReadInt64(); std::unique_ptr want(data.ReadParcelable()); if (!want) { - APP_LOGE("%{public}s fail, ReadParcelable failed", __func__); + HILOG_ERROR("%{public}s fail, ReadParcelable failed", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } sptr client = data.ReadParcelable(); if (client == nullptr) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -135,13 +135,13 @@ int FormProviderStub::HandleNotifyFormsDelete(MessageParcel &data, MessageParcel if (ret) { std::unique_ptr want(data.ReadParcelable()); if (!want) { - APP_LOGE("%{public}s fail, ReadParcelable failed", __func__); + HILOG_ERROR("%{public}s fail, ReadParcelable failed", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } sptr client = data.ReadParcelable(); if (client == nullptr) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -164,13 +164,13 @@ int FormProviderStub::HandleNotifyFormUpdate(MessageParcel &data, MessageParcel std::unique_ptr want(data.ReadParcelable()); if (!want) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } sptr client = data.ReadParcelable(); if (client == nullptr) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -194,13 +194,13 @@ int FormProviderStub::HandleEventNotify(MessageParcel &data, MessageParcel &repl std::unique_ptr want(data.ReadParcelable()); if (!want) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } sptr client = data.ReadParcelable(); if (client == nullptr) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -224,13 +224,13 @@ int FormProviderStub::HandleNotifyFormCastTempForm(MessageParcel &data, MessageP std::unique_ptr want(data.ReadParcelable()); if (!want) { - APP_LOGE("%{public}s fail, ReadParcelable failed", __func__); + HILOG_ERROR("%{public}s fail, ReadParcelable failed", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } sptr client = data.ReadParcelable(); if (client == nullptr) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -250,13 +250,13 @@ int FormProviderStub::HandleFireFormEvent(MessageParcel &data, MessageParcel &re std::string message = data.ReadString(); std::unique_ptr want(data.ReadParcelable()); if (!want) { - APP_LOGE("%{public}s fail, ReadParcelable failed", __func__); + HILOG_ERROR("%{public}s fail, ReadParcelable failed", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } sptr client = data.ReadParcelable(); if (client == nullptr) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } diff --git a/interfaces/innerkits/form_manager/src/form_supply_proxy.cpp b/interfaces/innerkits/form_manager/src/form_supply_proxy.cpp index 5f972b44cf..5993db4b6e 100644 --- a/interfaces/innerkits/form_manager/src/form_supply_proxy.cpp +++ b/interfaces/innerkits/form_manager/src/form_supply_proxy.cpp @@ -30,17 +30,17 @@ int FormSupplyProxy::OnAcquire(const FormProviderInfo &formInfo, const Want& wan { MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to WriteInterfaceToken", __func__); + HILOG_ERROR("%{public}s, failed to WriteInterfaceToken", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(&want)) { - APP_LOGE("%{public}s, failed to write want", __func__); + HILOG_ERROR("%{public}s, failed to write want", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (want.GetIntParam(Constants::PROVIDER_FLAG, ERR_OK) == ERR_OK) { if (!data.WriteParcelable(&formInfo)) { - APP_LOGE("%{public}s, failed to write formInfo", __func__); + HILOG_ERROR("%{public}s, failed to write formInfo", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } } @@ -53,7 +53,7 @@ int FormSupplyProxy::OnAcquire(const FormProviderInfo &formInfo, const Want& wan reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); } return error; } @@ -69,12 +69,12 @@ int FormSupplyProxy::OnEventHandle(const Want& want) MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteParcelable(&want)) { - APP_LOGE("%{public}s, failed to write want", __func__); + HILOG_ERROR("%{public}s, failed to write want", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -86,7 +86,7 @@ int FormSupplyProxy::OnEventHandle(const Want& want) reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); } return error; } @@ -98,19 +98,19 @@ int FormSupplyProxy::GetParcelableInfos(MessageParcel &reply, std::vector &p for (int32_t i = 0; i < infoSize; i++) { std::unique_ptr info(reply.ReadParcelable()); if (!info) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); return ERR_INVALID_VALUE; } parcelableInfos.emplace_back(*info); } - APP_LOGI("get parcelable infos success"); + HILOG_INFO("get parcelable infos success"); return ERR_OK; } bool FormSupplyProxy::WriteInterfaceToken(MessageParcel &data) { if (!data.WriteInterfaceToken(FormSupplyProxy::GetDescriptor())) { - APP_LOGE("%{public}s, failed to write interface token failed", __func__); + HILOG_ERROR("%{public}s, failed to write interface token failed", __func__); return false; } return true; diff --git a/interfaces/innerkits/form_manager/src/form_supply_stub.cpp b/interfaces/innerkits/form_manager/src/form_supply_stub.cpp index d90492e1f0..fbebe28689 100644 --- a/interfaces/innerkits/form_manager/src/form_supply_stub.cpp +++ b/interfaces/innerkits/form_manager/src/form_supply_stub.cpp @@ -14,9 +14,9 @@ */ #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "form_constants.h" #include "form_supply_stub.h" +#include "hilog_wrapper.h" #include "ipc_skeleton.h" #include "ipc_types.h" #include "iremote_object.h" @@ -44,11 +44,11 @@ FormSupplyStub::~FormSupplyStub() */ int FormSupplyStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) { - APP_LOGI("FormSupplyStub::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); + HILOG_INFO("FormSupplyStub::OnReceived, code = %{public}d, flags= %{public}d.", code, option.GetFlags()); std::u16string descriptor = FormSupplyStub::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { - APP_LOGE("%{public}s failed, local descriptor is not equal to remote", __func__); + HILOG_ERROR("%{public}s failed, local descriptor is not equal to remote", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } @@ -72,7 +72,7 @@ int FormSupplyStub::HandleOnAcquire(MessageParcel &data, MessageParcel &reply) { std::unique_ptr want(data.ReadParcelable()); if (!want) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); reply.WriteInt32(ERR_APPEXECFWK_PARCEL_ERROR); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -81,12 +81,12 @@ int FormSupplyStub::HandleOnAcquire(MessageParcel &data, MessageParcel &reply) do { errCode = want->GetIntParam(Constants::PROVIDER_FLAG, ERR_OK); if (errCode != ERR_OK) { - APP_LOGE("%{public}s, provider error", __func__); + HILOG_ERROR("%{public}s, provider error", __func__); break; } std::unique_ptr formInfo(data.ReadParcelable()); if (formInfo == nullptr) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); errCode = ERR_APPEXECFWK_PARCEL_ERROR; break; } @@ -111,7 +111,7 @@ int FormSupplyStub::HandleOnEventHandle(MessageParcel &data, MessageParcel &repl { std::unique_ptr want(data.ReadParcelable()); if (!want) { - APP_LOGE("%{public}s, failed to ReadParcelable", __func__); + HILOG_ERROR("%{public}s, failed to ReadParcelable", __func__); reply.WriteInt32(ERR_APPEXECFWK_PARCEL_ERROR); return ERR_APPEXECFWK_PARCEL_ERROR; } diff --git a/interfaces/innerkits/form_manager/src/provider_connect_proxy.cpp b/interfaces/innerkits/form_manager/src/provider_connect_proxy.cpp index 14cf4a2ebc..a877797eca 100644 --- a/interfaces/innerkits/form_manager/src/provider_connect_proxy.cpp +++ b/interfaces/innerkits/form_manager/src/provider_connect_proxy.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "message_parcel.h" #include "provider_connect_proxy.h" @@ -30,7 +30,7 @@ namespace AppExecFwk { void ProviderConnectProxy::OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) { - APP_LOGD("%{public}s, abilityName:%{public}s,resultCode:%{public}d", + HILOG_DEBUG("%{public}s, abilityName:%{public}s,resultCode:%{public}d", __func__, element.GetAbilityName().c_str(), resultCode); int error; MessageParcel data; @@ -38,28 +38,28 @@ void ProviderConnectProxy::OnAbilityConnectDone( MessageOption option; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return; } if (!data.WriteParcelable(&element)) { - APP_LOGE("%{public}s, failed to write element", __func__); + HILOG_ERROR("%{public}s, failed to write element", __func__); return; } if (!data.WriteRemoteObject(remoteObject)) { - APP_LOGE("%{public}s, failed to write remote object ", __func__); + HILOG_ERROR("%{public}s, failed to write remote object ", __func__); return; } if (!data.WriteInt32(resultCode)) { - APP_LOGE("%{public}s, failed to write resultCode", __func__); + HILOG_ERROR("%{public}s, failed to write resultCode", __func__); return; } error = Remote()->SendRequest(IAbilityConnection::ON_ABILITY_CONNECT_DONE, data, reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return; } } @@ -70,28 +70,29 @@ void ProviderConnectProxy::OnAbilityConnectDone( */ void ProviderConnectProxy::OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) { - APP_LOGD("%{public}s, element:%{public}s, resultCode:%{public}d", __func__, element.GetURI().c_str(), resultCode); + HILOG_DEBUG( + "%{public}s, element:%{public}s, resultCode:%{public}d", __func__, element.GetURI().c_str(), resultCode); int error; MessageParcel data; MessageParcel reply; MessageOption option; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return; } if (!data.WriteParcelable(&element)) { - APP_LOGE("%{public}s, failed to write element", __func__); + HILOG_ERROR("%{public}s, failed to write element", __func__); return; } if (!data.WriteInt32(resultCode)) { - APP_LOGE("%{public}s, failed to write resultCode", __func__); + HILOG_ERROR("%{public}s, failed to write resultCode", __func__); return; } error = Remote()->SendRequest(IAbilityConnection::ON_ABILITY_DISCONNECT_DONE, data, reply, option); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d", __func__, error); return; } } @@ -99,7 +100,7 @@ void ProviderConnectProxy::OnAbilityDisconnectDone(const AppExecFwk::ElementName bool ProviderConnectProxy::WriteInterfaceToken(MessageParcel &data) { if (!data.WriteInterfaceToken(ProviderConnectProxy::GetDescriptor())) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return false; } return true; diff --git a/interfaces/innerkits/form_manager/src/provider_connect_stub.cpp b/interfaces/innerkits/form_manager/src/provider_connect_stub.cpp index d925c349a3..3c05d473a1 100644 --- a/interfaces/innerkits/form_manager/src/provider_connect_stub.cpp +++ b/interfaces/innerkits/form_manager/src/provider_connect_stub.cpp @@ -15,7 +15,7 @@ */ #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "message_parcel.h" #include "provider_connect_stub.h" @@ -35,7 +35,7 @@ int ProviderConnectStub::OnRemoteRequest( std::u16string descriptor = ProviderConnectStub::GetDescriptor(); std::u16string remoteDescriptor = data.ReadInterfaceToken(); if (descriptor != remoteDescriptor) { - APP_LOGI("%{public}s failed, local descriptor is not equal to remote", __func__); + HILOG_INFO("%{public}s failed, local descriptor is not equal to remote", __func__); return ERR_INVALID_STATE; } @@ -43,7 +43,7 @@ int ProviderConnectStub::OnRemoteRequest( switch (code) { case IAbilityConnection::ON_ABILITY_CONNECT_DONE: { if (element == nullptr) { - APP_LOGE("%{public}s failed, callback stub receive element is nullptr", __func__); + HILOG_ERROR("%{public}s failed, callback stub receive element is nullptr", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } auto remoteObject = data.ReadRemoteObject(); @@ -54,7 +54,7 @@ int ProviderConnectStub::OnRemoteRequest( } case IAbilityConnection::ON_ABILITY_DISCONNECT_DONE: { if (element == nullptr) { - APP_LOGE("%{public}s failed, callback stub receive element is nullptr", __func__); + HILOG_ERROR("%{public}s failed, callback stub receive element is nullptr", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } auto resultCode = data.ReadInt32(); diff --git a/interfaces/innerkits/intent/BUILD.gn b/interfaces/innerkits/intent/BUILD.gn index 515618edde..331e197f12 100644 --- a/interfaces/innerkits/intent/BUILD.gn +++ b/interfaces/innerkits/intent/BUILD.gn @@ -15,14 +15,13 @@ import("//build/ohos.gni") config("intent_config") { visibility = [ ":*" ] - include_dirs = [ "//sdk/appexecfwk/appexecfwk_base/include" ] cflags = [] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } defines = [ - "APP_LOG_TAG = \"Ability\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"Ability\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } @@ -32,6 +31,7 @@ config("intent_public_config") { "//utils/native/base/include", "//foundation/aafwk/standard/interfaces/innerkits/intent/include", "//foundation/aafwk/standard/interfaces/innerkits/uri/include", + "//foundation/aafwk/standard/services/common/include", "//foundation/appexecfwk/standard/common/log/include", ] } @@ -51,19 +51,17 @@ ohos_shared_library("intent") { #"${intentImpl}/want.cpp", ] - deps = [ - "//foundation/aafwk/standard/interfaces/innerkits/base:base", - "//foundation/aafwk/standard/interfaces/innerkits/want:want", - "//foundation/appexecfwk/standard/common:libappexecfwk_common", - "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", - "//foundation/distributedschedule/samgr/interfaces/innerkits/lsamgr:lsamgr", - "//utils/native/base:utils", - ] + deps = [ "//foundation/appexecfwk/standard/common:libappexecfwk_common" ] external_deps = [ + "ability_base:base", + "ability_base:want", "ability_base:zuri", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "safwk:system_ability_fwk", + "samgr_standard:lsamgr", + "utils_base:utils", ] configs = [ ":intent_config" ] diff --git a/interfaces/innerkits/log/include/ability_base_log_wrapper.h b/interfaces/innerkits/log/include/ability_base_log_wrapper.h new file mode 100644 index 0000000000..724f227584 --- /dev/null +++ b/interfaces/innerkits/log/include/ability_base_log_wrapper.h @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ABILITYBASE_HILOG_WRAPPER_H +#define ABILITYBASE_HILOG_WRAPPER_H + +#define ABILITYBASE_CONFIG_HILOG +#ifdef ABILITYBASE_CONFIG_HILOG +#include "hilog/log.h" + +#ifdef ABILITYBASE_LOGF +#undef ABILITYBASE_LOGF +#endif + +#ifdef ABILITYBASE_LOGE +#undef ABILITYBASE_LOGE +#endif + +#ifdef ABILITYBASE_LOGW +#undef ABILITYBASE_LOGW +#endif + +#ifdef ABILITYBASE_LOGI +#undef ABILITYBASE_LOGI +#endif + +#ifdef ABILITYBASE_LOGD +#undef ABILITYBASE_LOGD +#endif + +#ifndef ABILITYBASE_LOG_DOMAIN +#define ABILITYBASE_LOG_DOMAIN 0xD002200 +#endif + +#ifndef ABILITYBASE_LOG_TAG +#define ABILITYBASE_LOG_TAG "AbilityBase" +#endif + +#ifdef ABILITYBASE_LOG_LABEL +#undef ABILITYBASE_LOG_LABEL +#endif + +static constexpr OHOS::HiviewDFX::HiLogLabel ABILITYBASE_LOG_LABEL = { + LOG_CORE, ABILITYBASE_LOG_DOMAIN, ABILITYBASE_LOG_TAG}; + +#define __FILENAME__ (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__) + +#define ABILITYBASE_LOGF(fmt, ...) \ + (void)OHOS::HiviewDFX::HiLog::Fatal(ABILITYBASE_LOG_LABEL, \ + "[%{public}s(%{public}s:%{public}d)]" fmt, \ + __FILENAME__, \ + __FUNCTION__, \ + __LINE__, \ + ##__VA_ARGS__) +#define ABILITYBASE_LOGE(fmt, ...) \ + (void)OHOS::HiviewDFX::HiLog::Error(ABILITYBASE_LOG_LABEL, \ + "[%{public}s(%{public}s:%{public}d)]" fmt, \ + __FILENAME__, \ + __FUNCTION__, \ + __LINE__, \ + ##__VA_ARGS__) +#define ABILITYBASE_LOGW(fmt, ...) \ + (void)OHOS::HiviewDFX::HiLog::Warn(ABILITYBASE_LOG_LABEL, \ + "[%{public}s(%{public}s:%{public}d)]" fmt, \ + __FILENAME__, \ + __FUNCTION__, \ + __LINE__, \ + ##__VA_ARGS__) +#define ABILITYBASE_LOGI(fmt, ...) \ + (void)OHOS::HiviewDFX::HiLog::Info(ABILITYBASE_LOG_LABEL, \ + "[%{public}s(%{public}s:%{public}d)]" fmt, \ + __FILENAME__, \ + __FUNCTION__, \ + __LINE__, \ + ##__VA_ARGS__) +#define ABILITYBASE_LOGD(fmt, ...) \ + (void)OHOS::HiviewDFX::HiLog::Debug(ABILITYBASE_LOG_LABEL, \ + "[%{public}s(%{public}s:%{public}d)]" fmt, \ + __FILENAME__, \ + __FUNCTION__, \ + __LINE__, \ + ##__VA_ARGS__) +#else + +#define ABILITYBASE_LOGF(...) +#define ABILITYBASE_LOGE(...) +#define ABILITYBASE_LOGW(...) +#define ABILITYBASE_LOGI(...) +#define ABILITYBASE_LOGD(...) +#endif // ABILITYBASE_CONFIG_HILOG + +#endif // ABILITYBASE_HILOG_WRAPPER_H \ No newline at end of file diff --git a/interfaces/innerkits/log/include/parcel_macro_base.h b/interfaces/innerkits/log/include/parcel_macro_base.h new file mode 100644 index 0000000000..7b152755b9 --- /dev/null +++ b/interfaces/innerkits/log/include/parcel_macro_base.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_PARCEL_MACRO_BASE_H +#define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_PARCEL_MACRO_BASE_H + +#include "parcel.h" + +#include "ability_base_log_wrapper.h" + +namespace OHOS { +namespace AppExecFwk { +#define READ_PARCEL_AND_RETURN_FALSE_IF_FAIL(type, parcel, data) \ + do { \ + if (!(parcel).Read##type(data)) { \ + ABILITYBASE_LOGE("fail to read %{public}s type from parcel", #type); \ + return false; \ + } \ + } while (0) + +#define WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(type, parcel, data) \ + do { \ + if (!(parcel).Write##type(data)) { \ + ABILITYBASE_LOGE("fail to write %{public}s type into parcel", #type); \ + return false; \ + } \ + } while (0) +} // namespace AppExecFwk +} // namespace OHOS +#endif // FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_PARCEL_MACRO_BASE_H \ No newline at end of file diff --git a/interfaces/innerkits/runtime/BUILD.gn b/interfaces/innerkits/runtime/BUILD.gn index 783614eba4..c1df2a8872 100644 --- a/interfaces/innerkits/runtime/BUILD.gn +++ b/interfaces/innerkits/runtime/BUILD.gn @@ -18,7 +18,7 @@ config("runtime_config") { defines = [ "AMS_LOG_TAG = \"Runtime\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_DOMAIN = 0xD002200", ] if (target_cpu == "arm64") { @@ -30,8 +30,6 @@ config("runtime_config") { "//foundation/aafwk/standard/interfaces/innerkits/base/include", "//foundation/aafwk/standard/interfaces/innerkits/uri/include", "//foundation/aafwk/standard/interfaces/innerkits/want/include/ohos/aafwk/content", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base/include", - "//base/global/resmgr_standard/interfaces/innerkits/include", ] } @@ -59,20 +57,21 @@ ohos_shared_library("runtime") { deps = [ "//ark/js_runtime:libark_jsruntime", "//foundation/ace/ace_engine/frameworks/core:ace_container_scope", - "//foundation/ace/ace_engine/interfaces/innerkits/ace:ace_uicontent", - "//foundation/ace/napi:ace_napi", "//foundation/ace/napi:ace_napi_ark", - "//utils/native/base:utils", ] external_deps = [ "ability_base:configuration", "ability_base:want", "ability_runtime:app_manager", + "ace_engine_standard:ace_uicontent", "bundle_framework:appexecfwk_base", "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "init:libbegetutil", + "napi:ace_napi", + "resmgr_standard:global_resmgr", + "utils_base:utils", ] subsystem_name = "aafwk" diff --git a/interfaces/innerkits/uri_permission/BUILD.gn b/interfaces/innerkits/uri_permission/BUILD.gn index 4a1d751e61..57fc5a8e0e 100644 --- a/interfaces/innerkits/uri_permission/BUILD.gn +++ b/interfaces/innerkits/uri_permission/BUILD.gn @@ -34,9 +34,10 @@ ohos_shared_library("uri_permission_mgr") { "src/uri_permission_manager_stub.cpp", ] - deps = [ "${innerkits_path}/want:want" ] + deps = [] external_deps = [ + "ability_base:want", "ability_base:zuri", "access_token:libaccesstoken_sdk", "hiviewdfx_hilog_native:libhilog", diff --git a/interfaces/innerkits/want/BUILD.gn b/interfaces/innerkits/want/BUILD.gn index ad293a30f0..4206a3a080 100644 --- a/interfaces/innerkits/want/BUILD.gn +++ b/interfaces/innerkits/want/BUILD.gn @@ -21,8 +21,8 @@ config("want_config") { cflags += [ "-DBINDER_IPC_32BIT" ] } defines = [ - "APP_LOG_TAG = \"Ability\"", - "LOG_DOMAIN = 0xD002200", + "ABILITYBASE_LOG_TAG = \"Ability\"", + "ABILITYBASE_LOG_DOMAIN = 0xD002200", ] } @@ -32,9 +32,8 @@ config("want_public_config") { "//utils/native/base/include", "//foundation/aafwk/standard/interfaces/innerkits/want/include", "//foundation/aafwk/standard/interfaces/innerkits/base/include", + "//foundation/aafwk/standard/interfaces/innerkits/log/include", "//foundation/aafwk/standard/interfaces/innerkits/uri/include", - "//foundation/appexecfwk/standard/common/log/include", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base/include", "//foundation/aafwk/standard/interfaces/innerkits/want/include/ohos/aafwk/content", "//foundation/aafwk/standard/frameworks/kits/content/cpp/src", "//third_party/jsoncpp/include", @@ -61,12 +60,13 @@ ohos_shared_library("want") { deps = [ "//foundation/aafwk/standard/interfaces/innerkits/base:base", "//foundation/aafwk/standard/interfaces/innerkits/uri:zuri", - "//foundation/appexecfwk/standard/common:libappexecfwk_common", "//third_party/jsoncpp:jsoncpp", - "//utils/native/base:utils", ] - external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + external_deps = [ + "hiviewdfx_hilog_native:libhilog", + "utils_base:utils", + ] configs = [ ":want_config" ] public_configs = [ ":want_public_config" ] diff --git a/interfaces/innerkits/want/include/ohos/aafwk/content/skills.h b/interfaces/innerkits/want/include/ohos/aafwk/content/skills.h index 4c08fd99ab..35e7d1fbe9 100644 --- a/interfaces/innerkits/want/include/ohos/aafwk/content/skills.h +++ b/interfaces/innerkits/want/include/ohos/aafwk/content/skills.h @@ -21,7 +21,7 @@ #include "want.h" #include "want_params.h" #include "parcel.h" -#include "parcel_macro.h" +#include "parcel_macro_base.h" #include "match_type.h" #include "patterns_matcher.h" #include "uri.h" diff --git a/interfaces/kits/napi/aafwk/abilityManager/BUILD.gn b/interfaces/kits/napi/aafwk/abilityManager/BUILD.gn index 432e438019..47957d314e 100644 --- a/interfaces/kits/napi/aafwk/abilityManager/BUILD.gn +++ b/interfaces/kits/napi/aafwk/abilityManager/BUILD.gn @@ -15,10 +15,8 @@ import("//build/ohos.gni") ohos_shared_library("abilitymanager") { include_dirs = [ - "//foundation/ace/napi/interfaces/kits", "//third_party/node/src", "//foundation/aafwk/standard/services/common/include", - "//foundation/multimedia/image_standard/interfaces/kits/js/common/include/", "//utils/system/safwk/native/include", "./", ] @@ -36,22 +34,20 @@ ohos_shared_library("abilitymanager") { "//foundation/aafwk/standard/interfaces/innerkits/base:base", "//foundation/aafwk/standard/interfaces/innerkits/want:want", "//foundation/aafwk/standard/services/appmgr:libams", - "//foundation/ace/napi:ace_napi", - "//foundation/appexecfwk/standard/common:libappexecfwk_common", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base", - "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler", - "//foundation/appexecfwk/standard/libs/libeventhandler:libeventhandler_target", - "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//foundation/multimedia/image_standard/interfaces/innerkits:image", - "//foundation/multimedia/image_standard/interfaces/innerkits:image_native", - "//utils/native/base:utils", ] external_deps = [ + "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", + "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "multimedia_image_standard:image", + "multimedia_image_standard:image_native", + "napi:ace_napi", + "safwk:system_ability_fwk", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] relative_install_dir = "module/app" diff --git a/interfaces/kits/napi/aafwk/ability_constant/BUILD.gn b/interfaces/kits/napi/aafwk/ability_constant/BUILD.gn index dcc376c115..02fb1707cb 100644 --- a/interfaces/kits/napi/aafwk/ability_constant/BUILD.gn +++ b/interfaces/kits/napi/aafwk/ability_constant/BUILD.gn @@ -20,9 +20,12 @@ ohos_shared_library("abilityconstant_napi") { sources = [ "ability_constant_module.cpp" ] - deps = [ "//utils/native/base:utils" ] + deps = [] - external_deps = [ "napi:ace_napi" ] + external_deps = [ + "napi:ace_napi", + "utils_base:utils", + ] relative_install_dir = "module/application" subsystem_name = "aafwk" diff --git a/interfaces/kits/napi/aafwk/ability_manager/BUILD.gn b/interfaces/kits/napi/aafwk/ability_manager/BUILD.gn index beccfb4535..b3aa8cd010 100644 --- a/interfaces/kits/napi/aafwk/ability_manager/BUILD.gn +++ b/interfaces/kits/napi/aafwk/ability_manager/BUILD.gn @@ -27,34 +27,33 @@ ohos_shared_library("abilitymanager_napi") { include_dirs = [ "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/ability_manager", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common", - "//base/global/resmgr_standard/interfaces/innerkits/include", "//third_party/icu/icu4c/source/common", "//foundation/aafwk/standard/frameworks/kits/ability/native/include/continuation/kits", - "//foundation/communication/ipc/ipc/native/src/napi/include", ] deps = [ - "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", - "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", - "//foundation/aafwk/standard/interfaces/innerkits/base:base", - "//foundation/aafwk/standard/interfaces/innerkits/want:want", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common:napi_common", "//foundation/aafwk/standard/services/abilitymgr:abilityms", - "//foundation/ace/napi:ace_napi", - "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler", - "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//utils/native/base:utils", ] external_deps = [ + "ability_base:base", + "ability_base:configuration", "ability_base:want", "ability_runtime:ability_manager", + "ability_runtime:abilitykit_native", + "ability_runtime:app_manager", "ability_runtime:runtime", "bundle_framework:appexecfwk_base", + "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "ipc_js:rpc", + "napi:ace_napi", + "resmgr_standard:global_resmgr", + "safwk:system_ability_fwk", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] relative_install_dir = "module/application" diff --git a/interfaces/kits/napi/aafwk/app/ability_delegator/BUILD.gn b/interfaces/kits/napi/aafwk/app/ability_delegator/BUILD.gn index 06853c2562..78ba8c79bb 100644 --- a/interfaces/kits/napi/aafwk/app/ability_delegator/BUILD.gn +++ b/interfaces/kits/napi/aafwk/app/ability_delegator/BUILD.gn @@ -16,8 +16,6 @@ import("//build/ohos.gni") ohos_shared_library("abilitydelegatorregistry") { include_dirs = [ "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common/", - "//foundation/communication/ipc/ipc/native/src/napi/include/", - "//foundation/ace/napi/native_engine/", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/app/ability_delegator/", "//foundation/aafwk/standard/frameworks/kits/appkit/native/ability_delegator/include/", ] @@ -34,20 +32,21 @@ ohos_shared_library("abilitydelegatorregistry") { configs = [ "//foundation/aafwk/standard/services/common:common_config" ] deps = [ - "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/appkit:app_context", "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_delegator", - "//foundation/aafwk/standard/interfaces/innerkits/ability_manager:ability_manager", - "//foundation/aafwk/standard/interfaces/innerkits/base:base", ] external_deps = [ + "ability_base:base", + "ability_runtime:ability_manager", + "ability_runtime:abilitykit_native", "ability_runtime:runtime", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "ipc_js:rpc", + "napi:ace_napi", ] relative_install_dir = "module/application" diff --git a/interfaces/kits/napi/aafwk/app/appMgr/BUILD.gn b/interfaces/kits/napi/aafwk/app/appMgr/BUILD.gn index b5230e0a77..872e4435f7 100644 --- a/interfaces/kits/napi/aafwk/app/appMgr/BUILD.gn +++ b/interfaces/kits/napi/aafwk/app/appMgr/BUILD.gn @@ -15,7 +15,6 @@ import("//build/ohos.gni") ohos_shared_library("napi_app_mgr") { include_dirs = [ - "//foundation/ace/napi/interfaces/kits", "//third_party/node/src", "//foundation/aafwk/standard/services/common/include", "//utils/system/safwk/native/include", @@ -27,24 +26,23 @@ ohos_shared_library("napi_app_mgr") { "native_module.cpp", ] - deps = [ - "//foundation/aafwk/standard/interfaces/innerkits/ability_manager:ability_manager", - "//foundation/aafwk/standard/interfaces/innerkits/base:base", - "//foundation/aafwk/standard/interfaces/innerkits/want:want", - "//foundation/ace/napi:ace_napi", - "//foundation/appexecfwk/standard/common:libappexecfwk_common", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base", - "//foundation/appexecfwk/standard/libs/libeventhandler:libeventhandler_target", - "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//utils/native/base:utils", - ] + deps = [] external_deps = [ + "ability_base:base", + "ability_base:want", + "ability_runtime:ability_manager", "ability_runtime:app_manager", + "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", + "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "multimedia_image_standard:image", + "napi:ace_napi", + "safwk:system_ability_fwk", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] relative_install_dir = "module" diff --git a/interfaces/kits/napi/aafwk/app/app_manager/BUILD.gn b/interfaces/kits/napi/aafwk/app/app_manager/BUILD.gn index 71fbac6053..0b64a54375 100644 --- a/interfaces/kits/napi/aafwk/app/app_manager/BUILD.gn +++ b/interfaces/kits/napi/aafwk/app/app_manager/BUILD.gn @@ -14,10 +14,7 @@ import("//build/ohos.gni") ohos_shared_library("appmanager_napi") { - include_dirs = [ - "//foundation/multimedia/image_standard/interfaces/innerkits/include", - "//foundation/appexecfwk/standard/kits/appkit/napi/app_manager", - ] + include_dirs = [] sources = [ "app_manager_module.cpp", @@ -27,27 +24,24 @@ ohos_shared_library("appmanager_napi") { configs = [ "//foundation/aafwk/standard/services/common:common_config" ] - deps = [ - "//foundation/aafwk/standard/interfaces/innerkits/ability_manager:ability_manager", - "//foundation/aafwk/standard/interfaces/innerkits/base:base", - "//foundation/aafwk/standard/services/abilitymgr:abilityms", - "//foundation/ace/napi:ace_napi", - "//foundation/appexecfwk/standard/common:libappexecfwk_common", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base", - "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler", - "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//utils/native/base:utils", - ] + deps = [ "//foundation/aafwk/standard/services/abilitymgr:abilityms" ] external_deps = [ + "ability_base:base", + "ability_runtime:ability_manager", "ability_runtime:app_manager", "ability_runtime:runtime", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "bundle_framework:appexecfwk_core", + "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "multimedia_image_standard:image", + "napi:ace_napi", + "safwk:system_ability_fwk", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] relative_install_dir = "module/application" diff --git a/interfaces/kits/napi/aafwk/configuration_constant/BUILD.gn b/interfaces/kits/napi/aafwk/configuration_constant/BUILD.gn index f56f62c2ef..f91295f7f1 100644 --- a/interfaces/kits/napi/aafwk/configuration_constant/BUILD.gn +++ b/interfaces/kits/napi/aafwk/configuration_constant/BUILD.gn @@ -14,14 +14,17 @@ import("//build/ohos.gni") ohos_shared_library("configurationconstant_napi") { - include_dirs = - [ "//base/global/resmgr_standard/interfaces/innerkits/include" ] + include_dirs = [] sources = [ "configuration_constant_module.cpp" ] - deps = [ "//utils/native/base:utils" ] + deps = [] - external_deps = [ "napi:ace_napi" ] + external_deps = [ + "napi:ace_napi", + "resmgr_standard:global_resmgr", + "utils_base:utils", + ] relative_install_dir = "module/application" subsystem_name = "aafwk" diff --git a/interfaces/kits/napi/aafwk/dataShare/BUILD.gn b/interfaces/kits/napi/aafwk/dataShare/BUILD.gn index 703af54232..91055a5981 100644 --- a/interfaces/kits/napi/aafwk/dataShare/BUILD.gn +++ b/interfaces/kits/napi/aafwk/dataShare/BUILD.gn @@ -15,7 +15,6 @@ import("//build/ohos.gni") ohos_shared_library("datashare") { include_dirs = [ - "//foundation/ace/napi/interfaces/kits", "//third_party/node/src", "//third_party/libuv/include", "//foundation/aafwk/standard/frameworks/kits/ability/native/include", @@ -36,30 +35,31 @@ ohos_shared_library("datashare") { ] deps = [ - "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_native", - "//foundation/aafwk/standard/interfaces/innerkits/base:base", "//foundation/aafwk/standard/interfaces/innerkits/dataobs_manager:dataobs_manager", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common:napi_common", - "//foundation/ace/napi:ace_napi", "//third_party/libuv:uv_static", - "//utils/native/base:utils", ] external_deps = [ + "ability_base:base", "ability_base:want", "ability_base:zuri", "ability_runtime:ability_manager", + "ability_runtime:abilitykit_native", "ability_runtime:app_manager", "ability_runtime:napi_base_context", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "eventhandler:libeventhandler", + "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "napi:ace_napi", "native_appdatamgr:native_appdatafwk", "native_appdatamgr:native_dataability", "native_appdatamgr:native_rdb", + "utils_base:utils", ] relative_install_dir = "module/data" diff --git a/interfaces/kits/napi/aafwk/dataUriUtils/BUILD.gn b/interfaces/kits/napi/aafwk/dataUriUtils/BUILD.gn index eac9981979..f050a68785 100644 --- a/interfaces/kits/napi/aafwk/dataUriUtils/BUILD.gn +++ b/interfaces/kits/napi/aafwk/dataUriUtils/BUILD.gn @@ -15,11 +15,8 @@ import("//build/ohos.gni") ohos_shared_library("datauriutils") { include_dirs = [ - "//foundation/ace/napi/interfaces/kits", - "//foundation/aafwk/standard/frameworks/kits/ability/native/include", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/dataUriUtils", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/featureAbility", - "//third_party/node/src", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common", ] @@ -29,24 +26,24 @@ ohos_shared_library("datauriutils") { ] deps = [ - "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_native", - "//foundation/aafwk/standard/interfaces/innerkits/base:base", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common:napi_common", - "//foundation/ace/napi:ace_napi", - "//utils/native/base:utils", ] external_deps = [ + "ability_base:base", "ability_base:want", "ability_base:zuri", "ability_runtime:ability_manager", + "ability_runtime:abilitykit_native", "ability_runtime:app_manager", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "napi:ace_napi", + "utils_base:utils", ] relative_install_dir = "module/ability" diff --git a/interfaces/kits/napi/aafwk/featureAbility/BUILD.gn b/interfaces/kits/napi/aafwk/featureAbility/BUILD.gn index ac39ca71e4..ed3cf42777 100644 --- a/interfaces/kits/napi/aafwk/featureAbility/BUILD.gn +++ b/interfaces/kits/napi/aafwk/featureAbility/BUILD.gn @@ -15,10 +15,6 @@ import("//build/ohos.gni") ohos_shared_library("featureability") { include_dirs = [ - "//foundation/ace/napi/interfaces/kits", - "//third_party/node/src", - "//third_party/libuv/include", - "//foundation/aafwk/standard/frameworks/kits/ability/native/include", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/featureAbility", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common", "//foundation/distributeddatamgr/appdatamgr/frameworks/jskitsimpl/napi_rdb/include", @@ -44,21 +40,19 @@ ohos_shared_library("featureability") { ] deps = [ - "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_native", - "//foundation/aafwk/standard/interfaces/innerkits/base:base", "//foundation/aafwk/standard/interfaces/innerkits/dataobs_manager:dataobs_manager", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common:napi_common", - "//foundation/ace/napi:ace_napi", "//third_party/jsoncpp:jsoncpp", "//third_party/libuv:uv_static", - "//utils/native/base:utils", ] external_deps = [ + "ability_base:base", "ability_base:want", "ability_base:zuri", "ability_runtime:ability_manager", + "ability_runtime:abilitykit_native", "ability_runtime:app_manager", "ability_runtime:napi_base_context", "bundle_framework:appexecfwk_base", @@ -66,9 +60,11 @@ ohos_shared_library("featureability") { "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "napi:ace_napi", "native_appdatamgr:native_appdatafwk", "native_appdatamgr:native_dataability", "native_appdatamgr:native_rdb", + "utils_base:utils", #"appdatamgr_jskits:rdb", ] diff --git a/interfaces/kits/napi/aafwk/formManager/BUILD.gn b/interfaces/kits/napi/aafwk/formManager/BUILD.gn index 66a195e5cf..547639631f 100644 --- a/interfaces/kits/napi/aafwk/formManager/BUILD.gn +++ b/interfaces/kits/napi/aafwk/formManager/BUILD.gn @@ -14,32 +14,27 @@ #import("//build/config/ohos/rules.gni") import("//build/ohos.gni") ohos_shared_library("formmanager") { - include_dirs = [ - "//foundation/ace/napi/interfaces/kits", - "//foundation/aafwk/standard/frameworks/kits/ability/native/include", - "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/formManager", - "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", - ] + include_dirs = + [ "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/formManager" ] sources = [ "napi_form_manager.cpp", "native_module.cpp", ] - deps = [ - "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", - "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_native", - "//foundation/aafwk/standard/interfaces/innerkits/base:base", - "//foundation/ace/napi:ace_napi", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base", - ] + deps = [ "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_native" ] external_deps = [ + "ability_base:base", "ability_base:want", "ability_runtime:ability_manager", + "ability_runtime:abilitykit_native", "ability_runtime:runtime", + "bundle_framework:appexecfwk_base", "form_runtime:form_manager", "hiviewdfx_hilog_native:libhilog", + "ipc:ipc_core", + "napi:ace_napi", ] relative_install_dir = "module/ability" diff --git a/interfaces/kits/napi/aafwk/form_binding_data/BUILD.gn b/interfaces/kits/napi/aafwk/form_binding_data/BUILD.gn index c6167e7c36..957e3a623a 100644 --- a/interfaces/kits/napi/aafwk/form_binding_data/BUILD.gn +++ b/interfaces/kits/napi/aafwk/form_binding_data/BUILD.gn @@ -23,10 +23,7 @@ ohos_shared_library("formbindingdata_napi") { configs = [ "//foundation/aafwk/standard/services/common:common_config" ] - deps = [ - "//foundation/ace/napi:ace_napi", - "//utils/native/base:utils", - ] + deps = [] external_deps = [ "ability_runtime:runtime", @@ -35,6 +32,7 @@ ohos_shared_library("formbindingdata_napi") { "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "napi:ace_napi", + "utils_base:utils", ] relative_install_dir = "module/application" diff --git a/interfaces/kits/napi/aafwk/inner/napi_common/BUILD.gn b/interfaces/kits/napi/aafwk/inner/napi_common/BUILD.gn index ca350fbabe..9d48663c73 100644 --- a/interfaces/kits/napi/aafwk/inner/napi_common/BUILD.gn +++ b/interfaces/kits/napi/aafwk/inner/napi_common/BUILD.gn @@ -15,10 +15,8 @@ import("//build/ohos.gni") ohos_shared_library("napi_common") { include_dirs = [ - "//foundation/ace/napi/interfaces/kits", "//third_party/node/src", "//third_party/libuv/include", - "//foundation/aafwk/standard/frameworks/kits/ability/native/include", "//third_party/jsoncpp", "//third_party/jsoncpp/include/json", ] @@ -33,19 +31,17 @@ ohos_shared_library("napi_common") { ] deps = [ - "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_native", - "//foundation/aafwk/standard/interfaces/innerkits/base:base", - "//foundation/ace/napi:ace_napi", "//third_party/jsoncpp:jsoncpp", "//third_party/libuv:uv_static", - "//utils/native/base:utils", ] external_deps = [ + "ability_base:base", "ability_base:configuration", "ability_base:want", "ability_runtime:ability_manager", + "ability_runtime:abilitykit_native", "ability_runtime:app_manager", "ability_runtime:napi_base_context", "ability_runtime:wantagent_innerkits", @@ -55,9 +51,11 @@ ohos_shared_library("napi_common") { "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "ipc_js:rpc", + "napi:ace_napi", "native_appdatamgr:native_appdatafwk", "native_appdatamgr:native_dataability", "native_appdatamgr:native_rdb", + "utils_base:utils", #"samgr_standard:samgr_proxy", ] diff --git a/interfaces/kits/napi/aafwk/mission_manager/BUILD.gn b/interfaces/kits/napi/aafwk/mission_manager/BUILD.gn index 8b50ade163..95957380ce 100644 --- a/interfaces/kits/napi/aafwk/mission_manager/BUILD.gn +++ b/interfaces/kits/napi/aafwk/mission_manager/BUILD.gn @@ -26,36 +26,33 @@ ohos_shared_library("missionmanager_napi") { configs = [ "//foundation/aafwk/standard/services/common:common_config" ] include_dirs = [ - "//foundation/multimedia/image_standard/interfaces/innerkits/include", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common", - "//base/global/resmgr_standard/interfaces/innerkits/include", "//third_party/icu/icu4c/source/common", "//foundation/aafwk/standard/frameworks/kits/ability/native/include/continuation/kits", - "//foundation/communication/ipc/ipc/native/src/napi/include", ] deps = [ - "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", - "//foundation/aafwk/standard/interfaces/innerkits/base:base", "//foundation/aafwk/standard/interfaces/innerkits/want:want", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common:napi_common", "//foundation/aafwk/standard/services/abilitymgr:abilityms", - "//foundation/ace/napi:ace_napi", - "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler", - "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//utils/native/base:utils", ] external_deps = [ + "ability_base:base", "ability_base:want", "ability_runtime:ability_manager", + "ability_runtime:abilitykit_native", "ability_runtime:runtime", "bundle_framework:appexecfwk_base", + "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "ipc_js:rpc", "multimedia_image_standard:image", + "resmgr_standard:global_resmgr", + "safwk:system_ability_fwk", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] relative_install_dir = "module/application" @@ -68,7 +65,6 @@ ohos_shared_library("distributedmissionmanager") { include_dirs = [ "//third_party/libuv/include", "//third_party/node/src", - "//utils/native/base/include", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common/", "//foundation/aafwk/standard/frameworks/kits/ability/native/include", ] @@ -86,23 +82,23 @@ ohos_shared_library("distributedmissionmanager") { ] deps = [ - "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog", - "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/interfaces/innerkits/ability_manager:ability_manager", "//foundation/aafwk/standard/interfaces/innerkits/want:want", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common:napi_common", - "//foundation/ace/napi:ace_napi", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base", - "//utils/native/base:utils", ] external_deps = [ "ability_runtime:app_manager", + "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "hiviewdfx_hilog_native:libhilog", + "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "ipc_js:rpc", + "napi:ace_napi", + "startup_l2:syspara", + "utils_base:utils", ] relative_install_dir = "module" diff --git a/interfaces/kits/napi/aafwk/particleAbility/BUILD.gn b/interfaces/kits/napi/aafwk/particleAbility/BUILD.gn index 4e9493ddac..b0c2d08746 100644 --- a/interfaces/kits/napi/aafwk/particleAbility/BUILD.gn +++ b/interfaces/kits/napi/aafwk/particleAbility/BUILD.gn @@ -15,10 +15,8 @@ import("//build/ohos.gni") ohos_shared_library("particleability") { include_dirs = [ - "//foundation/ace/napi/interfaces/kits", "//third_party/node/src", "//third_party/libuv/include", - "//foundation/aafwk/standard/frameworks/kits/ability/native/include", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/featureAbility", "//foundation/aafwk/standard/services/common/include", @@ -43,21 +41,19 @@ ohos_shared_library("particleability") { ] deps = [ - "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_native", - "//foundation/aafwk/standard/interfaces/innerkits/base:base", "//foundation/aafwk/standard/interfaces/innerkits/dataobs_manager:dataobs_manager", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common:napi_common", - "//foundation/ace/napi:ace_napi", "//third_party/jsoncpp:jsoncpp", "//third_party/libuv:uv_static", - "//utils/native/base:utils", ] external_deps = [ + "ability_base:base", "ability_base:want", "ability_base:zuri", "ability_runtime:ability_manager", + "ability_runtime:abilitykit_native", "ability_runtime:app_manager", "ability_runtime:napi_base_context", "bundle_framework:appexecfwk_base", @@ -65,9 +61,11 @@ ohos_shared_library("particleability") { "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "napi:ace_napi", "native_appdatamgr:native_appdatafwk", "native_appdatamgr:native_dataability", "native_appdatamgr:native_rdb", + "utils_base:utils", ] relative_install_dir = "module/ability" diff --git a/interfaces/kits/napi/aafwk/uri_permission/BUILD.gn b/interfaces/kits/napi/aafwk/uri_permission/BUILD.gn index f168c8f37a..b0c1e502c6 100644 --- a/interfaces/kits/napi/aafwk/uri_permission/BUILD.gn +++ b/interfaces/kits/napi/aafwk/uri_permission/BUILD.gn @@ -26,7 +26,6 @@ ohos_shared_library("uripermissionmanager_napi") { ] deps = [ - "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/interfaces/innerkits/uri_permission:uri_permission_mgr", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common:napi_common", ] @@ -34,6 +33,7 @@ ohos_shared_library("uripermissionmanager_napi") { external_deps = [ "ability_base:zuri", "ability_runtime:ability_manager", + "ability_runtime:abilitykit_native", "ability_runtime:runtime", "bundle_framework:appexecfwk_base", "hiviewdfx_hilog_native:libhilog", diff --git a/interfaces/kits/napi/aafwk/wantConstant/BUILD.gn b/interfaces/kits/napi/aafwk/wantConstant/BUILD.gn index 5662cc289a..554f9c249e 100644 --- a/interfaces/kits/napi/aafwk/wantConstant/BUILD.gn +++ b/interfaces/kits/napi/aafwk/wantConstant/BUILD.gn @@ -15,10 +15,8 @@ import("//build/ohos.gni") ohos_shared_library("wantconstant") { include_dirs = [ - "//foundation/ace/napi/interfaces/kits", "//third_party/node/src", "//third_party/libuv/include", - "//foundation/aafwk/standard/frameworks/kits/ability/native/include", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/wantConstant", ] @@ -28,22 +26,22 @@ ohos_shared_library("wantconstant") { ] deps = [ - "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_native", - "//foundation/aafwk/standard/interfaces/innerkits/base:base", - "//foundation/ace/napi:ace_napi", "//third_party/libuv:uv_static", - "//utils/native/base:utils", ] external_deps = [ + "ability_base:base", "ability_base:want", "ability_runtime:ability_manager", + "ability_runtime:abilitykit_native", "ability_runtime:app_manager", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", + "napi:ace_napi", + "utils_base:utils", ] relative_install_dir = "module/ability" diff --git a/interfaces/kits/napi/aafwk/wantagent/BUILD.gn b/interfaces/kits/napi/aafwk/wantagent/BUILD.gn index 97b4210658..ceb485ac8c 100644 --- a/interfaces/kits/napi/aafwk/wantagent/BUILD.gn +++ b/interfaces/kits/napi/aafwk/wantagent/BUILD.gn @@ -17,13 +17,10 @@ ohos_shared_library("wantagent") { include_dirs = [ "//third_party/node/src", "//foundation/aafwk/standard/services/common/include", - "//utils/system/safwk/native/include", "//third_party/libuv/include", - "//foundation/aafwk/standard/frameworks/kits/ability/native/include", "//foundation/aafwk/standard/frameworks/kits/appkit/native/ability_runtime", "//foundation/aafwk/standard/services/abilitymgr/include", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common", - "//foundation/aafwk/standard/services/common/include", "./", ] @@ -35,14 +32,13 @@ ohos_shared_library("wantagent") { deps = [ "//foundation/aafwk/standard/frameworks/kits/appkit:app_context", "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_native", - "//foundation/aafwk/standard/frameworks/kits/wantagent:wantagent_innerkits", "//foundation/aafwk/standard/interfaces/kits/napi/aafwk/inner/napi_common:napi_common", - "//utils/native/base:utils", ] external_deps = [ "ability_base:want", "ability_runtime:abilitykit_native", + "ability_runtime:wantagent_innerkits", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "eventhandler:libeventhandler", @@ -51,6 +47,7 @@ ohos_shared_library("wantagent") { "napi:ace_napi", "safwk:system_ability_fwk", "samgr_standard:samgr_proxy", + "utils_base:utils", ] relative_install_dir = "module" diff --git a/services/abilitymgr/BUILD.gn b/services/abilitymgr/BUILD.gn index e3a9f0375b..80c7a892cd 100644 --- a/services/abilitymgr/BUILD.gn +++ b/services/abilitymgr/BUILD.gn @@ -78,46 +78,46 @@ ohos_shared_library("abilityms") { configs = [ ":abilityms_config" ] deps = [ - "${innerkits_path}/base:base", - "${innerkits_path}/uri:zuri", "${innerkits_path}/uri_permission:uri_permission_mgr", - "${innerkits_path}/want:want", "${services_path}/common:perm_verification", - "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits", - "//base/global/i18n_standard/frameworks/intl:intl_util", "//base/hiviewdfx/hiview/adapter/utility:hiview_adapter_utility", - "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara", - "//foundation/aafwk/standard/frameworks/kits/ability/ability_runtime:ability_context_native", - "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", - "//foundation/aafwk/standard/interfaces/innerkits/base:base", "//foundation/ace/ace_engine/interfaces/innerkits/ui_service_manager:ui_service_mgr", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base", - "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler", - "//foundation/distributeddatamgr/appdatamgr/interfaces/innerkits/native_dataability:native_dataability", - "//foundation/distributeddatamgr/appdatamgr/interfaces/innerkits/native_rdb:native_rdb", - "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//foundation/multimedia/image_standard/interfaces/innerkits:image_native", "//third_party/libpng:libpng", - "//utils/native/base:utils", ] external_deps = [ + "ability_base:base", + "ability_base:configuration", + "ability_base:want", + "ability_base:zuri", + "ability_runtime:ability_context_native", + "ability_runtime:abilitykit_native", "ability_runtime:app_manager", "access_token:libaccesstoken_sdk", + "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "bytrace_standard:bytrace_core", "ces_standard:cesfwk_core", "ces_standard:cesfwk_innerkits", "device_manager_base:devicemanagersdk", "dsoftbus_standard:softbus_client", + "eventhandler:libeventhandler", "hicollie_native:libhicollie", "hisysevent_native:libhisysevent", "hiviewdfx_hilog_native:libhilog", + "i18n_standard:intl_util", "ipc:ipc_core", + "multimedia_image_standard:image_native", + "native_appdatamgr:native_dataability", + "native_appdatamgr:native_rdb", + "os_account_standard:os_account_innerkits", "os_account_standard:os_account_innerkits", "resmgr_standard:global_resmgr", + "safwk:system_ability_fwk", + "samgr_standard:samgr_proxy", + "startup_l2:syspara", + "utils_base:utils", ] public_deps = [ "//foundation/graphic/standard:libwmservice" ] diff --git a/services/abilitymgr/test/BUILD.gn b/services/abilitymgr/test/BUILD.gn index c361ea488d..7a748e4621 100644 --- a/services/abilitymgr/test/BUILD.gn +++ b/services/abilitymgr/test/BUILD.gn @@ -143,6 +143,7 @@ ohos_source_set("abilityms_test_source") { ] external_deps = [ + "ability_base:configuration", "access_token:libaccesstoken_sdk", "bundle_framework:appexecfwk_core", "bytrace_standard:bytrace_core", diff --git a/services/abilitymgr/test/mock/libs/appexecfwk_core/BUILD.gn b/services/abilitymgr/test/mock/libs/appexecfwk_core/BUILD.gn index 10fe06b3cd..870419171a 100644 --- a/services/abilitymgr/test/mock/libs/appexecfwk_core/BUILD.gn +++ b/services/abilitymgr/test/mock/libs/appexecfwk_core/BUILD.gn @@ -29,6 +29,8 @@ config("appexecfwk_core_mock_config") { "//base/notification/ces_standard/interfaces/innerkits/native/include/", "//foundation/aafwk/standard/services/abilitymgr/test/mock/libs/aakit/include/", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base/include", + "${aafwk_path}/services/common/include", + "//foundation/appexecfwk/standard/common/log/include", ] } diff --git a/services/abilitymgr/test/mock/libs/appexecfwk_core/src/appmgr/app_state_callback_host.cpp b/services/abilitymgr/test/mock/libs/appexecfwk_core/src/appmgr/app_state_callback_host.cpp index f79e2397e6..448db8ed14 100644 --- a/services/abilitymgr/test/mock/libs/appexecfwk_core/src/appmgr/app_state_callback_host.cpp +++ b/services/abilitymgr/test/mock/libs/appexecfwk_core/src/appmgr/app_state_callback_host.cpp @@ -15,7 +15,7 @@ #include "app_state_callback_host.h" #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "iremote_object.h" #include "app_state_callback_proxy.h" @@ -37,12 +37,12 @@ int AppStateCallbackHost::OnRemoteRequest( void AppStateCallbackHost::OnAbilityRequestDone(const sptr &, const AbilityState) { - APP_LOGD("OnAbilityRequestDone called"); + HILOG_DEBUG("OnAbilityRequestDone called"); } void AppStateCallbackHost::OnAppStateChanged(const AppProcessData &) { - APP_LOGD("OnAppStateChanged called"); + HILOG_DEBUG("OnAppStateChanged called"); } int32_t AppStateCallbackHost::HandleOnAppStateChanged(MessageParcel &data, MessageParcel &reply) diff --git a/services/abilitymgr/test/mock/libs/appexecfwk_core/src/appmgr/app_state_callback_proxy.cpp b/services/abilitymgr/test/mock/libs/appexecfwk_core/src/appmgr/app_state_callback_proxy.cpp index 82033a61b9..d84c694b0b 100644 --- a/services/abilitymgr/test/mock/libs/appexecfwk_core/src/appmgr/app_state_callback_proxy.cpp +++ b/services/abilitymgr/test/mock/libs/appexecfwk_core/src/appmgr/app_state_callback_proxy.cpp @@ -15,9 +15,9 @@ #include "app_state_callback_proxy.h" +#include "hilog_wrapper.h" #include "ipc_types.h" -#include "app_log_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/services/abilitymgr/test/unittest/phone/ability_connect_manage_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/ability_connect_manage_test/BUILD.gn index e6d10f5955..a22b1865f3 100644 --- a/services/abilitymgr/test/unittest/phone/ability_connect_manage_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/ability_connect_manage_test/BUILD.gn @@ -46,6 +46,7 @@ ohos_unittest("ability_connect_manage_test") { "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/services/abilitymgr:abilityms", + "//foundation/appexecfwk/standard/common:libappexecfwk_common", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base", "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler", "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", diff --git a/services/abilitymgr/test/unittest/phone/ability_manager_proxy_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/ability_manager_proxy_test/BUILD.gn index 492e1a9d87..d6479fcaf6 100644 --- a/services/abilitymgr/test/unittest/phone/ability_manager_proxy_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/ability_manager_proxy_test/BUILD.gn @@ -23,6 +23,7 @@ ohos_unittest("ability_manager_proxy_test") { "${services_path}/abilitymgr/test/mock/libs/system_ability_mock", "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include", "//foundation/aafwk/standard/services/abilitymgr/test/mock/libs/ability_scheduler_mock", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", ] diff --git a/services/appmgr/BUILD.gn b/services/appmgr/BUILD.gn index 67d2b8951b..4f13b9e476 100644 --- a/services/appmgr/BUILD.gn +++ b/services/appmgr/BUILD.gn @@ -19,14 +19,7 @@ config("appmgr_config") { "include", "${services_path}/common/include", "//base/startup/appspawn_standard/interfaces/innerkits/include", - "//utils/system/safwk/native/include", - "//base/account/os_account/interfaces/innerkits/osaccount/native/include", - "//base/notification/ces_standard/frameworks/core/include", - "//base/notification/ces_standard/interfaces/innerkits/native/include", - "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk/main/cpp/include", - "//base/global/i18n_standard/frameworks/intl/include", "//foundation/aafwk/standard/tools/aa/include", - "//base/hiviewdfx/hicollie/interfaces/native/innerkits/include", ] } @@ -59,46 +52,43 @@ ohos_shared_library("libams") { ] defines = [ - "APP_LOG_TAG = \"AppMgrService\"", - "LOG_DOMAIN = 0xD001110", + "AMS_LOG_TAG = \"AppMgrService\"", + "AMS_LOG_DOMAIN = 0xD001110", ] - configs = [ - ":appmgr_config", - "${appexecfwk_path}/libs/libeventhandler:libeventhandler_config", - "${aafwk_path}/interfaces/innerkits/app_manager:appmgr_sdk_config", - ] + configs = [ ":appmgr_config" ] cflags = [] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ - "${aafwk_path}/interfaces/innerkits/app_manager:app_manager", "${appexecfwk_path}/common:libappexecfwk_common", - "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base:appexecfwk_base", - "${appexecfwk_path}/libs/libeventhandler:libeventhandler_target", "${innerkits_path}/uri_permission:uri_permission_mgr", "${services_path}/common:perm_verification", - "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits", - "//base/global/i18n_standard/frameworks/intl:intl_util", - "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk:libpermissionsdk_standard", - "//foundation/aafwk/standard/interfaces/innerkits/base:base", - "//foundation/aafwk/standard/interfaces/innerkits/want:want", - "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//utils/native/base:utils", ] external_deps = [ + "ability_base:base", + "ability_base:configuration", + "ability_base:want", + "ability_runtime:app_manager", "appspawn:appspawn_socket_client", + "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "bytrace_standard:bytrace_core", "ces_standard:cesfwk_core", "ces_standard:cesfwk_innerkits", + "eventhandler:libeventhandler", "hicollie_native:libhicollie", "hisysevent_native:libhisysevent", "hiviewdfx_hilog_native:libhilog", + "i18n_standard:intl_util", "ipc:ipc_core", + "os_account_standard:os_account_innerkits", + "permission_standard:libpermissionsdk_standard", + "safwk:system_ability_fwk", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] subsystem_name = "aafwk" diff --git a/services/appmgr/examples/BUILD.gn b/services/appmgr/examples/BUILD.gn index e5219f6180..609f9d5b5f 100644 --- a/services/appmgr/examples/BUILD.gn +++ b/services/appmgr/examples/BUILD.gn @@ -16,18 +16,16 @@ import("//build/ohos.gni") ohos_executable("appspawnclienttest") { sources = [ "app_spawn_client_test/main.cpp" ] - configs = [ - ":test_config", - "//foundation/appexecfwk/standard/libs/libeventhandler:libeventhandler_config", - ] + configs = [ ":test_config" ] - deps = [ - "//foundation/aafwk/standard/interfaces/innerkits/base:base", - "//foundation/aafwk/standard/interfaces/innerkits/want:want", - "//foundation/aafwk/standard/services/appmgr:libams", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base", + deps = [ "//foundation/aafwk/standard/services/appmgr:libams" ] + external_deps = [ + "ability_base:base", + "ability_base:want", + "appspawn:appspawn_socket_client", + "bundle_framework:appexecfwk_base", + "eventhandler:libeventhandler", ] - external_deps = [ "appspawn:appspawn_socket_client" ] subsystem_name = "aafwk" part_name = "ability_runtime" @@ -36,34 +34,28 @@ ohos_executable("appspawnclienttest") { ohos_executable("appmgrserviceregtest") { sources = [ "app_mgr_service_register_test/main_client.cpp" ] - configs = [ - ":test_config", - "//foundation/appexecfwk/standard/libs/libeventhandler:libeventhandler_config", - "//foundation/aafwk/standard/interfaces/innerkits/app_manager:appmgr_sdk_config", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base_sdk_config", - "//utils/native/base:utils_config", - ] + configs = [ ":test_config" ] cflags = [] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ - "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", - "//foundation/aafwk/standard/interfaces/innerkits/base:base", - "//foundation/aafwk/standard/interfaces/innerkits/want:want", "//foundation/aafwk/standard/services/appmgr:libams", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base", - #"startup:appspawn_jni", - "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//utils/native/base:utils", ] external_deps = [ + "ability_base:base", + "ability_base:want", + "ability_runtime:app_manager", + "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", + "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "safwk:system_ability_fwk", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] subsystem_name = "aafwk" @@ -73,7 +65,6 @@ ohos_executable("appmgrserviceregtest") { config("test_config") { # header file path include_dirs = [ - "//foundation/appexecfwk/standard/interfaces", "//foundation/aafwk/standard/services/appmgr/include", "//foundation/appexecfwk/standard/services/common/include", ] diff --git a/services/appmgr/src/ams_mgr_scheduler.cpp b/services/appmgr/src/ams_mgr_scheduler.cpp index 2670235e4a..8726441dfc 100644 --- a/services/appmgr/src/ams_mgr_scheduler.cpp +++ b/services/appmgr/src/ams_mgr_scheduler.cpp @@ -21,8 +21,8 @@ #include "system_ability_definition.h" #include "app_death_recipient.h" -#include "app_log_wrapper.h" #include "app_mgr_constants.h" +#include "hilog_wrapper.h" #include "perf_profile.h" #include "permission_constants.h" #include "permission_verification.h" @@ -49,7 +49,7 @@ AmsMgrScheduler::AmsMgrScheduler( AmsMgrScheduler::~AmsMgrScheduler() { - APP_LOGI("AmsMgrScheduler instance destroyed"); + HILOG_INFO("AmsMgrScheduler instance destroyed"); } void AmsMgrScheduler::LoadAbility(const sptr &token, const sptr &preToken, @@ -57,12 +57,12 @@ void AmsMgrScheduler::LoadAbility(const sptr &token, const sptr &want) { if (!abilityInfo || !appInfo) { - APP_LOGE("param error"); + HILOG_ERROR("param error"); return; } if (!IsReady()) { - APP_LOGE("AmsMgrScheduler not Ready"); + HILOG_ERROR("AmsMgrScheduler not Ready"); return; } PerfProfile::GetInstance().SetAbilityLoadStartTime(GetTickCount()); @@ -131,7 +131,7 @@ void AmsMgrScheduler::AbilityBehaviorAnalysis(const sptr &token, void AmsMgrScheduler::KillProcessByAbilityToken(const sptr &token) { if (amsMgrServiceInner_->VerifyProcessPermission() == ERR_PERMISSION_DENIED) { - APP_LOGE("%{public}s: Permission verification failed", __func__); + HILOG_ERROR("%{public}s: Permission verification failed", __func__); return; } @@ -147,7 +147,7 @@ void AmsMgrScheduler::KillProcessesByUserId(int32_t userId) { if (amsMgrServiceInner_->VerifyAccountPermission(AAFwk::PermissionConstants::PERMISSION_CLEAN_BACKGROUND_PROCESSES, userId) == ERR_PERMISSION_DENIED) { - APP_LOGE("%{public}s: Permission verification failed", __func__); + HILOG_ERROR("%{public}s: Permission verification failed", __func__); return; } @@ -161,21 +161,21 @@ void AmsMgrScheduler::KillProcessesByUserId(int32_t userId) int32_t AmsMgrScheduler::KillProcessWithAccount(const std::string &bundleName, const int accountId) { - APP_LOGI("enter"); - APP_LOGI("bundleName = %{public}s, accountId = %{public}d", bundleName.c_str(), accountId); + HILOG_INFO("enter"); + HILOG_INFO("bundleName = %{public}s, accountId = %{public}d", bundleName.c_str(), accountId); if (!IsReady()) { return ERR_INVALID_OPERATION; } - APP_LOGI("end"); + HILOG_INFO("end"); return amsMgrServiceInner_->KillApplicationByUserId(bundleName, accountId); } void AmsMgrScheduler::AbilityAttachTimeOut(const sptr &token) { - APP_LOGI("AmsMgrScheduler AttachTimeOut begin"); + HILOG_INFO("AmsMgrScheduler AttachTimeOut begin"); if (!IsReady()) { return; } @@ -185,7 +185,7 @@ void AmsMgrScheduler::AbilityAttachTimeOut(const sptr &token) void AmsMgrScheduler::PrepareTerminate(const sptr &token) { - APP_LOGI("AmsMgrScheduler PrepareTerminate begin"); + HILOG_INFO("AmsMgrScheduler PrepareTerminate begin"); if (!IsReady()) { return; } @@ -213,11 +213,11 @@ int32_t AmsMgrScheduler::KillApplicationByUid(const std::string &bundleName, con bool AmsMgrScheduler::IsReady() const { if (!amsMgrServiceInner_) { - APP_LOGE("amsMgrServiceInner_ is null"); + HILOG_ERROR("amsMgrServiceInner_ is null"); return false; } if (!amsHandler_) { - APP_LOGE("amsHandler_ is null"); + HILOG_ERROR("amsHandler_ is null"); return false; } return true; @@ -262,13 +262,13 @@ void AmsMgrScheduler::RegisterStartSpecifiedAbilityResponse(const sptrIsSACall(); if (!isSaCall) { auto isCallingPerm = AAFwk::PermissionVerification::GetInstance()->VerifyCallingPermission( AAFwk::PermissionConstants::PERMISSION_UPDATE_CONFIGURATION); if (!isCallingPerm) { - APP_LOGE("%{public}s: Permission verification failed", __func__); + HILOG_ERROR("%{public}s: Permission verification failed", __func__); return; } } @@ -278,12 +278,12 @@ void AmsMgrScheduler::UpdateConfiguration(const Configuration &config) } auto task = [=]() { amsMgrServiceInner_->UpdateConfiguration(config); }; amsHandler_->PostTask(task); - APP_LOGI("AmsMgrScheduler UpdateConfiguration end"); + HILOG_INFO("AmsMgrScheduler UpdateConfiguration end"); } int AmsMgrScheduler::GetConfiguration(Configuration& config) { - APP_LOGI("AmsMgrScheduler GetConfiguration begin"); + HILOG_INFO("AmsMgrScheduler GetConfiguration begin"); if (!IsReady()) { return ERR_INVALID_OPERATION; } @@ -291,7 +291,7 @@ int AmsMgrScheduler::GetConfiguration(Configuration& config) return ERR_INVALID_OPERATION; } config = *(amsMgrServiceInner_->GetConfiguration()); - APP_LOGI("AmsMgrScheduler GetConfiguration end"); + HILOG_INFO("AmsMgrScheduler GetConfiguration end"); return ERR_OK; } } // namespace AppExecFwk diff --git a/services/appmgr/src/app_death_recipient.cpp b/services/appmgr/src/app_death_recipient.cpp index 6ccba58de7..6411214117 100644 --- a/services/appmgr/src/app_death_recipient.cpp +++ b/services/appmgr/src/app_death_recipient.cpp @@ -15,8 +15,8 @@ #include "app_death_recipient.h" -#include "app_log_wrapper.h" #include "app_mgr_service_inner.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -27,18 +27,18 @@ const std::string TASK_ON_REMOTE_DIED = "OnRemoteDiedTask"; void AppDeathRecipient::OnRemoteDied(const wptr &remote) { if (remote == nullptr) { - APP_LOGE("remote is null"); + HILOG_ERROR("remote is null"); return; } auto handler = handler_.lock(); if (!handler) { - APP_LOGE("handler is null"); + HILOG_ERROR("handler is null"); return; } auto serviceInner = appMgrServiceInner_.lock(); if (!serviceInner) { - APP_LOGE("serviceInner is null"); + HILOG_ERROR("serviceInner is null"); return; } diff --git a/services/appmgr/src/app_lifecycle_deal.cpp b/services/appmgr/src/app_lifecycle_deal.cpp index 63c733e1da..53afe04d96 100644 --- a/services/appmgr/src/app_lifecycle_deal.cpp +++ b/services/appmgr/src/app_lifecycle_deal.cpp @@ -14,8 +14,8 @@ */ #include "app_lifecycle_deal.h" -#include "app_log_wrapper.h" #include "bytrace.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -28,7 +28,7 @@ AppLifeCycleDeal::~AppLifeCycleDeal() void AppLifeCycleDeal::LaunchApplication(const AppLaunchData &launchData_, const Configuration &config) { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("AppLifeCycleDeal ScheduleLaunchApplication"); + HILOG_INFO("AppLifeCycleDeal ScheduleLaunchApplication"); if (appThread_) { appThread_->ScheduleLaunchApplication(launchData_, config); } @@ -37,7 +37,7 @@ void AppLifeCycleDeal::LaunchApplication(const AppLaunchData &launchData_, const void AppLifeCycleDeal::AddAbilityStage(const HapModuleInfo &abilityStage) { if (!appThread_) { - APP_LOGE("appThread_ is nullptr"); + HILOG_ERROR("appThread_ is nullptr"); return; } @@ -55,7 +55,7 @@ void AppLifeCycleDeal::LaunchAbility(const std::shared_ptr void AppLifeCycleDeal::ScheduleTerminate() { if (!appThread_) { - APP_LOGE("appThread_ is nullptr"); + HILOG_ERROR("appThread_ is nullptr"); return; } @@ -65,7 +65,7 @@ void AppLifeCycleDeal::ScheduleTerminate() void AppLifeCycleDeal::ScheduleForegroundRunning() { if (!appThread_) { - APP_LOGE("appThread_ is nullptr"); + HILOG_ERROR("appThread_ is nullptr"); return; } @@ -75,7 +75,7 @@ void AppLifeCycleDeal::ScheduleForegroundRunning() void AppLifeCycleDeal::ScheduleBackgroundRunning() { if (!appThread_) { - APP_LOGE("appThread_ is nullptr"); + HILOG_ERROR("appThread_ is nullptr"); return; } @@ -85,7 +85,7 @@ void AppLifeCycleDeal::ScheduleBackgroundRunning() void AppLifeCycleDeal::ScheduleTrimMemory(int32_t timeLevel) { if (!appThread_) { - APP_LOGE("appThread_ is nullptr"); + HILOG_ERROR("appThread_ is nullptr"); return; } @@ -95,7 +95,7 @@ void AppLifeCycleDeal::ScheduleTrimMemory(int32_t timeLevel) void AppLifeCycleDeal::LowMemoryWarning() { if (!appThread_) { - APP_LOGE("appThread_ is nullptr"); + HILOG_ERROR("appThread_ is nullptr"); return; } @@ -105,7 +105,7 @@ void AppLifeCycleDeal::LowMemoryWarning() void AppLifeCycleDeal::ScheduleCleanAbility(const sptr &token) { if (!appThread_) { - APP_LOGE("appThread_ is nullptr"); + HILOG_ERROR("appThread_ is nullptr"); return; } appThread_->ScheduleCleanAbility(token); @@ -114,7 +114,7 @@ void AppLifeCycleDeal::ScheduleCleanAbility(const sptr &token) void AppLifeCycleDeal::ScheduleProcessSecurityExit() { if (!appThread_) { - APP_LOGE("appThread_ is nullptr"); + HILOG_ERROR("appThread_ is nullptr"); return; } @@ -134,7 +134,7 @@ sptr AppLifeCycleDeal::GetApplicationClient() const void AppLifeCycleDeal::ScheduleAcceptWant(const AAFwk::Want &want, const std::string &moduleName) { if (!appThread_) { - APP_LOGE("appThread_ is nullptr"); + HILOG_ERROR("appThread_ is nullptr"); return; } @@ -143,9 +143,9 @@ void AppLifeCycleDeal::ScheduleAcceptWant(const AAFwk::Want &want, const std::st void AppLifeCycleDeal::UpdateConfiguration(const Configuration &config) { - APP_LOGI("call %{public}s", __func__); + HILOG_INFO("call %{public}s", __func__); if (!appThread_) { - APP_LOGI("appThread_ is null"); + HILOG_INFO("appThread_ is null"); return; } appThread_->ScheduleConfigurationUpdated(config); diff --git a/services/appmgr/src/app_mgr_service.cpp b/services/appmgr/src/app_mgr_service.cpp index 05cd47dc15..72426c43a6 100755 --- a/services/appmgr/src/app_mgr_service.cpp +++ b/services/appmgr/src/app_mgr_service.cpp @@ -23,8 +23,8 @@ #include "system_ability_definition.h" #include "app_death_recipient.h" -#include "app_log_wrapper.h" #include "app_mgr_constants.h" +#include "hilog_wrapper.h" #include "perf_profile.h" #include "xcollie/watchdog.h" @@ -57,51 +57,51 @@ REGISTER_SYSTEM_ABILITY_BY_ID(AppMgrService, APP_MGR_SERVICE_ID, true); AppMgrService::AppMgrService() { appMgrServiceInner_ = std::make_shared(); - APP_LOGI("instance created with no para"); + HILOG_INFO("instance created with no para"); PerfProfile::GetInstance().SetAmsLoadStartTime(GetTickCount()); } AppMgrService::AppMgrService(const int32_t serviceId, bool runOnCreate) : SystemAbility(serviceId, runOnCreate) { appMgrServiceInner_ = std::make_shared(); - APP_LOGI("instance created"); + HILOG_INFO("instance created"); PerfProfile::GetInstance().SetAmsLoadStartTime(GetTickCount()); } AppMgrService::~AppMgrService() { - APP_LOGI("instance destroyed"); + HILOG_INFO("instance destroyed"); } void AppMgrService::OnStart() { - APP_LOGI("ready to start service"); + HILOG_INFO("ready to start service"); if (appMgrServiceState_.serviceRunningState == ServiceRunningState::STATE_RUNNING) { - APP_LOGW("failed to start service since it's already running"); + HILOG_WARN("failed to start service since it's already running"); return; } ErrCode errCode = Init(); if (FAILED(errCode)) { - APP_LOGE("init failed, errCode: %{public}08x", errCode); + HILOG_ERROR("init failed, errCode: %{public}08x", errCode); return; } appMgrServiceState_.serviceRunningState = ServiceRunningState::STATE_RUNNING; - APP_LOGI("start service success"); + HILOG_INFO("start service success"); PerfProfile::GetInstance().SetAmsLoadEndTime(GetTickCount()); PerfProfile::GetInstance().Dump(); } void AppMgrService::OnStop() { - APP_LOGI("ready to stop service"); + HILOG_INFO("ready to stop service"); appMgrServiceState_.serviceRunningState = ServiceRunningState::STATE_NOT_START; handler_.reset(); runner_.reset(); if (appMgrServiceInner_) { appMgrServiceInner_->OnStop(); } - APP_LOGI("stop service success"); + HILOG_INFO("stop service success"); } void AppMgrService::SetInnerService(const std::shared_ptr &innerService) @@ -119,48 +119,48 @@ AppMgrServiceState AppMgrService::QueryServiceState() ErrCode AppMgrService::Init() { - APP_LOGI("ready to init"); + HILOG_INFO("ready to init"); // start main thread message loop. runner_ = EventRunner::Create(Constants::APP_MGR_SERVICE_NAME); if (!runner_) { - APP_LOGE("init failed due to create runner error"); + HILOG_ERROR("init failed due to create runner error"); return ERR_INVALID_OPERATION; } if (!appMgrServiceInner_) { - APP_LOGE("init failed without inner service"); + HILOG_ERROR("init failed without inner service"); return ERR_INVALID_OPERATION; } appMgrServiceInner_->Init(); handler_ = std::make_shared(runner_, appMgrServiceInner_); if (!handler_) { - APP_LOGE("init failed without handler"); + HILOG_ERROR("init failed without handler"); return ERR_INVALID_OPERATION; } appMgrServiceInner_->SetEventHandler(handler_); ErrCode openErr = appMgrServiceInner_->OpenAppSpawnConnection(); if (FAILED(openErr)) { - APP_LOGW("failed to connect to AppSpawnDaemon! errCode: %{public}08x", openErr); + HILOG_WARN("failed to connect to AppSpawnDaemon! errCode: %{public}08x", openErr); } if (!Publish(this)) { - APP_LOGE("failed to publish appmgrservice to systemAbilityMgr"); + HILOG_ERROR("failed to publish appmgrservice to systemAbilityMgr"); return ERR_APPEXECFWK_SERVICE_NOT_CONNECTED; } amsMgrScheduler_ = new (std::nothrow) AmsMgrScheduler(appMgrServiceInner_, handler_); if (!amsMgrScheduler_) { - APP_LOGE("init failed without ams scheduler"); + HILOG_ERROR("init failed without ams scheduler"); return ERR_INVALID_OPERATION; } if (HiviewDFX::Watchdog::GetInstance().AddThread("APPMSWatchdog", handler_, APP_MS_TIMEOUT) != 0) { - APP_LOGE("HiviewDFX::Watchdog::GetInstance AddThread Fail"); + HILOG_ERROR("HiviewDFX::Watchdog::GetInstance AddThread Fail"); } - APP_LOGI("init success"); + HILOG_INFO("init success"); return ERR_OK; } int32_t AppMgrService::CheckPermission( [[maybe_unused]] const int32_t recordId, [[maybe_unused]] const std::string &permission) { - APP_LOGI("check application's permission"); + HILOG_INFO("check application's permission"); return ERR_OK; } @@ -168,7 +168,7 @@ int32_t AppMgrService::CheckPermission( void AppMgrService::AttachApplication(const sptr &app) { if (!IsReady()) { - APP_LOGE("AttachApplication failed, not ready."); + HILOG_ERROR("AttachApplication failed, not ready."); return; } @@ -222,11 +222,11 @@ void AppMgrService::AbilityCleaned(const sptr &token) bool AppMgrService::IsReady() const { if (!appMgrServiceInner_) { - APP_LOGE("appMgrServiceInner is null"); + HILOG_ERROR("appMgrServiceInner is null"); return false; } if (!handler_) { - APP_LOGE("handler is null"); + HILOG_ERROR("handler is null"); return false; } return true; @@ -250,7 +250,7 @@ void AppMgrService::StartupResidentProcess(const std::vector startupResidentProcess = std::bind(&AppMgrServiceInner::LoadResidentProcess, appMgrServiceInner_, bundleInfos); handler_->PostTask(startupResidentProcess, TASK_STARTUP_RESIDENT_PROCESS); @@ -268,7 +268,7 @@ int32_t AppMgrService::ClearUpApplicationData(const std::string &bundleName) auto isCallingPerm = AAFwk::PermissionVerification::GetInstance()->VerifyCallingPermission( AAFwk::PermissionConstants::PERMISSION_CLEAN_APPLICATION_DATA); if (!isCallingPerm) { - APP_LOGE("%{public}s: Permission verification failed", __func__); + HILOG_ERROR("%{public}s: Permission verification failed", __func__); return ERR_PERMISSION_DENIED; } } @@ -312,14 +312,14 @@ void AppMgrService::GetSystemMemoryAttr(SystemMemoryAttr &memoryInfo, std::strin nlohmann::json memJson = nlohmann::json::parse(strConfig, nullptr, false); if (memJson.is_discarded()) { memThreshold = EXPERIENCE_MEM_THRESHOLD; - APP_LOGE("%{public}s, discarded memThreshold = %{public}d", __func__, EXPERIENCE_MEM_THRESHOLD); + HILOG_ERROR("%{public}s, discarded memThreshold = %{public}d", __func__, EXPERIENCE_MEM_THRESHOLD); } else { if (!memJson.contains("memoryThreshold")) { memThreshold = EXPERIENCE_MEM_THRESHOLD; - APP_LOGE("%{public}s, memThreshold = %{public}d", __func__, EXPERIENCE_MEM_THRESHOLD); + HILOG_ERROR("%{public}s, memThreshold = %{public}d", __func__, EXPERIENCE_MEM_THRESHOLD); } else { memThreshold = memJson.at("memorythreshold").get(); - APP_LOGI("memThreshold = %{public}d", memThreshold); + HILOG_INFO("memThreshold = %{public}d", memThreshold); } } @@ -341,9 +341,9 @@ void AppMgrService::AddAbilityStageDone(const int32_t recordId) int32_t AppMgrService::RegisterApplicationStateObserver(const sptr &observer) { - APP_LOGI("%{public}s begin", __func__); + HILOG_INFO("%{public}s begin", __func__); if (!IsReady()) { - APP_LOGE("%{public}s begin, not ready", __func__); + HILOG_ERROR("%{public}s begin, not ready", __func__); return ERR_INVALID_OPERATION; } return appMgrServiceInner_->RegisterApplicationStateObserver(observer); @@ -351,9 +351,9 @@ int32_t AppMgrService::RegisterApplicationStateObserver(const sptr &observer) { - APP_LOGI("%{public}s begin", __func__); + HILOG_INFO("%{public}s begin", __func__); if (!IsReady()) { - APP_LOGE("%{public}s begin, not ready", __func__); + HILOG_ERROR("%{public}s begin, not ready", __func__); return ERR_INVALID_OPERATION; } return appMgrServiceInner_->UnregisterApplicationStateObserver(observer); @@ -361,9 +361,9 @@ int32_t AppMgrService::UnregisterApplicationStateObserver(const sptr &list) { - APP_LOGI("%{public}s begin", __func__); + HILOG_INFO("%{public}s begin", __func__); if (!IsReady()) { - APP_LOGE("%{public}s begin, not ready", __func__); + HILOG_ERROR("%{public}s begin, not ready", __func__); return ERR_INVALID_OPERATION; } return appMgrServiceInner_->GetForegroundApplications(list); @@ -414,7 +414,7 @@ int32_t AppMgrService::StartRenderProcess(const std::string &renderParam, int32_ int32_t sharedFd, pid_t &renderPid) { if (!IsReady()) { - APP_LOGE("StartRenderProcess failed, AppMgrService not ready."); + HILOG_ERROR("StartRenderProcess failed, AppMgrService not ready."); return ERR_INVALID_OPERATION; } @@ -424,9 +424,9 @@ int32_t AppMgrService::StartRenderProcess(const std::string &renderParam, int32_ void AppMgrService::AttachRenderProcess(const sptr &scheduler) { - APP_LOGD("AttachRenderProcess called."); + HILOG_DEBUG("AttachRenderProcess called."); if (!IsReady()) { - APP_LOGE("AttachRenderProcess failed, not ready."); + HILOG_ERROR("AttachRenderProcess failed, not ready."); return; } diff --git a/services/appmgr/src/app_mgr_service_event_handler.cpp b/services/appmgr/src/app_mgr_service_event_handler.cpp index a341764f51..24348c78e8 100644 --- a/services/appmgr/src/app_mgr_service_event_handler.cpp +++ b/services/appmgr/src/app_mgr_service_event_handler.cpp @@ -15,8 +15,8 @@ #include "app_mgr_service_event_handler.h" -#include "app_log_wrapper.h" #include "app_mgr_service_inner.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -24,24 +24,24 @@ AMSEventHandler::AMSEventHandler( const std::shared_ptr &runner, const std::weak_ptr &appMgr) : EventHandler(runner), appMgr_(appMgr) { - APP_LOGI("instance created"); + HILOG_INFO("instance created"); } AMSEventHandler::~AMSEventHandler() { - APP_LOGI("instance destroyed"); + HILOG_INFO("instance destroyed"); } void AMSEventHandler::ProcessEvent(const InnerEvent::Pointer &event) { if (event == nullptr) { - APP_LOGE("AppEventHandler::ProcessEvent::parameter error"); + HILOG_ERROR("AppEventHandler::ProcessEvent::parameter error"); return; } auto appManager = appMgr_.lock(); if (!appManager) { - APP_LOGE("app manager is nullptr"); + HILOG_ERROR("app manager is nullptr"); return; } appManager->HandleTimeOut(event); diff --git a/services/appmgr/src/app_mgr_service_inner.cpp b/services/appmgr/src/app_mgr_service_inner.cpp index 49506827a3..e669d9c1ca 100644 --- a/services/appmgr/src/app_mgr_service_inner.cpp +++ b/services/appmgr/src/app_mgr_service_inner.cpp @@ -20,9 +20,9 @@ #include #include -#include "app_log_wrapper.h" #include "application_state_observer_stub.h" #include "datetime_ex.h" +#include "hilog_wrapper.h" #include "perf_profile.h" #include "app_process_data.h" @@ -119,25 +119,25 @@ void AppMgrServiceInner::LoadAbility(const sptr &token, const spt { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); if (!CheckLoadabilityConditions(token, abilityInfo, appInfo)) { - APP_LOGE("CheckLoadabilityConditions failed"); + HILOG_ERROR("CheckLoadabilityConditions failed"); return; } if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is nullptr"); + HILOG_ERROR("appRunningManager_ is nullptr"); return; } BundleInfo bundleInfo; HapModuleInfo hapModuleInfo; if (!GetBundleAndHapInfo(*abilityInfo, appInfo, bundleInfo, hapModuleInfo)) { - APP_LOGE("GetBundleAndHapInfo failed"); + HILOG_ERROR("GetBundleAndHapInfo failed"); return; } std::string processName; MakeProcessName(processName, abilityInfo, appInfo, hapModuleInfo); - APP_LOGI("processName = [%{public}s]", processName.c_str()); + HILOG_INFO("processName = [%{public}s]", processName.c_str()); auto appRecord = appRunningManager_->CheckAppRunningRecordIsExist(appInfo->name, processName, appInfo->uid, bundleInfo); @@ -146,7 +146,7 @@ void AppMgrServiceInner::LoadAbility(const sptr &token, const spt CreateAppRunningRecord(token, preToken, appInfo, abilityInfo, processName, bundleInfo, hapModuleInfo, want); if (!appRecord) { - APP_LOGE("CreateAppRunningRecord failed, appRecord is nullptr"); + HILOG_ERROR("CreateAppRunningRecord failed, appRecord is nullptr"); return; } bool isColdStart = want == nullptr ? false : want->GetBoolParam("coldStart", false); @@ -164,15 +164,15 @@ bool AppMgrServiceInner::CheckLoadabilityConditions(const sptr &t const std::shared_ptr &abilityInfo, const std::shared_ptr &appInfo) { if (!token || !abilityInfo || !appInfo) { - APP_LOGE("param error"); + HILOG_ERROR("param error"); return false; } if (abilityInfo->name.empty() || appInfo->name.empty()) { - APP_LOGE("error abilityInfo or appInfo"); + HILOG_ERROR("error abilityInfo or appInfo"); return false; } if (abilityInfo->applicationName != appInfo->name) { - APP_LOGE("abilityInfo and appInfo have different appName, don't load for it"); + HILOG_ERROR("abilityInfo and appInfo have different appName, don't load for it"); return false; } @@ -205,7 +205,7 @@ void AppMgrServiceInner::MakeProcessName( // check after abilityInfo, because abilityInfo contains extension process. if (hapModuleInfo.isStageBasedModel && !hapModuleInfo.process.empty()) { processName = hapModuleInfo.process; - APP_LOGI("Stage mode, Make processName:%{public}s", processName.c_str()); + HILOG_INFO("Stage mode, Make processName:%{public}s", processName.c_str()); return; } processName = appInfo->bundleName; @@ -214,10 +214,10 @@ void AppMgrServiceInner::MakeProcessName( bool AppMgrServiceInner::GetBundleAndHapInfo(const AbilityInfo &abilityInfo, const std::shared_ptr &appInfo, BundleInfo &bundleInfo, HapModuleInfo &hapModuleInfo) { - APP_LOGI("AppMgrServiceInner GetBundleAndHapInfo start!"); + HILOG_INFO("AppMgrServiceInner GetBundleAndHapInfo start!"); auto bundleMgr_ = remoteClientManager_->GetBundleManager(); if (bundleMgr_ == nullptr) { - APP_LOGE("GetBundleManager fail"); + HILOG_ERROR("GetBundleManager fail"); return false; } @@ -225,12 +225,12 @@ bool AppMgrServiceInner::GetBundleAndHapInfo(const AbilityInfo &abilityInfo, bool bundleMgrResult = bundleMgr_->GetBundleInfo(appInfo->bundleName, BundleFlag::GET_BUNDLE_DEFAULT, bundleInfo, userId); if (!bundleMgrResult) { - APP_LOGE("GetBundleInfo is fail"); + HILOG_ERROR("GetBundleInfo is fail"); return false; } bundleMgrResult = bundleMgr_->GetHapModuleInfo(abilityInfo, hapModuleInfo); if (!bundleMgrResult) { - APP_LOGE("GetHapModuleInfo is fail"); + HILOG_ERROR("GetHapModuleInfo is fail"); return false; } @@ -241,17 +241,17 @@ void AppMgrServiceInner::AttachApplication(const pid_t pid, const sptrSetApplicationClient(app); @@ -265,17 +265,17 @@ void AppMgrServiceInner::LaunchApplication(const std::shared_ptrGetState() != ApplicationState::APP_STATE_CREATE) { - APP_LOGE("wrong app state:%{public}d", appRecord->GetState()); + HILOG_ERROR("wrong app state:%{public}d", appRecord->GetState()); return; } appRecord->LaunchApplication(*configuration_); @@ -300,7 +300,7 @@ void AppMgrServiceInner::AddAbilityStageDone(const int32_t recordId) { auto appRecord = GetAppRunningRecordByAppRecordId(recordId); if (!appRecord) { - APP_LOGE("get app record failed"); + HILOG_ERROR("get app record failed"); return; } appRecord->AddAbilityStageDone(); @@ -311,7 +311,7 @@ void AppMgrServiceInner::ApplicationForegrounded(const int32_t recordId) BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); auto appRecord = GetAppRunningRecordByAppRecordId(recordId); if (!appRecord) { - APP_LOGE("get app record failed"); + HILOG_ERROR("get app record failed"); return; } appRecord->PopForegroundingAbilityTokens(); @@ -322,14 +322,14 @@ void AppMgrServiceInner::ApplicationForegrounded(const int32_t recordId) } else if (appState == ApplicationState::APP_STATE_SUSPENDED) { appRecord->SetState(ApplicationState::APP_STATE_BACKGROUND); } else { - APP_LOGW("app name(%{public}s), app state(%{public}d)!", + HILOG_WARN("app name(%{public}s), app state(%{public}d)!", appRecord->GetName().c_str(), static_cast(appState)); } // push the foregrounded app front of RecentAppList. PushAppFront(recordId); - APP_LOGI("application is foregrounded"); + HILOG_INFO("application is foregrounded"); } void AppMgrServiceInner::ApplicationBackgrounded(const int32_t recordId) @@ -337,7 +337,7 @@ void AppMgrServiceInner::ApplicationBackgrounded(const int32_t recordId) BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); auto appRecord = GetAppRunningRecordByAppRecordId(recordId); if (!appRecord) { - APP_LOGE("get app record failed"); + HILOG_ERROR("get app record failed"); return; } if (appRecord->GetState() == ApplicationState::APP_STATE_FOREGROUND) { @@ -346,12 +346,12 @@ void AppMgrServiceInner::ApplicationBackgrounded(const int32_t recordId) } else if (appRecord->GetState() == ApplicationState::APP_STATE_SUSPENDED) { appRecord->SetState(ApplicationState::APP_STATE_BACKGROUND); } else { - APP_LOGW("app name(%{public}s), app state(%{public}d)!", + HILOG_WARN("app name(%{public}s), app state(%{public}d)!", appRecord->GetName().c_str(), static_cast(appRecord->GetState())); } - APP_LOGI("application is backgrounded"); + HILOG_INFO("application is backgrounded"); } void AppMgrServiceInner::ApplicationTerminated(const int32_t recordId) @@ -359,7 +359,7 @@ void AppMgrServiceInner::ApplicationTerminated(const int32_t recordId) BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); auto appRecord = GetAppRunningRecordByAppRecordId(recordId); if (!appRecord) { - APP_LOGE("get app record failed"); + HILOG_ERROR("get app record failed"); return; } // Maybe can't get in here @@ -367,7 +367,7 @@ void AppMgrServiceInner::ApplicationTerminated(const int32_t recordId) return; } if (appRecord->GetState() != ApplicationState::APP_STATE_BACKGROUND) { - APP_LOGE("current state is not background"); + HILOG_ERROR("current state is not background"); return; } appRecord->SetState(ApplicationState::APP_STATE_TERMINATED); @@ -377,18 +377,18 @@ void AppMgrServiceInner::ApplicationTerminated(const int32_t recordId) RemoveAppFromRecentListById(recordId); OnProcessDied(appRecord); - APP_LOGI("application is terminated"); + HILOG_INFO("application is terminated"); } int32_t AppMgrServiceInner::KillApplication(const std::string &bundleName) { if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is nullptr"); + HILOG_ERROR("appRunningManager_ is nullptr"); return ERR_NO_INIT; } if (VerifyProcessPermission() == ERR_PERMISSION_DENIED) { - APP_LOGE("%{public}s: Permission verification failed", __func__); + HILOG_ERROR("%{public}s: Permission verification failed", __func__); return ERR_PERMISSION_DENIED; } @@ -397,18 +397,18 @@ int32_t AppMgrServiceInner::KillApplication(const std::string &bundleName) std::list pids; if (!appRunningManager_->ProcessExitByBundleName(bundleName, pids)) { - APP_LOGI("The process corresponding to the package name did not start"); + HILOG_INFO("The process corresponding to the package name did not start"); return result; } if (WaitForRemoteProcessExit(pids, startTime)) { - APP_LOGI("The remote process exited successfully "); + HILOG_INFO("The remote process exited successfully "); NotifyAppStatus(bundleName, EventFwk::CommonEventSupport::COMMON_EVENT_PACKAGE_RESTARTED); return result; } for (auto iter = pids.begin(); iter != pids.end(); ++iter) { result = KillProcessByPid(*iter); if (result < 0) { - APP_LOGE("KillApplication is fail bundleName: %{public}s pid: %{public}d", bundleName.c_str(), *iter); + HILOG_ERROR("KillApplication is fail bundleName: %{public}s pid: %{public}d", bundleName.c_str(), *iter); return result; } } @@ -419,12 +419,12 @@ int32_t AppMgrServiceInner::KillApplication(const std::string &bundleName) int32_t AppMgrServiceInner::KillApplicationByUid(const std::string &bundleName, const int uid) { if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is nullptr"); + HILOG_ERROR("appRunningManager_ is nullptr"); return ERR_NO_INIT; } if (VerifyProcessPermission() == ERR_PERMISSION_DENIED) { - APP_LOGE("%{public}s: Permission verification failed", __func__); + HILOG_ERROR("%{public}s: Permission verification failed", __func__); return ERR_PERMISSION_DENIED; } @@ -432,27 +432,27 @@ int32_t AppMgrServiceInner::KillApplicationByUid(const std::string &bundleName, int64_t startTime = SystemTimeMillis(); std::list pids; if (remoteClientManager_ == nullptr) { - APP_LOGE("remoteClientManager_ fail"); + HILOG_ERROR("remoteClientManager_ fail"); return ERR_NO_INIT; } auto bundleMgr_ = remoteClientManager_->GetBundleManager(); if (bundleMgr_ == nullptr) { - APP_LOGE("GetBundleManager fail"); + HILOG_ERROR("GetBundleManager fail"); return ERR_NO_INIT; } - APP_LOGI("uid value is %{public}d", uid); + HILOG_INFO("uid value is %{public}d", uid); if (!appRunningManager_->ProcessExitByBundleNameAndUid(bundleName, uid, pids)) { - APP_LOGI("The process corresponding to the package name did not start"); + HILOG_INFO("The process corresponding to the package name did not start"); return result; } if (WaitForRemoteProcessExit(pids, startTime)) { - APP_LOGI("The remote process exited successfully "); + HILOG_INFO("The remote process exited successfully "); return result; } for (auto iter = pids.begin(); iter != pids.end(); ++iter) { result = KillProcessByPid(*iter); if (result < 0) { - APP_LOGE("KillApplication is fail bundleName: %{public}s pid: %{public}d", bundleName.c_str(), *iter); + HILOG_ERROR("KillApplication is fail bundleName: %{public}s pid: %{public}d", bundleName.c_str(), *iter); return result; } } @@ -462,13 +462,13 @@ int32_t AppMgrServiceInner::KillApplicationByUid(const std::string &bundleName, int32_t AppMgrServiceInner::KillApplicationByUserId(const std::string &bundleName, const int userId) { if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is nullptr"); + HILOG_ERROR("appRunningManager_ is nullptr"); return ERR_NO_INIT; } if (VerifyAccountPermission(AAFwk::PermissionConstants::PERMISSION_CLEAN_BACKGROUND_PROCESSES, userId) == ERR_PERMISSION_DENIED) { - APP_LOGE("%{public}s: Permission verification failed", __func__); + HILOG_ERROR("%{public}s: Permission verification failed", __func__); return ERR_PERMISSION_DENIED; } @@ -476,36 +476,36 @@ int32_t AppMgrServiceInner::KillApplicationByUserId(const std::string &bundleNam int64_t startTime = SystemTimeMillis(); std::list pids; if (remoteClientManager_ == nullptr) { - APP_LOGE("remoteClientManager_ fail"); + HILOG_ERROR("remoteClientManager_ fail"); return ERR_NO_INIT; } auto bundleMgr_ = remoteClientManager_->GetBundleManager(); if (bundleMgr_ == nullptr) { - APP_LOGE("GetBundleManager fail"); + HILOG_ERROR("GetBundleManager fail"); return ERR_NO_INIT; } int32_t callerUid = IPCSkeleton::GetCallingUid(); if (!bundleMgr_->CheckIsSystemAppByUid(callerUid)) { - APP_LOGE("caller is not systemApp, callerUid %{public}d", callerUid); + HILOG_ERROR("caller is not systemApp, callerUid %{public}d", callerUid); return ERR_INVALID_VALUE; } - APP_LOGI("userId value is %{public}d", userId); + HILOG_INFO("userId value is %{public}d", userId); int uid = bundleMgr_->GetUidByBundleName(bundleName, userId); - APP_LOGI("uid value is %{public}d", uid); + HILOG_INFO("uid value is %{public}d", uid); if (!appRunningManager_->ProcessExitByBundleNameAndUid(bundleName, uid, pids)) { - APP_LOGI("The process corresponding to the package name did not start"); + HILOG_INFO("The process corresponding to the package name did not start"); return result; } if (WaitForRemoteProcessExit(pids, startTime)) { - APP_LOGI("The remote process exited successfully "); + HILOG_INFO("The remote process exited successfully "); return result; } for (auto iter = pids.begin(); iter != pids.end(); ++iter) { result = KillProcessByPid(*iter); if (result < 0) { - APP_LOGE("KillApplication is fail bundleName: %{public}s pid: %{public}d", bundleName.c_str(), *iter); + HILOG_ERROR("KillApplication is fail bundleName: %{public}s pid: %{public}d", bundleName.c_str(), *iter); return result; } } @@ -516,7 +516,7 @@ void AppMgrServiceInner::ClearUpApplicationData(const std::string &bundleName, i { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); auto userId = GetUserIdByUid(callerUid); - APP_LOGI("userId:%{public}d", userId); + HILOG_INFO("userId:%{public}d", userId); ClearUpApplicationDataByUserId(bundleName, callerUid, callerPid, userId); } @@ -524,16 +524,16 @@ void AppMgrServiceInner::ClearUpApplicationDataByUserId( const std::string &bundleName, int32_t callerUid, pid_t callerPid, const int userId) { if (callerPid <= 0) { - APP_LOGE("invalid callerPid:%{public}d", callerPid); + HILOG_ERROR("invalid callerPid:%{public}d", callerPid); return; } if (callerUid <= 0) { - APP_LOGE("invalid callerUid:%{public}d", callerUid); + HILOG_ERROR("invalid callerUid:%{public}d", callerUid); return; } auto bundleMgr_ = remoteClientManager_->GetBundleManager(); if (bundleMgr_ == nullptr) { - APP_LOGE("GetBundleManager fail"); + HILOG_ERROR("GetBundleManager fail"); return; } @@ -541,19 +541,19 @@ void AppMgrServiceInner::ClearUpApplicationDataByUserId( int32_t result = Permission::PermissionKit::RemoveUserGrantedReqPermissions(bundleName, userId); if (result) { - APP_LOGE("RemoveUserGrantedReqPermissions failed"); + HILOG_ERROR("RemoveUserGrantedReqPermissions failed"); return; } // 2.delete bundle side user data if (!bundleMgr_->CleanBundleDataFiles(bundleName, userId)) { - APP_LOGE("Delete bundle side user data is fail"); + HILOG_ERROR("Delete bundle side user data is fail"); return; } // 3.kill application // 4.revoke user rights result = KillApplicationByUserId(bundleName, userId); if (result < 0) { - APP_LOGE("Kill Application by bundle name is fail"); + HILOG_ERROR("Kill Application by bundle name is fail"); return; } NotifyAppStatusByCallerUid(bundleName, userId, callerUid, @@ -566,7 +566,7 @@ int32_t AppMgrServiceInner::GetAllRunningProcesses(std::vector ids; auto result = AccountSA::OsAccountManager::QueryActiveOsAccountIds(ids); - APP_LOGD("ids size : %{public}d", static_cast(ids.size())); + HILOG_DEBUG("ids size : %{public}d", static_cast(ids.size())); // check permission for (const auto &item : appRunningManager_->GetAppRunningRecordMap()) { @@ -595,7 +595,7 @@ int32_t AppMgrServiceInner::GetProcessRunningInfosByUserId(std::vector 0) { - APP_LOGI("kill pid %{public}d", pid); + HILOG_INFO("kill pid %{public}d", pid); ret = kill(pid, SIGNAL_KILL); } return ret; @@ -736,14 +736,14 @@ std::shared_ptr AppMgrServiceInner::CreateAppRunningRecord(con void AppMgrServiceInner::TerminateAbility(const sptr &token) { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGD("AppMgrServiceInner::TerminateAbility begin"); + HILOG_DEBUG("AppMgrServiceInner::TerminateAbility begin"); if (!token) { - APP_LOGE("AppMgrServiceInner::TerminateAbility token is null!"); + HILOG_ERROR("AppMgrServiceInner::TerminateAbility token is null!"); return; } auto appRecord = GetAppRunningRecordByAbilityToken(token); if (!appRecord) { - APP_LOGE("AppMgrServiceInner::TerminateAbility app is not exist!"); + HILOG_ERROR("AppMgrServiceInner::TerminateAbility app is not exist!"); return; } if (appRecord->GetState() == ApplicationState::APP_STATE_SUSPENDED) { @@ -759,22 +759,22 @@ void AppMgrServiceInner::UpdateAbilityState(const sptr &token, co { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); if (!token) { - APP_LOGE("token is null!"); + HILOG_ERROR("token is null!"); return; } auto appRecord = GetAppRunningRecordByAbilityToken(token); if (!appRecord) { - APP_LOGE("app is not exist!"); + HILOG_ERROR("app is not exist!"); return; } auto abilityRecord = appRecord->GetAbilityRunningRecordByToken(token); if (!abilityRecord) { - APP_LOGE("can not find ability record!"); + HILOG_ERROR("can not find ability record!"); return; } if (state == abilityRecord->GetState()) { - APP_LOGE("current state is already, no need update!"); + HILOG_ERROR("current state is already, no need update!"); return; } auto type = abilityRecord->GetAbilityInfo()->type; @@ -783,12 +783,12 @@ void AppMgrServiceInner::UpdateAbilityState(const sptr &token, co state == AbilityState::ABILITY_STATE_TERMINATED || state == AbilityState::ABILITY_STATE_CONNECTED || state == AbilityState::ABILITY_STATE_DISCONNECTED)) { - APP_LOGI("StateChangedNotifyObserver service type, state:%{public}d", static_cast(state)); + HILOG_INFO("StateChangedNotifyObserver service type, state:%{public}d", static_cast(state)); appRecord->StateChangedNotifyObserver(abilityRecord, static_cast(state), true); return; } if (state > AbilityState::ABILITY_STATE_BACKGROUND || state < AbilityState::ABILITY_STATE_FOREGROUND) { - APP_LOGE("state is not foreground or background!"); + HILOG_ERROR("state is not foreground or background!"); return; } if (appRecord->GetState() == ApplicationState::APP_STATE_SUSPENDED) { @@ -801,17 +801,17 @@ void AppMgrServiceInner::UpdateAbilityState(const sptr &token, co void AppMgrServiceInner::UpdateExtensionState(const sptr &token, const ExtensionState state) { if (!token) { - APP_LOGE("token is null!"); + HILOG_ERROR("token is null!"); return; } auto appRecord = GetAppRunningRecordByAbilityToken(token); if (!appRecord) { - APP_LOGE("app is not exist!"); + HILOG_ERROR("app is not exist!"); return; } auto abilityRecord = appRecord->GetAbilityRunningRecordByToken(token); if (!abilityRecord) { - APP_LOGE("can not find ability record!"); + HILOG_ERROR("can not find ability record!"); return; } appRecord->StateChangedNotifyObserver(abilityRecord, static_cast(state), false); @@ -866,7 +866,7 @@ void AppMgrServiceInner::RegisterAppStateCallback(const sptr pid_t callingPid = IPCSkeleton::GetCallingPid(); pid_t pid = getpid(); if (callingPid != pid) { - APP_LOGE("%{public}s: Not abilityMgr call.", __func__); + HILOG_ERROR("%{public}s: Not abilityMgr call.", __func__); return; } BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); @@ -882,17 +882,17 @@ void AppMgrServiceInner::AbilityBehaviorAnalysis(const sptr &toke { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); if (!token) { - APP_LOGE("token is null"); + HILOG_ERROR("token is null"); return; } auto appRecord = GetAppRunningRecordByAbilityToken(token); if (!appRecord) { - APP_LOGE("app record is not exist for ability token"); + HILOG_ERROR("app record is not exist for ability token"); return; } auto abilityRecord = appRecord->GetAbilityRunningRecordByToken(token); if (!abilityRecord) { - APP_LOGE("ability record is not exist for ability previous token"); + HILOG_ERROR("ability record is not exist for ability previous token"); return; } if (preToken) { @@ -907,12 +907,12 @@ void AppMgrServiceInner::KillProcessByAbilityToken(const sptr &to { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); if (!token) { - APP_LOGE("token is null"); + HILOG_ERROR("token is null"); return; } auto appRecord = GetAppRunningRecordByAbilityToken(token); if (!appRecord) { - APP_LOGE("app record is not exist for ability token"); + HILOG_ERROR("app record is not exist for ability token"); return; } @@ -930,7 +930,7 @@ void AppMgrServiceInner::KillProcessByAbilityToken(const sptr &to if (!WaitForRemoteProcessExit(pids, SystemTimeMillis())) { int32_t result = KillProcessByPid(pid); if (result < 0) { - APP_LOGE("KillProcessByAbilityToken kill process is fail"); + HILOG_ERROR("KillProcessByAbilityToken kill process is fail"); return; } } @@ -940,24 +940,24 @@ void AppMgrServiceInner::KillProcessByAbilityToken(const sptr &to void AppMgrServiceInner::KillProcessesByUserId(int32_t userId) { if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is nullptr"); + HILOG_ERROR("appRunningManager_ is nullptr"); return; } int64_t startTime = SystemTimeMillis(); std::list pids; if (!appRunningManager_->GetPidsByUserId(userId, pids)) { - APP_LOGI("The process corresponding to the userId did not start"); + HILOG_INFO("The process corresponding to the userId did not start"); return; } if (WaitForRemoteProcessExit(pids, startTime)) { - APP_LOGI("The remote process exited successfully "); + HILOG_INFO("The remote process exited successfully "); return; } for (auto iter = pids.begin(); iter != pids.end(); ++iter) { auto result = KillProcessByPid(*iter); if (result < 0) { - APP_LOGE("KillProcessByPid is failed. pid: %{public}d", *iter); + HILOG_ERROR("KillProcessByPid is failed. pid: %{public}d", *iter); return; } } @@ -968,23 +968,23 @@ void AppMgrServiceInner::StartAbility(const sptr &token, const sp const HapModuleInfo &hapModuleInfo, const std::shared_ptr &want) { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("already create appRecord, just start ability"); + HILOG_INFO("already create appRecord, just start ability"); if (!appRecord) { - APP_LOGE("appRecord is null"); + HILOG_ERROR("appRecord is null"); return; } if (abilityInfo->launchMode == LaunchMode::SINGLETON) { auto abilityRecord = appRecord->GetAbilityRunningRecord(abilityInfo->name); if (abilityRecord) { - APP_LOGW("same ability info in singleton launch mode, will not add ability"); + HILOG_WARN("same ability info in singleton launch mode, will not add ability"); return; } } auto ability = appRecord->GetAbilityRunningRecordByToken(token); if (ability && preToken) { - APP_LOGE("Ability is already started"); + HILOG_ERROR("Ability is already started"); ability->SetPreToken(preToken); return; } @@ -998,13 +998,13 @@ void AppMgrServiceInner::StartAbility(const sptr &token, const sp appRecord->AddModule(appInfo, abilityInfo, token, hapModuleInfo, want); auto moduleRecord = appRecord->GetModuleRecordByModuleName(appInfo->bundleName, hapModuleInfo.moduleName); if (!moduleRecord) { - APP_LOGE("add moduleRecord failed"); + HILOG_ERROR("add moduleRecord failed"); return; } ability = moduleRecord->GetAbilityRunningRecordByToken(token); if (!ability) { - APP_LOGE("add ability failed"); + HILOG_ERROR("add ability failed"); return; } @@ -1013,7 +1013,7 @@ void AppMgrServiceInner::StartAbility(const sptr &token, const sp } if (appState == ApplicationState::APP_STATE_CREATE) { - APP_LOGE("in create state, don't launch ability"); + HILOG_ERROR("in create state, don't launch ability"); return; } appRecord->LaunchAbility(ability); @@ -1028,15 +1028,15 @@ std::shared_ptr AppMgrServiceInner::GetAppRunningRecordByAbili void AppMgrServiceInner::AbilityTerminated(const sptr &token) { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGD("begin"); + HILOG_DEBUG("begin"); if (!token) { - APP_LOGE("token is null!"); + HILOG_ERROR("token is null!"); return; } auto appRecord = appRunningManager_->GetTerminatingAppRunningRecord(token); if (!appRecord) { - APP_LOGE("app is not exist!"); + HILOG_ERROR("app is not exist!"); return; } @@ -1055,9 +1055,9 @@ std::shared_ptr AppMgrServiceInner::GetAppRunningRecordByAppRe void AppMgrServiceInner::OnAppStateChanged( const std::shared_ptr &appRecord, const ApplicationState state) { - APP_LOGD("begin, state:%{public}d", static_cast(state)); + HILOG_DEBUG("begin, state:%{public}d", static_cast(state)); if (!appRecord) { - APP_LOGE("app record is null"); + HILOG_ERROR("app record is null"); return; } @@ -1069,7 +1069,8 @@ void AppMgrServiceInner::OnAppStateChanged( if (state == ApplicationState::APP_STATE_FOREGROUND || state == ApplicationState::APP_STATE_BACKGROUND) { AppStateData data = WrapAppStateData(appRecord, state); - APP_LOGD("OnForegroundApplicationChanged, size:%{public}d, name:%{public}s, uid:%{public}d, state:%{public}d", + HILOG_DEBUG( + "OnForegroundApplicationChanged, size:%{public}d, name:%{public}s, uid:%{public}d, state:%{public}d", (int32_t)appStateObservers_.size(), data.bundleName.c_str(), data.uid, data.state); std::lock_guard lockNotify(observerLock_); for (const auto &observer : appStateObservers_) { @@ -1081,7 +1082,7 @@ void AppMgrServiceInner::OnAppStateChanged( if (state == ApplicationState::APP_STATE_CREATE || state == ApplicationState::APP_STATE_TERMINATED) { AppStateData data = WrapAppStateData(appRecord, state); - APP_LOGI("OnApplicationStateChanged, size:%{public}d, name:%{public}s, uid:%{public}d, state:%{public}d", + HILOG_INFO("OnApplicationStateChanged, size:%{public}d, name:%{public}s, uid:%{public}d, state:%{public}d", (int32_t)appStateObservers_.size(), data.bundleName.c_str(), data.uid, data.state); std::lock_guard lockNotify(observerLock_); for (const auto &observer : appStateObservers_) { @@ -1131,9 +1132,9 @@ ProcessData AppMgrServiceInner::WrapProcessData(const std::shared_ptr &ability, const AbilityState state) { - APP_LOGD("begin, state:%{public}d", static_cast(state)); + HILOG_DEBUG("begin, state:%{public}d", static_cast(state)); if (!ability) { - APP_LOGE("ability is null"); + HILOG_ERROR("ability is null"); return; } for (const auto &callback : appStateCallbacks_) { @@ -1146,7 +1147,7 @@ void AppMgrServiceInner::OnAbilityStateChanged( void AppMgrServiceInner::StateChangedNotifyObserver(const AbilityStateData abilityStateData, bool isAbility) { std::lock_guard lockNotify(observerLock_); - APP_LOGD("bundle:%{public}s, ability:%{public}s, state:%{public}d, pid:%{public}d," + HILOG_DEBUG("bundle:%{public}s, ability:%{public}s, state:%{public}d, pid:%{public}d," "uid:%{public}d, abilityType:%{public}d", abilityStateData.bundleName.c_str(), abilityStateData.abilityName.c_str(), abilityStateData.abilityState, abilityStateData.pid, abilityStateData.uid, @@ -1164,13 +1165,13 @@ void AppMgrServiceInner::StateChangedNotifyObserver(const AbilityStateData abili void AppMgrServiceInner::OnProcessCreated(const std::shared_ptr &appRecord) { - APP_LOGD("OnProcessCreated begin."); + HILOG_DEBUG("OnProcessCreated begin."); if (!appRecord) { - APP_LOGE("app record is null"); + HILOG_ERROR("app record is null"); return; } ProcessData data = WrapProcessData(appRecord); - APP_LOGD("OnProcessCreated, bundle:%{public}s, pid:%{public}d, uid:%{public}d, size:%{public}d", + HILOG_DEBUG("OnProcessCreated, bundle:%{public}s, pid:%{public}d, uid:%{public}d, size:%{public}d", data.bundleName.c_str(), data.uid, data.pid, (int32_t)appStateObservers_.size()); std::lock_guard lockNotify(observerLock_); for (const auto &observer : appStateObservers_) { @@ -1178,18 +1179,18 @@ void AppMgrServiceInner::OnProcessCreated(const std::shared_ptrOnProcessCreated(data); } } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void AppMgrServiceInner::OnProcessDied(const std::shared_ptr &appRecord) { - APP_LOGD("OnProcessDied begin."); + HILOG_DEBUG("OnProcessDied begin."); if (!appRecord) { - APP_LOGE("app record is null"); + HILOG_ERROR("app record is null"); return; } ProcessData data = WrapProcessData(appRecord); - APP_LOGD("OnProcessDied, bundle:%{public}s, pid:%{public}d, uid:%{public}d, size:%{public}d", + HILOG_DEBUG("OnProcessDied, bundle:%{public}s, pid:%{public}d, uid:%{public}d, size:%{public}d", data.bundleName.c_str(), data.uid, data.pid, (int32_t)appStateObservers_.size()); std::lock_guard lockNotify(observerLock_); for (const auto &observer : appStateObservers_) { @@ -1197,7 +1198,7 @@ void AppMgrServiceInner::OnProcessDied(const std::shared_ptr & observer->OnProcessDied(data); } } - APP_LOGD("end"); + HILOG_DEBUG("end"); } void AppMgrServiceInner::StartProcess(const std::string &appName, const std::string &processName, bool coldStart, @@ -1205,13 +1206,13 @@ void AppMgrServiceInner::StartProcess(const std::string &appName, const std::str { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); if (!remoteClientManager_->GetSpawnClient() || !appRecord) { - APP_LOGE("appSpawnClient or apprecord is null"); + HILOG_ERROR("appSpawnClient or apprecord is null"); return; } auto bundleMgr_ = remoteClientManager_->GetBundleManager(); if (bundleMgr_ == nullptr) { - APP_LOGE("GetBundleManager fail"); + HILOG_ERROR("GetBundleManager fail"); return; } @@ -1222,7 +1223,7 @@ void AppMgrServiceInner::StartProcess(const std::string &appName, const std::str bool bundleMgrResult = bundleMgr_->GetBundleInfos(AppExecFwk::BundleFlag::GET_BUNDLE_WITH_ABILITIES, bundleInfos, userId); if (!bundleMgrResult) { - APP_LOGE("GetBundleInfo is fail"); + HILOG_ERROR("GetBundleInfo is fail"); return; } @@ -1231,7 +1232,7 @@ void AppMgrServiceInner::StartProcess(const std::string &appName, const std::str }; auto bundleInfoIter = std::find_if(bundleInfos.begin(), bundleInfos.end(), isExist); if (bundleInfoIter == bundleInfos.end()) { - APP_LOGE("Get target fail."); + HILOG_ERROR("Get target fail."); return; } startMsg.uid = (*bundleInfoIter).uid; @@ -1241,12 +1242,12 @@ void AppMgrServiceInner::StartProcess(const std::string &appName, const std::str startMsg.bundleName = bundleName; startMsg.renderParam = RENDER_PARAM; startMsg.coldStart = coldStart; - APP_LOGD("StartProcess accessTokenId:%{public}d, apl:%{public}s, bundleName:%{public}s coldStart:%{public}d", + HILOG_DEBUG("StartProcess accessTokenId:%{public}d, apl:%{public}s, bundleName:%{public}s coldStart:%{public}d", startMsg.accessTokenId, startMsg.apl.c_str(), bundleName.c_str(), coldStart); bundleMgrResult = bundleMgr_->GetBundleGidsByUid(bundleName, uid, startMsg.gids); if (!bundleMgrResult) { - APP_LOGE("GetBundleGids is fail"); + HILOG_ERROR("GetBundleGids is fail"); return; } startMsg.procName = processName; @@ -1256,11 +1257,11 @@ void AppMgrServiceInner::StartProcess(const std::string &appName, const std::str pid_t pid = 0; ErrCode errCode = remoteClientManager_->GetSpawnClient()->StartProcess(startMsg, pid); if (FAILED(errCode)) { - APP_LOGE("failed to spawn new app process, errCode %{public}08x", errCode); + HILOG_ERROR("failed to spawn new app process, errCode %{public}08x", errCode); appRunningManager_->RemoveAppRunningRecordById(appRecord->GetRecordId()); return; } - APP_LOGI("newPid:%{public}d uid:%{public}d", pid, startMsg.uid); + HILOG_INFO("newPid:%{public}d uid:%{public}d", pid, startMsg.uid); appRecord->GetPriorityObject()->SetPid(pid); appRecord->SetUid(startMsg.uid); appRecord->SetStartMsg(startMsg); @@ -1296,7 +1297,7 @@ void AppMgrServiceInner::RemoveAppFromRecentList(const std::string &appName, con if (!WaitForRemoteProcessExit(pids, startTime)) { int32_t result = KillProcessByPid(appTaskInfo->GetPid()); if (result < 0) { - APP_LOGE("RemoveAppFromRecentList kill process is fail"); + HILOG_ERROR("RemoveAppFromRecentList kill process is fail"); return; } } @@ -1324,7 +1325,7 @@ void AppMgrServiceInner::ClearRecentAppList() for (auto iter = pids.begin(); iter != pids.end(); ++iter) { int32_t result = KillProcessByPid(*iter); if (result < 0) { - APP_LOGE("ClearRecentAppList kill process is fail"); + HILOG_ERROR("ClearRecentAppList kill process is fail"); return; } } @@ -1333,7 +1334,7 @@ void AppMgrServiceInner::ClearRecentAppList() void AppMgrServiceInner::OnRemoteDied(const wptr &remote, bool isRenderProcess) { - APP_LOGE("On remote died."); + HILOG_ERROR("On remote died."); if (isRenderProcess) { OnRenderRemoteDied(remote); return; @@ -1364,7 +1365,7 @@ void AppMgrServiceInner::OnRemoteDied(const wptr &remote, bool is // kill render if exist. auto renderRecord = appRecord->GetRenderRecord(); if (renderRecord && renderRecord->GetPid() > 0) { - APP_LOGD("Kill render process when nwebhost died."); + HILOG_DEBUG("Kill render process when nwebhost died."); KillProcessByPid(renderRecord->GetPid()); } @@ -1376,7 +1377,7 @@ void AppMgrServiceInner::OnRemoteDied(const wptr &remote, bool is }; if (!eventHandler_) { - APP_LOGE("eventHandler_ is nullptr"); + HILOG_ERROR("eventHandler_ is nullptr"); return; } eventHandler_->PostTask(restartProcss, "RestartResidentProcess"); @@ -1416,9 +1417,9 @@ void AppMgrServiceInner::AddAppDeathRecipient(const pid_t pid, const sptrGetInnerEventId(), event->GetParam()); @@ -1449,9 +1450,9 @@ void AppMgrServiceInner::SetEventHandler(const std::shared_ptr void AppMgrServiceInner::HandleAbilityAttachTimeOut(const sptr &token) { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is nullptr"); + HILOG_ERROR("appRunningManager_ is nullptr"); return; } appRunningManager_->HandleAbilityAttachTimeOut(token); @@ -1459,9 +1460,9 @@ void AppMgrServiceInner::HandleAbilityAttachTimeOut(const sptr &t void AppMgrServiceInner::PrepareTerminate(const sptr &token) { - APP_LOGI("Prepare terminate"); + HILOG_INFO("Prepare terminate"); if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is nullptr"); + HILOG_ERROR("appRunningManager_ is nullptr"); return; } appRunningManager_->PrepareTerminate(token); @@ -1469,20 +1470,20 @@ void AppMgrServiceInner::PrepareTerminate(const sptr &token) void AppMgrServiceInner::HandleTerminateApplicationTimeOut(const int64_t eventId) { - APP_LOGI("handle terminate application time out"); + HILOG_INFO("handle terminate application time out"); if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is nullptr"); + HILOG_ERROR("appRunningManager_ is nullptr"); return; } auto appRecord = appRunningManager_->GetAppRunningRecord(eventId); if (!appRecord) { - APP_LOGE("appRecord is nullptr"); + HILOG_ERROR("appRecord is nullptr"); return; } auto abilityRecord = appRecord->GetAbilityRunningRecord(eventId); if (!abilityRecord) { - APP_LOGE("abilityRecord is nullptr"); + HILOG_ERROR("abilityRecord is nullptr"); return; } appRecord->SetState(ApplicationState::APP_STATE_TERMINATED); @@ -1492,7 +1493,7 @@ void AppMgrServiceInner::HandleTerminateApplicationTimeOut(const int64_t eventId if (pid > 0) { int32_t result = KillProcessByPid(pid); if (result < 0) { - APP_LOGE("KillProcessByAbilityToken kill process is fail"); + HILOG_ERROR("KillProcessByAbilityToken kill process is fail"); return; } } @@ -1503,14 +1504,14 @@ void AppMgrServiceInner::HandleTerminateApplicationTimeOut(const int64_t eventId void AppMgrServiceInner::HandleAddAbilityStageTimeOut(const int64_t eventId) { - APP_LOGI("called add ability stage info time out!"); + HILOG_INFO("called add ability stage info time out!"); if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is nullptr"); + HILOG_ERROR("appRunningManager_ is nullptr"); return; } auto appRecord = appRunningManager_->GetAppRunningRecord(eventId); if (!appRecord) { - APP_LOGE("appRecord is nullptr"); + HILOG_ERROR("appRecord is nullptr"); return; } @@ -1523,26 +1524,26 @@ void AppMgrServiceInner::HandleAddAbilityStageTimeOut(const int64_t eventId) int AppMgrServiceInner::CompelVerifyPermission(const std::string &permission, int pid, int uid, std::string &message) { - APP_LOGI("compel verify permission"); + HILOG_INFO("compel verify permission"); message = ENUM_TO_STRING(PERMISSION_NOT_GRANTED); if (!remoteClientManager_) { - APP_LOGE("remoteClientManager_ is nullptr"); + HILOG_ERROR("remoteClientManager_ is nullptr"); return ERR_NO_INIT; } if (permission.empty()) { - APP_LOGI("permission is empty, PERMISSION_GRANTED"); + HILOG_INFO("permission is empty, PERMISSION_GRANTED"); message = ENUM_TO_STRING(PERMISSION_GRANTED); return ERR_OK; } if (pid == getpid()) { - APP_LOGI("pid is my pid, PERMISSION_GRANTED"); + HILOG_INFO("pid is my pid, PERMISSION_GRANTED"); message = ENUM_TO_STRING(PERMISSION_GRANTED); return ERR_OK; } int userId = Constants::DEFAULT_USERID; auto appRecord = GetAppRunningRecordByPid(pid); if (!appRecord) { - APP_LOGE("app record is nullptr"); + HILOG_ERROR("app record is nullptr"); return PERMISSION_NOT_GRANTED; } auto bundleName = appRecord->GetBundleName(); @@ -1551,17 +1552,17 @@ int AppMgrServiceInner::CompelVerifyPermission(const std::string &permission, in } auto bundleMgr = remoteClientManager_->GetBundleManager(); if (bundleMgr == nullptr) { - APP_LOGE("GetBundleManager fail"); + HILOG_ERROR("GetBundleManager fail"); return ERR_NO_INIT; } auto bmsUid = bundleMgr->GetUidByBundleName(bundleName, userId); if (bmsUid == ROOT_UID || bmsUid == SYSTEM_UID) { - APP_LOGI("uid is root or system, PERMISSION_GRANTED"); + HILOG_INFO("uid is root or system, PERMISSION_GRANTED"); message = ENUM_TO_STRING(PERMISSION_GRANTED); return ERR_OK; } if (bmsUid != uid) { - APP_LOGI("check uid != bms uid, PERMISSION_NOT_GRANTED"); + HILOG_INFO("check uid != bms uid, PERMISSION_NOT_GRANTED"); return PERMISSION_NOT_GRANTED; } auto result = bundleMgr->CheckPermissionByUid(bundleName, permission, userId); @@ -1575,15 +1576,15 @@ int AppMgrServiceInner::CompelVerifyPermission(const std::string &permission, in void AppMgrServiceInner::GetRunningProcessInfoByToken( const sptr &token, AppExecFwk::RunningProcessInfo &info) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is nullptr"); + HILOG_ERROR("appRunningManager_ is nullptr"); return; } auto isPerm = AAFwk::PermissionVerification::GetInstance()->VerifyRunningInfoPerm(); if (!isPerm) { - APP_LOGE("%{public}s: Permission verification failed", __func__); + HILOG_ERROR("%{public}s: Permission verification failed", __func__); return; } @@ -1592,41 +1593,41 @@ void AppMgrServiceInner::GetRunningProcessInfoByToken( void AppMgrServiceInner::LoadResidentProcess(const std::vector &infos) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); pid_t callingPid = IPCSkeleton::GetCallingPid(); pid_t pid = getpid(); if (callingPid != pid) { - APP_LOGE("%{public}s: Not SA call.", __func__); + HILOG_ERROR("%{public}s: Not SA call.", __func__); return; } - APP_LOGI("bundle info size: [%{public}d]", static_cast(infos.size())); + HILOG_INFO("bundle info size: [%{public}d]", static_cast(infos.size())); StartResidentProcess(infos, -1); } void AppMgrServiceInner::StartResidentProcess(const std::vector &infos, int restartCount) { - APP_LOGI("start resident process"); + HILOG_INFO("start resident process"); if (infos.empty()) { - APP_LOGE("infos is empty!"); + HILOG_ERROR("infos is empty!"); return; } if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is nullptr"); + HILOG_ERROR("appRunningManager_ is nullptr"); return; } for (auto &bundle : infos) { auto processName = bundle.applicationInfo.process.empty() ? bundle.applicationInfo.bundleName : bundle.applicationInfo.process; - APP_LOGI("processName = [%{public}s]", processName.c_str()); + HILOG_INFO("processName = [%{public}s]", processName.c_str()); // Inspection records auto appRecord = appRunningManager_->CheckAppRunningRecordIsExist( bundle.applicationInfo.name, processName, bundle.applicationInfo.uid, bundle); if (appRecord) { - APP_LOGI("processName [%{public}s] Already exists ", processName.c_str()); + HILOG_INFO("processName [%{public}s] Already exists ", processName.c_str()); continue; } StartEmptyResidentProcess(bundle, processName, restartCount); @@ -1636,16 +1637,16 @@ void AppMgrServiceInner::StartResidentProcess(const std::vector &inf void AppMgrServiceInner::StartEmptyResidentProcess( const BundleInfo &info, const std::string &processName, int restartCount) { - APP_LOGI("start bundle [%{public}s | processName [%{public}s]]", info.name.c_str(), processName.c_str()); + HILOG_INFO("start bundle [%{public}s | processName [%{public}s]]", info.name.c_str(), processName.c_str()); if (!CheckRemoteClient() || !appRunningManager_) { - APP_LOGI("Failed to start resident process!"); + HILOG_INFO("Failed to start resident process!"); return; } auto appInfo = std::make_shared(info.applicationInfo); auto appRecord = appRunningManager_->CreateAppRunningRecord(appInfo, processName, info); if (!appRecord) { - APP_LOGE("start process [%{public}s] failed!", processName.c_str()); + HILOG_ERROR("start process [%{public}s] failed!", processName.c_str()); return; } @@ -1653,7 +1654,7 @@ void AppMgrServiceInner::StartEmptyResidentProcess( // If it is empty, the startup failed if (!appRecord) { - APP_LOGE("start process [%{public}s] failed!", processName.c_str()); + HILOG_ERROR("start process [%{public}s] failed!", processName.c_str()); return; } @@ -1663,34 +1664,34 @@ void AppMgrServiceInner::StartEmptyResidentProcess( isStageBased = info.hapModuleInfos.back().isStageBasedModel; moduelJson = info.hapModuleInfos.back().isModuleJson; } - APP_LOGI("StartEmptyResidentProcess stage:%{public}d moduel:%{public}d size:%{public}d", + HILOG_INFO("StartEmptyResidentProcess stage:%{public}d moduel:%{public}d size:%{public}d", isStageBased, moduelJson, (int32_t)info.hapModuleInfos.size()); appRecord->SetKeepAliveAppState(true, isStageBased); if (restartCount > 0) { - APP_LOGI("StartEmptyResidentProcess restartCount : [%{public}d], ", restartCount); + HILOG_INFO("StartEmptyResidentProcess restartCount : [%{public}d], ", restartCount); appRecord->SetRestartResidentProcCount(restartCount); } appRecord->SetEventHandler(eventHandler_); appRecord->AddModules(appInfo, info.hapModuleInfos); - APP_LOGI("StartEmptyResidentProcess oK pid : [%{public}d], ", appRecord->GetPriorityObject()->GetPid()); + HILOG_INFO("StartEmptyResidentProcess oK pid : [%{public}d], ", appRecord->GetPriorityObject()->GetPid()); } bool AppMgrServiceInner::CheckRemoteClient() { if (!remoteClientManager_) { - APP_LOGE("remoteClientManager_ is null"); + HILOG_ERROR("remoteClientManager_ is null"); return false; } if (!remoteClientManager_->GetSpawnClient()) { - APP_LOGE("appSpawnClient is null"); + HILOG_ERROR("appSpawnClient is null"); return false; } if (!remoteClientManager_->GetBundleManager()) { - APP_LOGE("GetBundleManager fail"); + HILOG_ERROR("GetBundleManager fail"); return false; } return true; @@ -1699,26 +1700,26 @@ bool AppMgrServiceInner::CheckRemoteClient() void AppMgrServiceInner::RestartResidentProcess(std::shared_ptr appRecord) { if (!CheckRemoteClient() || !appRecord || !appRunningManager_) { - APP_LOGE("restart resident process failed!"); + HILOG_ERROR("restart resident process failed!"); return; } auto bundleMgr = remoteClientManager_->GetBundleManager(); BundleInfo bundleInfo; if (!bundleMgr->GetBundleInfo(appRecord->GetBundleName(), BundleFlag::GET_BUNDLE_DEFAULT, bundleInfo)) { - APP_LOGE("GetBundleInfo fail"); + HILOG_ERROR("GetBundleInfo fail"); return; } std::vector infos; infos.emplace_back(bundleInfo); - APP_LOGI("the resident process [%{public}s] remaining restarts num is [%{public}d]", + HILOG_INFO("the resident process [%{public}s] remaining restarts num is [%{public}d]", appRecord->GetProcessName().c_str(), (int)appRecord->GetRestartResidentProcCount()); StartResidentProcess(infos, appRecord->GetRestartResidentProcCount()); } void AppMgrServiceInner::NotifyAppStatus(const std::string &bundleName, const std::string &eventData) { - APP_LOGI("%{public}s called, bundle name is %{public}s, event is %{public}s", + HILOG_INFO("%{public}s called, bundle name is %{public}s, event is %{public}s", __func__, bundleName.c_str(), eventData.c_str()); Want want; want.SetAction(eventData); @@ -1733,7 +1734,7 @@ void AppMgrServiceInner::NotifyAppStatus(const std::string &bundleName, const st void AppMgrServiceInner::NotifyAppStatusByCallerUid(const std::string &bundleName, const int32_t userId, const int32_t callerUid, const std::string &eventData) { - APP_LOGI("%{public}s called, bundle name is %{public}s, , userId is %{public}d, event is %{public}s", + HILOG_INFO("%{public}s called, bundle name is %{public}s, , userId is %{public}d, event is %{public}s", __func__, bundleName.c_str(), userId, eventData.c_str()); Want want; want.SetAction(eventData); @@ -1748,55 +1749,55 @@ void AppMgrServiceInner::NotifyAppStatusByCallerUid(const std::string &bundleNam int32_t AppMgrServiceInner::RegisterApplicationStateObserver(const sptr &observer) { - APP_LOGI("%{public}s begin", __func__); + HILOG_INFO("%{public}s begin", __func__); if (VerifyObserverPermission() == ERR_PERMISSION_DENIED) { - APP_LOGE("%{public}s: Permission verification failed", __func__); + HILOG_ERROR("%{public}s: Permission verification failed", __func__); return ERR_PERMISSION_DENIED; } std::lock_guard lockRegister(observerLock_); if (observer == nullptr) { - APP_LOGE("Observer nullptr"); + HILOG_ERROR("Observer nullptr"); return ERR_INVALID_VALUE; } if (ObserverExist(observer)) { - APP_LOGE("Observer exist."); + HILOG_ERROR("Observer exist."); return ERR_INVALID_VALUE; } appStateObservers_.push_back(observer); - APP_LOGI("%{public}s appStateObservers_ size:%{public}d", __func__, (int32_t)appStateObservers_.size()); + HILOG_INFO("%{public}s appStateObservers_ size:%{public}d", __func__, (int32_t)appStateObservers_.size()); AddObserverDeathRecipient(observer); return ERR_OK; } int32_t AppMgrServiceInner::UnregisterApplicationStateObserver(const sptr &observer) { - APP_LOGI("%{public}s begin", __func__); + HILOG_INFO("%{public}s begin", __func__); if (VerifyObserverPermission() == ERR_PERMISSION_DENIED) { - APP_LOGE("%{public}s: Permission verification failed", __func__); + HILOG_ERROR("%{public}s: Permission verification failed", __func__); return ERR_PERMISSION_DENIED; } std::lock_guard lockUnregister(observerLock_); if (observer == nullptr) { - APP_LOGE("Observer nullptr"); + HILOG_ERROR("Observer nullptr"); return ERR_INVALID_VALUE; } std::vector>::iterator it; for (it = appStateObservers_.begin(); it != appStateObservers_.end(); ++it) { if ((*it)->AsObject() == observer->AsObject()) { appStateObservers_.erase(it); - APP_LOGI("%{public}s appStateObservers_ size:%{public}d", __func__, (int32_t)appStateObservers_.size()); + HILOG_INFO("%{public}s appStateObservers_ size:%{public}d", __func__, (int32_t)appStateObservers_.size()); RemoveObserverDeathRecipient(observer); return ERR_OK; } } - APP_LOGE("Observer not exist."); + HILOG_ERROR("Observer not exist."); return ERR_INVALID_VALUE; } bool AppMgrServiceInner::ObserverExist(const sptr &observer) { if (observer == nullptr) { - APP_LOGE("Observer nullptr"); + HILOG_ERROR("Observer nullptr"); return false; } for (int i = 0; i < (int)appStateObservers_.size(); i++) { @@ -1809,14 +1810,14 @@ bool AppMgrServiceInner::ObserverExist(const sptr &ob void AppMgrServiceInner::AddObserverDeathRecipient(const sptr &observer) { - APP_LOGI("%{public}s begin", __func__); + HILOG_INFO("%{public}s begin", __func__); if (observer == nullptr || observer->AsObject() == nullptr) { - APP_LOGE("observer nullptr."); + HILOG_ERROR("observer nullptr."); return; } auto it = recipientMap_.find(observer->AsObject()); if (it != recipientMap_.end()) { - APP_LOGE("This death recipient has been added."); + HILOG_ERROR("This death recipient has been added."); return; } else { sptr deathRecipient = new ApplicationStateObserverRecipient( @@ -1828,9 +1829,9 @@ void AppMgrServiceInner::AddObserverDeathRecipient(const sptr &observer) { - APP_LOGI("%{public}s begin", __func__); + HILOG_INFO("%{public}s begin", __func__); if (observer == nullptr || observer->AsObject() == nullptr) { - APP_LOGE("observer nullptr."); + HILOG_ERROR("observer nullptr."); return; } auto it = recipientMap_.find(observer->AsObject()); @@ -1843,10 +1844,10 @@ void AppMgrServiceInner::RemoveObserverDeathRecipient(const sptr &remote) { - APP_LOGI("%{public}s begin", __func__); + HILOG_INFO("%{public}s begin", __func__); auto object = remote.promote(); if (object == nullptr) { - APP_LOGE("observer nullptr."); + HILOG_ERROR("observer nullptr."); return; } if (eventHandler_) { @@ -1857,9 +1858,9 @@ void AppMgrServiceInner::OnObserverDied(const wptr &remote) void AppMgrServiceInner::HandleObserverDiedTask(const sptr &observer) { - APP_LOGI("Handle call back died task."); + HILOG_INFO("Handle call back died task."); if (observer == nullptr) { - APP_LOGE("observer nullptr."); + HILOG_ERROR("observer nullptr."); return; } sptr object = iface_cast(observer); @@ -1868,10 +1869,10 @@ void AppMgrServiceInner::HandleObserverDiedTask(const sptr &obser int32_t AppMgrServiceInner::GetForegroundApplications(std::vector &list) { - APP_LOGI("%{public}s, begin.", __func__); + HILOG_INFO("%{public}s, begin.", __func__); auto isPerm = AAFwk::PermissionVerification::GetInstance()->VerifyRunningInfoPerm(); if (!isPerm) { - APP_LOGE("%{public}s: Permission verification failed", __func__); + HILOG_ERROR("%{public}s: Permission verification failed", __func__); return ERR_PERMISSION_DENIED; } @@ -1882,31 +1883,31 @@ int32_t AppMgrServiceInner::GetForegroundApplications(std::vector int AppMgrServiceInner::StartUserTestProcess( const AAFwk::Want &want, const sptr &observer, const BundleInfo &bundleInfo) { - APP_LOGI("Enter"); + HILOG_INFO("Enter"); if (!observer) { - APP_LOGE("observer nullptr."); + HILOG_ERROR("observer nullptr."); return ERR_INVALID_VALUE; } if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is nullptr"); + HILOG_ERROR("appRunningManager_ is nullptr"); return ERR_INVALID_VALUE; } HapModuleInfo hapModuleInfo; if (GetHapModuleInfoForTestRunner(want, observer, bundleInfo, hapModuleInfo)) { - APP_LOGE("Failed to get HapModuleInfo for TestRunner"); + HILOG_ERROR("Failed to get HapModuleInfo for TestRunner"); return ERR_INVALID_VALUE; } std::string processName; MakeProcessName(processName, std::make_shared(bundleInfo.applicationInfo), hapModuleInfo); - APP_LOGI("processName = [%{public}s]", processName.c_str()); + HILOG_INFO("processName = [%{public}s]", processName.c_str()); // Inspection records auto appRecord = appRunningManager_->CheckAppRunningRecordIsExist( bundleInfo.applicationInfo.name, processName, bundleInfo.applicationInfo.uid, bundleInfo); if (appRecord) { - APP_LOGI("processName [%{public}s] Already exists ", processName.c_str()); + HILOG_INFO("processName [%{public}s] Already exists ", processName.c_str()); return ERR_INVALID_VALUE; } @@ -1916,9 +1917,9 @@ int AppMgrServiceInner::StartUserTestProcess( int AppMgrServiceInner::GetHapModuleInfoForTestRunner(const AAFwk::Want &want, const sptr &observer, const BundleInfo &bundleInfo, HapModuleInfo &hapModuleInfo) { - APP_LOGI("Enter"); + HILOG_INFO("Enter"); if (!observer) { - APP_LOGE("observer nullptr."); + HILOG_ERROR("observer nullptr."); return ERR_INVALID_VALUE; } @@ -1957,7 +1958,7 @@ int AppMgrServiceInner::UserTestAbnormalFinish(const sptr &observ { sptr observerProxy = iface_cast(observer); if (!observerProxy) { - APP_LOGE("Failed to get ITestObserver proxy"); + HILOG_ERROR("Failed to get ITestObserver proxy"); return ERR_INVALID_VALUE; } observerProxy->TestFinished(msg, -1); @@ -1967,22 +1968,22 @@ int AppMgrServiceInner::UserTestAbnormalFinish(const sptr &observ int AppMgrServiceInner::StartEmptyProcess(const AAFwk::Want &want, const sptr &observer, const BundleInfo &info, const std::string &processName) { - APP_LOGI("enter bundle [%{public}s | processName [%{public}s]]", info.name.c_str(), processName.c_str()); + HILOG_INFO("enter bundle [%{public}s | processName [%{public}s]]", info.name.c_str(), processName.c_str()); if (!CheckRemoteClient() || !appRunningManager_) { - APP_LOGE("Failed to start the process being tested!"); + HILOG_ERROR("Failed to start the process being tested!"); return ERR_INVALID_VALUE; } auto appInfo = std::make_shared(info.applicationInfo); auto appRecord = appRunningManager_->CreateAppRunningRecord(appInfo, processName, info); if (!appRecord) { - APP_LOGE("start process [%{public}s] failed!", processName.c_str()); + HILOG_ERROR("start process [%{public}s] failed!", processName.c_str()); return ERR_INVALID_VALUE; } std::shared_ptr testRecord = std::make_shared(); if (!testRecord) { - APP_LOGE("Failed to make UserTestRecord!"); + HILOG_ERROR("Failed to make UserTestRecord!"); return ERR_INVALID_VALUE; } testRecord->want = want; @@ -1994,13 +1995,13 @@ int AppMgrServiceInner::StartEmptyProcess(const AAFwk::Want &want, const sptrSetEventHandler(eventHandler_); appRecord->AddModules(appInfo, info.hapModuleInfos); - APP_LOGI("StartEmptyProcess OK pid : [%{public}d]", appRecord->GetPriorityObject()->GetPid()); + HILOG_INFO("StartEmptyProcess OK pid : [%{public}d]", appRecord->GetPriorityObject()->GetPid()); return ERR_OK; } @@ -2008,20 +2009,20 @@ int AppMgrServiceInner::StartEmptyProcess(const AAFwk::Want &want, const sptrGetUserTestInfo(); if (!userTestRecord) { - APP_LOGE("unstart user test"); + HILOG_ERROR("unstart user test"); return ERR_INVALID_VALUE; } @@ -2029,7 +2030,7 @@ int AppMgrServiceInner::FinishUserTest( int ret = KillApplication(bundleName); if (ret) { - APP_LOGE("Failed to kill process."); + HILOG_ERROR("Failed to kill process."); return ret; } @@ -2039,22 +2040,22 @@ int AppMgrServiceInner::FinishUserTest( int AppMgrServiceInner::FinishUserTestLocked( const std::string &msg, const int &resultCode, std::shared_ptr &appRecord) { - APP_LOGI("Enter"); + HILOG_INFO("Enter"); if (!appRecord) { - APP_LOGE("Invalid appRecord"); + HILOG_ERROR("Invalid appRecord"); return ERR_INVALID_VALUE; } std::unique_lock lck(userTestLock_); auto userTestRecord = appRecord->GetUserTestInfo(); if (!userTestRecord) { - APP_LOGW("unstart user test"); + HILOG_WARN("unstart user test"); return ERR_INVALID_VALUE; } if (!userTestRecord->isFinished) { sptr observerProxy = iface_cast(userTestRecord->observer); if (!observerProxy) { - APP_LOGE("Failed to get ITestObserver proxy"); + HILOG_ERROR("Failed to get ITestObserver proxy"); return ERR_INVALID_VALUE; } observerProxy->TestFinished(msg, resultCode); @@ -2067,7 +2068,7 @@ int AppMgrServiceInner::FinishUserTestLocked( void AppMgrServiceInner::StartSpecifiedAbility(const AAFwk::Want &want, const AppExecFwk::AbilityInfo &abilityInfo) { - APP_LOGD("Start specified ability."); + HILOG_DEBUG("Start specified ability."); if (!CheckRemoteClient()) { return; } @@ -2076,7 +2077,7 @@ void AppMgrServiceInner::StartSpecifiedAbility(const AAFwk::Want &want, const Ap HapModuleInfo hapModuleInfo; auto appInfo = std::make_shared(abilityInfo.applicationInfo); if (!appInfo) { - APP_LOGE("appInfo is nullptr."); + HILOG_ERROR("appInfo is nullptr."); return; } @@ -2087,7 +2088,7 @@ void AppMgrServiceInner::StartSpecifiedAbility(const AAFwk::Want &want, const Ap std::string processName; auto abilityInfoPtr = std::make_shared(abilityInfo); if (!abilityInfoPtr) { - APP_LOGE("abilityInfoPtr is nullptr."); + HILOG_ERROR("abilityInfoPtr is nullptr."); return; } MakeProcessName(processName, abilityInfoPtr, appInfo, hapModuleInfo); @@ -2101,7 +2102,7 @@ void AppMgrServiceInner::StartSpecifiedAbility(const AAFwk::Want &want, const Ap // new app record appRecord = appRunningManager_->CreateAppRunningRecord(appInfo, processName, bundleInfo); if (!appRecord) { - APP_LOGE("start process [%{public}s] failed!", processName.c_str()); + HILOG_ERROR("start process [%{public}s] failed!", processName.c_str()); return; } appRecord->SetEventHandler(eventHandler_); @@ -2113,15 +2114,15 @@ void AppMgrServiceInner::StartSpecifiedAbility(const AAFwk::Want &want, const Ap appRecord->SetSpecifiedAbilityFlagAndWant(true, want, hapModuleInfo.moduleName); appRecord->AddModules(appInfo, hapModules); } else { - APP_LOGD("process is exist"); + HILOG_DEBUG("process is exist"); appRecord->SetSpecifiedAbilityFlagAndWant(true, want, hapModuleInfo.moduleName); auto moduleRecord = appRecord->GetModuleRecordByModuleName(appInfo->bundleName, hapModuleInfo.moduleName); if (!moduleRecord) { - APP_LOGD("module record is nullptr, add modules"); + HILOG_DEBUG("module record is nullptr, add modules"); appRecord->AddModules(appInfo, hapModules); appRecord->AddAbilityStageBySpecifiedAbility(appInfo->bundleName); } else { - APP_LOGD("schedule accept want"); + HILOG_DEBUG("schedule accept want"); appRecord->ScheduleAcceptWant(hapModuleInfo.moduleName); } } @@ -2130,14 +2131,14 @@ void AppMgrServiceInner::StartSpecifiedAbility(const AAFwk::Want &want, const Ap void AppMgrServiceInner::RegisterStartSpecifiedAbilityResponse(const sptr &response) { if (!response) { - APP_LOGE("response is nullptr, register failed."); + HILOG_ERROR("response is nullptr, register failed."); return; } pid_t callingPid = IPCSkeleton::GetCallingPid(); pid_t pid = getpid(); if (callingPid != pid) { - APP_LOGE("%{public}s: Not abilityMgr call.", __func__); + HILOG_ERROR("%{public}s: Not abilityMgr call.", __func__); return; } @@ -2147,11 +2148,11 @@ void AppMgrServiceInner::RegisterStartSpecifiedAbilityResponse(const sptrScheduleAcceptWantDone(); @@ -2163,15 +2164,15 @@ void AppMgrServiceInner::ScheduleAcceptWantDone( void AppMgrServiceInner::HandleStartSpecifiedAbilityTimeOut(const int64_t eventId) { - APP_LOGD("called start specified ability time out!"); + HILOG_DEBUG("called start specified ability time out!"); if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is nullptr"); + HILOG_ERROR("appRunningManager_ is nullptr"); return; } auto appRecord = appRunningManager_->GetAppRunningRecord(eventId); if (!appRecord) { - APP_LOGE("appRecord is nullptr"); + HILOG_ERROR("appRecord is nullptr"); return; } @@ -2185,14 +2186,14 @@ void AppMgrServiceInner::HandleStartSpecifiedAbilityTimeOut(const int64_t eventI void AppMgrServiceInner::UpdateConfiguration(const Configuration &config) { if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is null"); + HILOG_ERROR("appRunningManager_ is null"); return; } std::vector changeKeyV; configuration_->CompareDifferent(changeKeyV, config); int size = changeKeyV.size(); - APP_LOGI("changeKeyV size :%{public}d", size); + HILOG_INFO("changeKeyV size :%{public}d", size); if (!changeKeyV.empty()) { configuration_->Merge(changeKeyV, config); // all app @@ -2203,16 +2204,16 @@ void AppMgrServiceInner::UpdateConfiguration(const Configuration &config) void AppMgrServiceInner::GetGlobalConfiguration() { if (!configuration_) { - APP_LOGE("configuration_ is null"); + HILOG_ERROR("configuration_ is null"); return; } // Currently only this interface is known auto language = OHOS::Global::I18n::LocaleConfig::GetSystemLanguage(); - APP_LOGI("current global language is : %{public}s", language.c_str()); + HILOG_INFO("current global language is : %{public}s", language.c_str()); configuration_->AddItem(GlobalConfigurationKey::SYSTEM_LANGUAGE, language); // Assign to default colormode "light" - APP_LOGI("current global colormode is : %{public}s", ConfigurationInner::COLOR_MODE_LIGHT.c_str()); + HILOG_INFO("current global colormode is : %{public}s", ConfigurationInner::COLOR_MODE_LIGHT.c_str()); configuration_->AddItem(GlobalConfigurationKey::SYSTEM_COLORMODE, ConfigurationInner::COLOR_MODE_LIGHT); } @@ -2223,10 +2224,10 @@ std::shared_ptr AppMgrServiceInner::GetConfiguration( void AppMgrServiceInner::KillApplicationByRecord(const std::shared_ptr &appRecord) { - APP_LOGD("Kill application by appRecord."); + HILOG_DEBUG("Kill application by appRecord."); if (!appRecord) { - APP_LOGD("appRecord is nullptr."); + HILOG_DEBUG("appRecord is nullptr."); return; } @@ -2237,27 +2238,27 @@ void AppMgrServiceInner::KillApplicationByRecord(const std::shared_ptr pids = {pid}; if (WaitForRemoteProcessExit(pids, startTime)) { - APP_LOGD("The remote process exited successfully"); + HILOG_DEBUG("The remote process exited successfully"); return; } auto result = KillProcessByPid(pid); if (result < 0) { - APP_LOGE("Kill application by app record, pid: %{public}d", pid); + HILOG_ERROR("Kill application by app record, pid: %{public}d", pid); } } void AppMgrServiceInner::SendHiSysEvent(const int32_t innerEventId, const int64_t eventId) { - APP_LOGD("called AppMgrServiceInner SendHiSysEvent!"); + HILOG_DEBUG("called AppMgrServiceInner SendHiSysEvent!"); if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is nullptr"); + HILOG_ERROR("appRunningManager_ is nullptr"); return; } auto appRecord = appRunningManager_->GetAppRunningRecord(eventId); if (!appRecord) { - APP_LOGE("appRecord is nullptr"); + HILOG_ERROR("appRecord is nullptr"); return; } @@ -2288,7 +2289,7 @@ void AppMgrServiceInner::SendHiSysEvent(const int32_t innerEventId, const int64_ break; } - APP_LOGD("SendHiSysEvent, eventName = %{public}s, uidStr = %{public}s, pidStr = %{public}s, \ + HILOG_DEBUG("SendHiSysEvent, eventName = %{public}s, uidStr = %{public}s, pidStr = %{public}s, \ packageName = %{public}s, processName = %{public}s, msg = %{public}s", eventName.c_str(), uidStr.c_str(), @@ -2312,7 +2313,7 @@ int AppMgrServiceInner::GetAbilityRecordsByProcessID(const int pid, std::vector< { auto appRecord = GetAppRunningRecordByPid(pid); if (!appRecord) { - APP_LOGE("no such appRecord"); + HILOG_ERROR("no such appRecord"); return ERR_NAME_NOT_FOUND; } for (auto &item : appRecord->GetAbilities()) { @@ -2330,10 +2331,10 @@ int AppMgrServiceInner::VerifyProcessPermission() auto isCallingPerm = AAFwk::PermissionVerification::GetInstance()->VerifyCallingPermission( AAFwk::PermissionConstants::PERMISSION_CLEAN_BACKGROUND_PROCESSES); if (isCallingPerm) { - APP_LOGE("%{public}s: Permission verification succeeded", __func__); + HILOG_ERROR("%{public}s: Permission verification succeeded", __func__); return ERR_OK; } - APP_LOGE("%{public}s: Permission verification failed", __func__); + HILOG_ERROR("%{public}s: Permission verification failed", __func__); return ERR_PERMISSION_DENIED; } @@ -2349,16 +2350,16 @@ int AppMgrServiceInner::VerifyAccountPermission(const std::string &permissionNam auto isCallingPermAccount = AAFwk::PermissionVerification::GetInstance()->VerifyCallingPermission( AAFwk::PermissionConstants::PERMISSION_INTERACT_ACROSS_LOCAL_ACCOUNTS); if (!isCallingPermAccount) { - APP_LOGE("%{public}s: Permission accounts verification failed", __func__); + HILOG_ERROR("%{public}s: Permission accounts verification failed", __func__); return ERR_PERMISSION_DENIED; } } auto isCallingPerm = AAFwk::PermissionVerification::GetInstance()->VerifyCallingPermission(permissionName); if (isCallingPerm) { - APP_LOGD("%{public}s: Permission verification succeeded", __func__); + HILOG_DEBUG("%{public}s: Permission verification succeeded", __func__); return ERR_OK; } - APP_LOGE("%{public}s: Permission verification failed", __func__); + HILOG_ERROR("%{public}s: Permission verification failed", __func__); return ERR_PERMISSION_DENIED; } @@ -2371,44 +2372,44 @@ int AppMgrServiceInner::VerifyObserverPermission() auto isCallingPerm = AAFwk::PermissionVerification::GetInstance()->VerifyCallingPermission( AAFwk::PermissionConstants::PERMISSION_RUNNING_STATE_OBSERVER); if (isCallingPerm) { - APP_LOGE("%{public}s: Permission verification succeeded", __func__); + HILOG_ERROR("%{public}s: Permission verification succeeded", __func__); return ERR_OK; } - APP_LOGE("%{public}s: Permission verification failed", __func__); + HILOG_ERROR("%{public}s: Permission verification failed", __func__); return ERR_PERMISSION_DENIED; } int AppMgrServiceInner::StartRenderProcess(const pid_t hostPid, const std::string &renderParam, int32_t ipcFd, int32_t sharedFd, pid_t &renderPid) { - APP_LOGI("start render process, nweb hostpid:%{public}d", hostPid); + HILOG_INFO("start render process, nweb hostpid:%{public}d", hostPid); if (hostPid <= 0 || renderParam.empty() || ipcFd <= 0 || sharedFd <= 0) { - APP_LOGE("invalid param, hostPid:%{public}d, renderParam:%{public}s, ipcFd:%{public}d, sharedFd:%{public}d", + HILOG_ERROR("invalid param, hostPid:%{public}d, renderParam:%{public}s, ipcFd:%{public}d, sharedFd:%{public}d", hostPid, renderParam.c_str(), ipcFd, sharedFd); return ERR_INVALID_VALUE; } if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is , not start render process"); + HILOG_ERROR("appRunningManager_ is , not start render process"); return ERR_INVALID_VALUE; } auto appRecord = GetAppRunningRecordByPid(hostPid); if (!appRecord) { - APP_LOGE("no such appRecord, hostpid:%{public}d", hostPid); + HILOG_ERROR("no such appRecord, hostpid:%{public}d", hostPid); return ERR_INVALID_VALUE; } auto renderRecord = appRecord->GetRenderRecord(); if (renderRecord) { - APP_LOGW("already exit render process,do not request again, renderPid:%{public}d", renderRecord->GetPid()); + HILOG_WARN("already exit render process,do not request again, renderPid:%{public}d", renderRecord->GetPid()); renderPid = renderRecord->GetPid(); return ERR_ALREADY_EXIST_RENDER; } renderRecord = RenderRecord::CreateRenderRecord(hostPid, renderParam, ipcFd, sharedFd, appRecord); if (!renderRecord) { - APP_LOGE("create render record failed, hostpid:%{public}d", hostPid); + HILOG_ERROR("create render record failed, hostpid:%{public}d", hostPid); return ERR_INVALID_VALUE; } @@ -2417,31 +2418,31 @@ int AppMgrServiceInner::StartRenderProcess(const pid_t hostPid, const std::strin void AppMgrServiceInner::AttachRenderProcess(const pid_t pid, const sptr &scheduler) { - APP_LOGD("attach render process start"); + HILOG_DEBUG("attach render process start"); if (pid <= 0) { - APP_LOGE("invalid render process pid:%{public}d", pid); + HILOG_ERROR("invalid render process pid:%{public}d", pid); return; } if (!scheduler) { - APP_LOGE("render scheduler is null"); + HILOG_ERROR("render scheduler is null"); return; } if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is null"); + HILOG_ERROR("appRunningManager_ is null"); return; } - APP_LOGI("attach render process pid:%{public}d", pid); + HILOG_INFO("attach render process pid:%{public}d", pid); auto appRecord = appRunningManager_->GetAppRunningRecordByRenderPid(pid); if (!appRecord) { - APP_LOGE("no such app Record, pid:%{public}d", pid); + HILOG_ERROR("no such app Record, pid:%{public}d", pid); return; } auto renderRecord = appRecord->GetRenderRecord(); if (!renderRecord) { - APP_LOGE("no such render Record, pid:%{public}d", pid); + HILOG_ERROR("no such render Record, pid:%{public}d", pid); return; } @@ -2461,13 +2462,13 @@ int AppMgrServiceInner::StartRenderProcessImpl(const std::shared_ptr appRecord, pid_t &renderPid) { if (!renderRecord || !appRecord) { - APP_LOGE("renderRecord or appRecord is nullptr."); + HILOG_ERROR("renderRecord or appRecord is nullptr."); return ERR_INVALID_VALUE; } auto nwebSpawnClient = remoteClientManager_->GetNWebSpawnClient(); if (!nwebSpawnClient) { - APP_LOGE("nwebSpawnClient is null"); + HILOG_ERROR("nwebSpawnClient is null"); return ERR_INVALID_VALUE; } @@ -2476,20 +2477,20 @@ int AppMgrServiceInner::StartRenderProcessImpl(const std::shared_ptrStartProcess(startMsg, pid); if (FAILED(errCode)) { - APP_LOGE("failed to spawn new render process, errCode %{public}08x", errCode); + HILOG_ERROR("failed to spawn new render process, errCode %{public}08x", errCode); return ERR_INVALID_VALUE; } renderPid = pid; appRecord->SetRenderRecord(renderRecord); renderRecord->SetPid(pid); - APP_LOGI("start render process successed, hostPid:%{public}d, pid:%{public}d uid:%{public}d", + HILOG_INFO("start render process successed, hostPid:%{public}d, pid:%{public}d uid:%{public}d", renderRecord->GetHostPid(), pid, startMsg.uid); return 0; } void AppMgrServiceInner::OnRenderRemoteDied(const wptr &remote) { - APP_LOGE("On render remote died."); + HILOG_ERROR("On render remote died."); if (appRunningManager_) { appRunningManager_->OnRemoteRenderDied(remote); } diff --git a/services/appmgr/src/app_process_manager.cpp b/services/appmgr/src/app_process_manager.cpp index e3786b3d8d..64dae4679f 100644 --- a/services/appmgr/src/app_process_manager.cpp +++ b/services/appmgr/src/app_process_manager.cpp @@ -16,7 +16,7 @@ #include "app_process_manager.h" #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/services/appmgr/src/app_running_manager.cpp b/services/appmgr/src/app_running_manager.cpp index 4fa10a2710..2442dd1a0b 100644 --- a/services/appmgr/src/app_running_manager.cpp +++ b/services/appmgr/src/app_running_manager.cpp @@ -18,8 +18,8 @@ #include "datetime_ex.h" #include "iremote_object.h" -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" +#include "hilog_wrapper.h" #include "os_account_manager.h" #include "perf_profile.h" @@ -35,12 +35,12 @@ std::shared_ptr AppRunningManager::CreateAppRunningRecord( { std::lock_guard guard(lock_); if (!appInfo) { - APP_LOGE("param error"); + HILOG_ERROR("param error"); return nullptr; } if (processName.empty()) { - APP_LOGE("processName error"); + HILOG_ERROR("processName error"); return nullptr; } @@ -54,7 +54,7 @@ std::shared_ptr AppRunningManager::CreateAppRunningRecord( std::string signCode; ClipStringContent(rule, bundleInfo.appId, signCode); - APP_LOGI("Create processName : %{public}s | recordId : %{public}d | signCode : %{public}s", + HILOG_INFO("Create processName : %{public}s | recordId : %{public}d | signCode : %{public}s", processName.c_str(), recordId, signCode.c_str()); appRecord->SetSignCode(signCode); appRecord->SetJointUserId(bundleInfo.jointUserId); @@ -65,14 +65,14 @@ std::shared_ptr AppRunningManager::CreateAppRunningRecord( std::shared_ptr AppRunningManager::CheckAppRunningRecordIsExist(const std::string &appName, const std::string &processName, const int uid, const BundleInfo &bundleInfo) { - APP_LOGI("CheckAppRunningRecordIsExist appName : %{public}s | processName : %{public}s | uid : %{public}d", + HILOG_INFO("CheckAppRunningRecordIsExist appName : %{public}s | processName : %{public}s | uid : %{public}d", appName.c_str(), processName.c_str(), uid); std::lock_guard guard(lock_); std::regex rule("[a-zA-Z.]+[-_#]{1}"); std::string signCode; auto jointUserId = bundleInfo.jointUserId; - APP_LOGI("jointUserId : %{public}s", jointUserId.c_str()); + HILOG_INFO("jointUserId : %{public}s", jointUserId.c_str()); ClipStringContent(rule, bundleInfo.appId, signCode); auto FindSameProcess = [signCode, processName, jointUserId](const auto &pair) { @@ -87,11 +87,11 @@ std::shared_ptr AppRunningManager::CheckAppRunningRecordIsExis for (const auto &item : appRunningRecordMap_) { const auto &appRecord = item.second; if (appRecord && appRecord->GetProcessName() == processName && !(appRecord->IsTerminating())) { - APP_LOGI("appRecord->GetProcessName() : %{public}s", appRecord->GetProcessName().c_str()); + HILOG_INFO("appRecord->GetProcessName() : %{public}s", appRecord->GetProcessName().c_str()); auto appInfoList = appRecord->GetAppInfoList(); - APP_LOGI("appInfoList : %{public}zu", appInfoList.size()); + HILOG_INFO("appInfoList : %{public}zu", appInfoList.size()); auto isExist = [&appName, &uid](const std::shared_ptr &appInfo) { - APP_LOGI("appInfo->name : %{public}s", appInfo->name.c_str()); + HILOG_INFO("appInfo->name : %{public}s", appInfo->name.c_str()); return appInfo->name == appName && appInfo->uid == uid; }; auto appInfoIter = std::find_if(appInfoList.begin(), appInfoList.end(), isExist); @@ -123,7 +123,7 @@ std::shared_ptr AppRunningManager::GetAppRunningRecordByAbilit for (const auto &item : appRunningRecordMap_) { const auto &appRecord = item.second; if (appRecord && appRecord->GetAbilityRunningRecordByToken(abilityToken)) { - APP_LOGI("appRecord is exit"); + HILOG_INFO("appRecord is exit"); return appRecord; } } @@ -202,12 +202,12 @@ std::shared_ptr AppRunningManager::OnRemoteDied(const wptr guard(lock_); if (remote == nullptr) { - APP_LOGE("remote is null"); + HILOG_ERROR("remote is null"); return nullptr; } sptr object = remote.promote(); if (!object) { - APP_LOGE("object is null"); + HILOG_ERROR("object is null"); return nullptr; } const auto &iter = @@ -218,7 +218,7 @@ std::shared_ptr AppRunningManager::OnRemoteDied(const wptrsecond; @@ -249,16 +249,16 @@ void AppRunningManager::ClearAppRunningRecordMap() void AppRunningManager::HandleTerminateTimeOut(int64_t eventId) { - APP_LOGI("Handle terminate timeout."); + HILOG_INFO("Handle terminate timeout."); auto abilityRecord = GetAbilityRunningRecord(eventId); if (!abilityRecord) { - APP_LOGE("abilityRecord is nullptr."); + HILOG_ERROR("abilityRecord is nullptr."); return; } auto abilityToken = abilityRecord->GetToken(); auto appRecord = GetTerminatingAppRunningRecord(abilityToken); if (!appRecord) { - APP_LOGE("appRecord is nullptr."); + HILOG_ERROR("appRecord is nullptr."); return; } appRecord->AbilityTerminated(abilityToken); @@ -279,7 +279,7 @@ std::shared_ptr AppRunningManager::GetTerminatingAppRunningRec std::shared_ptr AppRunningManager::GetAbilityRunningRecord(const int64_t eventId) { - APP_LOGI("Get ability running record by eventId."); + HILOG_INFO("Get ability running record by eventId."); std::lock_guard guard(lock_); for (auto &item : appRunningRecordMap_) { if (item.second) { @@ -294,7 +294,7 @@ std::shared_ptr AppRunningManager::GetAbilityRunningRecord std::shared_ptr AppRunningManager::GetAppRunningRecord(const int64_t eventId) { - APP_LOGI("Get app running record by eventId."); + HILOG_INFO("Get app running record by eventId."); std::lock_guard guard(lock_); auto iter = std::find_if(appRunningRecordMap_.begin(), appRunningRecordMap_.end(), [&eventId](const auto &pair) { return pair.second->GetEventId() == eventId; @@ -304,15 +304,15 @@ std::shared_ptr AppRunningManager::GetAppRunningRecord(const i void AppRunningManager::HandleAbilityAttachTimeOut(const sptr &token) { - APP_LOGI("Handle ability attach timeOut."); + HILOG_INFO("Handle ability attach timeOut."); if (token == nullptr) { - APP_LOGE("token is nullptr."); + HILOG_ERROR("token is nullptr."); return; } auto appRecord = GetAppRunningRecordByAbilityToken(token); if (!appRecord) { - APP_LOGE("appRecord is nullptr."); + HILOG_ERROR("appRecord is nullptr."); return; } @@ -330,15 +330,15 @@ void AppRunningManager::HandleAbilityAttachTimeOut(const sptr &to void AppRunningManager::PrepareTerminate(const sptr &token) { - APP_LOGI("Prepare terminate."); + HILOG_INFO("Prepare terminate."); if (token == nullptr) { - APP_LOGE("token is nullptr."); + HILOG_ERROR("token is nullptr."); return; } auto appRecord = GetAppRunningRecordByAbilityToken(token); if (!appRecord) { - APP_LOGE("appRecord is nullptr."); + HILOG_ERROR("appRecord is nullptr."); return; } @@ -349,15 +349,15 @@ void AppRunningManager::PrepareTerminate(const sptr &token) void AppRunningManager::TerminateAbility(const sptr &token) { - APP_LOGI("Terminate ability."); + HILOG_INFO("Terminate ability."); if (!token) { - APP_LOGE("token is nullptr."); + HILOG_ERROR("token is nullptr."); return; } auto appRecord = GetAppRunningRecordByAbilityToken(token); if (!appRecord) { - APP_LOGE("appRecord is nullptr."); + HILOG_ERROR("appRecord is nullptr."); return; } @@ -374,7 +374,7 @@ void AppRunningManager::GetRunningProcessInfoByToken( std::lock_guard guard(lock_); auto appRecord = GetAppRunningRecordByAbilityToken(token); if (!appRecord) { - APP_LOGE("appRecord is nullptr"); + HILOG_ERROR("appRecord is nullptr"); return; } @@ -388,15 +388,15 @@ void AppRunningManager::ClipStringContent(const std::regex &re, const std::strin { std::smatch basket; if (std::regex_search(sorce, basket, re)) { - APP_LOGI("prefix str: [%{public}s]", basket.prefix().str().c_str()); - APP_LOGI("suffix str: [%{public}s]", basket.suffix().str().c_str()); + HILOG_INFO("prefix str: [%{public}s]", basket.prefix().str().c_str()); + HILOG_INFO("suffix str: [%{public}s]", basket.suffix().str().c_str()); afferCutStr = basket.prefix().str() + basket.suffix().str(); } } void AppRunningManager::GetForegroundApplications(std::vector &list) { - APP_LOGI("%{public}s, begin.", __func__); + HILOG_INFO("%{public}s, begin.", __func__); std::lock_guard guard(lock_); for (const auto &item : appRunningRecordMap_) { const auto &appRecord = item.second; @@ -406,24 +406,24 @@ void AppRunningManager::GetForegroundApplications(std::vector &lis appData.uid = appRecord->GetUid(); appData.state = static_cast(ApplicationState::APP_STATE_FOREGROUND); list.push_back(appData); - APP_LOGI("%{public}s, bundleName:%{public}s", __func__, appData.bundleName.c_str()); + HILOG_INFO("%{public}s, bundleName:%{public}s", __func__, appData.bundleName.c_str()); } } } void AppRunningManager::HandleAddAbilityStageTimeOut(const int64_t eventId) { - APP_LOGD("Handle add ability stage timeout."); + HILOG_DEBUG("Handle add ability stage timeout."); auto abilityRecord = GetAbilityRunningRecord(eventId); if (!abilityRecord) { - APP_LOGE("abilityRecord is nullptr"); + HILOG_ERROR("abilityRecord is nullptr"); return; } auto abilityToken = abilityRecord->GetToken(); auto appRecord = GetTerminatingAppRunningRecord(abilityToken); if (!appRecord) { - APP_LOGE("appRecord is nullptr"); + HILOG_ERROR("appRecord is nullptr"); return; } @@ -432,17 +432,17 @@ void AppRunningManager::HandleAddAbilityStageTimeOut(const int64_t eventId) void AppRunningManager::HandleStartSpecifiedAbilityTimeOut(const int64_t eventId) { - APP_LOGD("Handle receive multi instances timeout."); + HILOG_DEBUG("Handle receive multi instances timeout."); auto abilityRecord = GetAbilityRunningRecord(eventId); if (!abilityRecord) { - APP_LOGE("abilityRecord is nullptr"); + HILOG_ERROR("abilityRecord is nullptr"); return; } auto abilityToken = abilityRecord->GetToken(); auto appRecord = GetTerminatingAppRunningRecord(abilityToken); if (!appRecord) { - APP_LOGE("appRecord is nullptr"); + HILOG_ERROR("appRecord is nullptr"); return; } @@ -451,13 +451,13 @@ void AppRunningManager::HandleStartSpecifiedAbilityTimeOut(const int64_t eventId void AppRunningManager::UpdateConfiguration(const Configuration &config) { - APP_LOGI("call %{public}s", __func__); + HILOG_INFO("call %{public}s", __func__); std::lock_guard guard(lock_); - APP_LOGI("current app size %{public}d", static_cast(appRunningRecordMap_.size())); + HILOG_INFO("current app size %{public}d", static_cast(appRunningRecordMap_.size())); for (const auto &item : appRunningRecordMap_) { const auto &appRecord = item.second; if (appRecord) { - APP_LOGI("Notification app [%{public}s]", appRecord->GetName().c_str()); + HILOG_INFO("Notification app [%{public}s]", appRecord->GetName().c_str()); appRecord->UpdateConfiguration(config); } } @@ -477,12 +477,12 @@ void AppRunningManager::OnRemoteRenderDied(const wptr &remote) { std::lock_guard guard(lock_); if (remote == nullptr) { - APP_LOGE("remote is null"); + HILOG_ERROR("remote is null"); return; } sptr object = remote.promote(); if (!object) { - APP_LOGE("promote failed."); + HILOG_ERROR("promote failed."); return; } diff --git a/services/appmgr/src/app_running_record.cpp b/services/appmgr/src/app_running_record.cpp index e24b9884a3..01822e7c72 100644 --- a/services/appmgr/src/app_running_record.cpp +++ b/services/appmgr/src/app_running_record.cpp @@ -14,9 +14,9 @@ */ #include "app_running_record.h" -#include "app_log_wrapper.h" #include "app_mgr_service_inner.h" #include "bytrace.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -39,7 +39,7 @@ std::shared_ptr RenderRecord::CreateRenderRecord(pid_t hostPid, co auto renderRecord = std::make_shared(hostPid, renderParam, ipcFd, sharedFd, host); if (!renderRecord) { - APP_LOGE("create render record failed, hostPid:%{public}d.", hostPid); + HILOG_ERROR("create render record failed, hostPid:%{public}d.", hostPid); return nullptr; } @@ -128,7 +128,7 @@ void AppRunningRecord::SetApplicationClient(const sptr &thread) auto moduleRecordList = GetAllModuleRecord(); if (moduleRecordList.empty()) { - APP_LOGE("moduleRecordList is empty"); + HILOG_ERROR("moduleRecordList is empty"); return; } for (const auto &moduleRecord : moduleRecordList) { @@ -204,7 +204,7 @@ ApplicationState AppRunningRecord::GetState() const void AppRunningRecord::SetState(const ApplicationState state) { if (state >= ApplicationState::APP_STATE_END) { - APP_LOGE("Invalid application state"); + HILOG_ERROR("Invalid application state"); return; } curState_ = state; @@ -242,7 +242,7 @@ sptr AppRunningRecord::GetApplicationClient() const std::shared_ptr AppRunningRecord::GetAbilityRunningRecord(const std::string &abilityName) const { - APP_LOGI("Get ability running record by ability name."); + HILOG_INFO("Get ability running record by ability name."); auto moduleRecordList = GetAllModuleRecord(); for (const auto &moduleRecord : moduleRecordList) { auto abilityRecord = moduleRecord->GetAbilityRunningRecord(abilityName); @@ -256,7 +256,7 @@ std::shared_ptr AppRunningRecord::GetAbilityRunningRecord( std::shared_ptr AppRunningRecord::GetAbilityRunningRecord(const int64_t eventId) const { - APP_LOGI("Get ability running record by eventId."); + HILOG_INFO("Get ability running record by eventId."); auto moduleRecordList = GetAllModuleRecord(); for (const auto &moduleRecord : moduleRecordList) { auto abilityRecord = moduleRecord->GetAbilityRunningRecord(eventId); @@ -271,13 +271,13 @@ std::shared_ptr AppRunningRecord::GetAbilityRunningRecord( void AppRunningRecord::ClearAbility(const std::shared_ptr &record) { if (!record) { - APP_LOGE("Param record is null"); + HILOG_ERROR("Param record is null"); return; } auto moduleRecord = GetModuleRunningRecordByToken(record->GetToken()); if (!moduleRecord) { - APP_LOGE("moduleRecord is not exit"); + HILOG_ERROR("moduleRecord is not exit"); return; } @@ -290,7 +290,7 @@ void AppRunningRecord::ClearAbility(const std::shared_ptr void AppRunningRecord::RemoveModuleRecord(const std::shared_ptr &moudleRecord) { - APP_LOGI("Remove module record."); + HILOG_INFO("Remove module record."); for (auto &item : hapModules_) { auto iter = std::find_if(item.second.begin(), @@ -317,11 +317,11 @@ void AppRunningRecord::LaunchApplication(const Configuration &config) { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); if (appLifeCycleDeal_ == nullptr) { - APP_LOGE("appLifeCycleDeal_ is null"); + HILOG_ERROR("appLifeCycleDeal_ is null"); return; } if (!appLifeCycleDeal_->GetApplicationClient()) { - APP_LOGE("appThread is null"); + HILOG_ERROR("appThread is null"); return; } AppLaunchData launchData; @@ -334,26 +334,26 @@ void AppRunningRecord::LaunchApplication(const Configuration &config) launchData.SetRecordId(appRecordId_); launchData.SetUId(mainUid_); launchData.SetUserTestInfo(userTestRecord_); - APP_LOGI("ScheduleLaunchApplication app:%{public}s", GetName().c_str()); + HILOG_INFO("ScheduleLaunchApplication app:%{public}s", GetName().c_str()); appLifeCycleDeal_->LaunchApplication(launchData, config); } void AppRunningRecord::AddAbilityStage() { if (!isNewMission_) { - APP_LOGI("Current version than supports !"); + HILOG_INFO("Current version than supports !"); return; } HapModuleInfo abilityStage; if (GetTheModuleInfoNeedToUpdated(mainBundleName_, abilityStage)) { SendEvent(AMSEventHandler::ADD_ABILITY_STAGE_INFO_TIMEOUT_MSG, AMSEventHandler::ADD_ABILITY_STAGE_INFO_TIMEOUT); - APP_LOGI("Current Informed module : [%{public}s] | bundle : [%{public}s]", + HILOG_INFO("Current Informed module : [%{public}s] | bundle : [%{public}s]", abilityStage.moduleName.c_str(), mainBundleName_.c_str()); appLifeCycleDeal_->AddAbilityStage(abilityStage); return; } - APP_LOGI("The current process[%{public}s] is updated", processName_.c_str()); + HILOG_INFO("The current process[%{public}s] is updated", processName_.c_str()); } void AppRunningRecord::AddAbilityStageBySpecifiedAbility(const std::string &bundleName) @@ -364,7 +364,8 @@ void AppRunningRecord::AddAbilityStageBySpecifiedAbility(const std::string &bund SendEvent(AMSEventHandler::ADD_ABILITY_STAGE_INFO_TIMEOUT_MSG, AMSEventHandler::ADD_ABILITY_STAGE_INFO_TIMEOUT); } else { - APP_LOGI("%{public}s START_PROCESS_SPECIFIED_ABILITY_TIMEOUT_MSG is exist, don't set new event.", __func__); + HILOG_INFO( + "%{public}s START_PROCESS_SPECIFIED_ABILITY_TIMEOUT_MSG is exist, don't set new event.", __func__); } appLifeCycleDeal_->AddAbilityStage(hapModuleInfo); } @@ -372,7 +373,7 @@ void AppRunningRecord::AddAbilityStageBySpecifiedAbility(const std::string &bund void AppRunningRecord::AddAbilityStageDone() { - APP_LOGI("Add ability stage done. bundle %{public}s and eventId %{public}d", mainBundleName_.c_str(), + HILOG_INFO("Add ability stage done. bundle %{public}s and eventId %{public}d", mainBundleName_.c_str(), static_cast(eventId_)); if (eventHandler_->HasInnerEvent(AMSEventHandler::START_PROCESS_SPECIFIED_ABILITY_TIMEOUT_MSG)) { eventHandler_->RemoveEvent(AMSEventHandler::START_PROCESS_SPECIFIED_ABILITY_TIMEOUT_MSG); @@ -395,17 +396,17 @@ void AppRunningRecord::LaunchAbility(const std::shared_ptr { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); if (appLifeCycleDeal_ == nullptr) { - APP_LOGE("appLifeCycleDeal_ is null"); + HILOG_ERROR("appLifeCycleDeal_ is null"); return; } if (!ability || !ability->GetToken()) { - APP_LOGE("abilityRecord or abilityToken is nullptr."); + HILOG_ERROR("abilityRecord or abilityToken is nullptr."); return; } auto moduleRecord = GetModuleRunningRecordByToken(ability->GetToken()); if (!moduleRecord) { - APP_LOGE("moduleRecord is nullptr"); + HILOG_ERROR("moduleRecord is nullptr"); return; } @@ -422,11 +423,11 @@ void AppRunningRecord::ScheduleTerminate() void AppRunningRecord::LaunchPendingAbilities() { - APP_LOGI("Launch pending abilities."); + HILOG_INFO("Launch pending abilities."); auto moduleRecordList = GetAllModuleRecord(); if (moduleRecordList.empty()) { - APP_LOGE("moduleRecordList is empty"); + HILOG_ERROR("moduleRecordList is empty"); return; } for (const auto &moduleRecord : moduleRecordList) { @@ -472,10 +473,10 @@ void AppRunningRecord::LowMemoryWarning() void AppRunningRecord::AddModules( const std::shared_ptr &appInfo, const std::vector &moduleInfos) { - APP_LOGI("Add modules"); + HILOG_INFO("Add modules"); if (moduleInfos.empty()) { - APP_LOGI("moduleInfos is empty."); + HILOG_INFO("moduleInfos is empty."); return; } @@ -488,10 +489,10 @@ void AppRunningRecord::AddModule(const std::shared_ptr &appInfo const std::shared_ptr &abilityInfo, const sptr &token, const HapModuleInfo &hapModuleInfo, const std::shared_ptr &want) { - APP_LOGI("Add module."); + HILOG_INFO("Add module."); if (!appInfo) { - APP_LOGE("appInfo is null"); + HILOG_ERROR("appInfo is null"); return; } @@ -521,7 +522,7 @@ void AppRunningRecord::AddModule(const std::shared_ptr &appInfo } if (!abilityInfo || !token) { - APP_LOGE("abilityinfo or token is nullptr"); + HILOG_ERROR("abilityinfo or token is nullptr"); return; } moduleRecord->AddAbility(token, abilityInfo, want); @@ -532,7 +533,7 @@ void AppRunningRecord::AddModule(const std::shared_ptr &appInfo std::shared_ptr AppRunningRecord::GetModuleRecordByModuleName( const std::string bundleName, const std::string &moduleName) { - APP_LOGI("Get module record by module name."); + HILOG_INFO("Get module record by module name."); auto moduleRecords = hapModules_.find(bundleName); if (moduleRecords != hapModules_.end()) { for (auto &iter : moduleRecords->second) { @@ -549,7 +550,7 @@ void AppRunningRecord::StateChangedNotifyObserver( const std::shared_ptr &ability, const int32_t state, bool isAbility) { if (!ability) { - APP_LOGE("ability is null"); + HILOG_ERROR("ability is null"); return; } AbilityStateData abilityStateData; @@ -563,7 +564,7 @@ void AppRunningRecord::StateChangedNotifyObserver( if (isAbility && ability->GetAbilityInfo() != nullptr && ability->GetAbilityInfo()->type == AbilityType::EXTENSION) { - APP_LOGI("extension type, not notify any more."); + HILOG_INFO("extension type, not notify any more."); return; } auto serviceInner = appMgrServiceInner_.lock(); @@ -576,7 +577,7 @@ std::shared_ptr AppRunningRecord::GetModuleRunningRecordByT const sptr &token) const { if (!token) { - APP_LOGE("token is null"); + HILOG_ERROR("token is null"); return nullptr; } @@ -594,7 +595,7 @@ std::shared_ptr AppRunningRecord::GetModuleRunningRecordByT const sptr &token) const { if (!token) { - APP_LOGE("token is null"); + HILOG_ERROR("token is null"); return nullptr; } @@ -613,7 +614,7 @@ std::shared_ptr AppRunningRecord::GetAbilityRunningRecordB { auto moduleRecord = GetModuleRunningRecordByToken(token); if (!moduleRecord) { - APP_LOGE("moduleRecord is not exit"); + HILOG_ERROR("moduleRecord is not exit"); return nullptr; } return moduleRecord->GetAbilityRunningRecordByToken(token); @@ -624,7 +625,7 @@ std::shared_ptr AppRunningRecord::GetAbilityByTerminateLis { auto moduleRecord = GetModuleRunningRecordByTerminateLists(token); if (!moduleRecord) { - APP_LOGE("moduleRecord is not exit"); + HILOG_ERROR("moduleRecord is not exit"); return nullptr; } return moduleRecord->GetAbilityByTerminateLists(token); @@ -632,14 +633,14 @@ std::shared_ptr AppRunningRecord::GetAbilityByTerminateLis void AppRunningRecord::UpdateAbilityState(const sptr &token, const AbilityState state) { - APP_LOGI("state is :%{public}d", static_cast(state)); + HILOG_INFO("state is :%{public}d", static_cast(state)); auto abilityRecord = GetAbilityRunningRecordByToken(token); if (!abilityRecord) { - APP_LOGE("can not find ability record"); + HILOG_ERROR("can not find ability record"); return; } if (state == abilityRecord->GetState()) { - APP_LOGE("current state is already, no need update"); + HILOG_ERROR("current state is already, no need update"); return; } @@ -648,7 +649,7 @@ void AppRunningRecord::UpdateAbilityState(const sptr &token, cons } else if (state == AbilityState::ABILITY_STATE_BACKGROUND) { AbilityBackground(abilityRecord); } else { - APP_LOGW("wrong state"); + HILOG_WARN("wrong state"); } } @@ -656,13 +657,13 @@ void AppRunningRecord::AbilityForeground(const std::shared_ptrGetState(); if (curAbilityState != AbilityState::ABILITY_STATE_READY && curAbilityState != AbilityState::ABILITY_STATE_BACKGROUND) { - APP_LOGE("ability state(%{public}d) error", static_cast(curAbilityState)); + HILOG_ERROR("ability state(%{public}d) error", static_cast(curAbilityState)); return; } @@ -683,7 +684,7 @@ void AppRunningRecord::AbilityForeground(const std::shared_ptrOnAppStateChanged(shared_from_this(), curState_); } } else { - APP_LOGW("wrong application state"); + HILOG_WARN("wrong application state"); } } @@ -691,11 +692,11 @@ void AppRunningRecord::AbilityBackground(const std::shared_ptrGetState() != AbilityState::ABILITY_STATE_FOREGROUND) { - APP_LOGE("ability state is not foreground"); + HILOG_ERROR("ability state is not foreground"); return; } @@ -719,13 +720,13 @@ void AppRunningRecord::AbilityBackground(const std::shared_ptr(foregroundingAbilityTokens_.size())); + HILOG_INFO("size:%{public}d", static_cast(foregroundingAbilityTokens_.size())); while (!foregroundingAbilityTokens_.empty()) { const auto &token = foregroundingAbilityTokens_.front(); auto ability = GetAbilityRunningRecordByToken(token); @@ -738,26 +739,26 @@ void AppRunningRecord::PopForegroundingAbilityTokens() void AppRunningRecord::TerminateAbility(const sptr &token, const bool isForce) { - APP_LOGI("Terminate ability, isForce: %{public}d", static_cast(isForce)); + HILOG_INFO("Terminate ability, isForce: %{public}d", static_cast(isForce)); auto moduleRecord = GetModuleRunningRecordByToken(token); if (!moduleRecord) { - APP_LOGE("can not find module record"); + HILOG_ERROR("can not find module record"); return; } auto abilityRecord = GetAbilityRunningRecordByToken(token); StateChangedNotifyObserver(abilityRecord, static_cast(AbilityState::ABILITY_STATE_TERMINATED), true); moduleRecord->TerminateAbility(token, isForce); - APP_LOGI("AppRunningRecord::TerminateAbility end"); + HILOG_INFO("AppRunningRecord::TerminateAbility end"); } void AppRunningRecord::AbilityTerminated(const sptr &token) { - APP_LOGI("Ability terminated."); + HILOG_INFO("Ability terminated."); auto moduleRecord = GetModuleRunningRecordByTerminateLists(token); if (!moduleRecord) { - APP_LOGE("Can not find module record"); + HILOG_ERROR("Can not find module record"); return; } moduleRecord->AbilityTerminated(token); @@ -780,18 +781,18 @@ std::list> AppRunningRecord::GetAllModuleRe moduleRecordList.push_back(list); } } - APP_LOGI("GetAllModuleRecord size:%{public}zu", moduleRecordList.size()); + HILOG_INFO("GetAllModuleRecord size:%{public}zu", moduleRecordList.size()); return moduleRecordList; } void AppRunningRecord::RegisterAppDeathRecipient() const { if (appLifeCycleDeal_ == nullptr) { - APP_LOGE("appLifeCycleDeal_ is null"); + HILOG_ERROR("appLifeCycleDeal_ is null"); return; } if (!appLifeCycleDeal_->GetApplicationClient()) { - APP_LOGE("appThread is nullptr"); + HILOG_ERROR("appThread is nullptr"); return; } auto object = appLifeCycleDeal_->GetApplicationClient()->AsObject(); @@ -803,11 +804,11 @@ void AppRunningRecord::RegisterAppDeathRecipient() const void AppRunningRecord::RemoveAppDeathRecipient() const { if (appLifeCycleDeal_ == nullptr) { - APP_LOGE("appLifeCycleDeal_ is null"); + HILOG_ERROR("appLifeCycleDeal_ is null"); return; } if (!appLifeCycleDeal_->GetApplicationClient()) { - APP_LOGE("appThread is nullptr."); + HILOG_ERROR("appThread is nullptr."); return; } auto object = appLifeCycleDeal_->GetApplicationClient()->AsObject(); @@ -822,7 +823,7 @@ void AppRunningRecord::SetAppMgrServiceInner(const std::weak_ptr(eventId_)); + HILOG_INFO("eventId %{public}d", static_cast(eventId_)); eventHandler_->SendEvent(msg, appEventId_, timeOut); } @@ -881,13 +882,13 @@ void AppRunningRecord::SetEventHandler(const std::shared_ptr &h bool AppRunningRecord::IsLastAbilityRecord(const sptr &token) { if (!token) { - APP_LOGE("token is nullptr"); + HILOG_ERROR("token is nullptr"); return false; } auto moduleRecord = GetModuleRunningRecordByToken(token); if (!moduleRecord) { - APP_LOGE("can not find module record"); + HILOG_ERROR("can not find module record"); return false; } @@ -1003,7 +1004,7 @@ void AppRunningRecord::ScheduleAcceptWant(const std::string &moduleName) void AppRunningRecord::ScheduleAcceptWantDone() { - APP_LOGI("Schedule accept want done. bundle %{public}s and eventId %{public}d", mainBundleName_.c_str(), + HILOG_INFO("Schedule accept want done. bundle %{public}s and eventId %{public}d", mainBundleName_.c_str(), static_cast(eventId_)); eventHandler_->RemoveEvent(AMSEventHandler::START_SPECIFIED_ABILITY_TIMEOUT_MSG, eventId_); } @@ -1015,9 +1016,9 @@ const AAFwk::Want &AppRunningRecord::GetSpecifiedWant() const void AppRunningRecord::UpdateConfiguration(const Configuration &config) { - APP_LOGI("call %{public}s", __func__); + HILOG_INFO("call %{public}s", __func__); if (!appLifeCycleDeal_) { - APP_LOGI("appLifeCycleDeal_ is null"); + HILOG_INFO("appLifeCycleDeal_ is null"); return; } appLifeCycleDeal_->UpdateConfiguration(config); @@ -1045,7 +1046,7 @@ AppSpawnStartMsg AppRunningRecord::GetStartMsg() void AppRunningRecord::SetDebugApp(bool isDebugApp) { - APP_LOGI("SetDebugApp come, value is %{public}d", isDebugApp); + HILOG_INFO("SetDebugApp come, value is %{public}d", isDebugApp); isDebugApp_ = isDebugApp; } } // namespace AppExecFwk diff --git a/services/appmgr/src/app_spawn_client.cpp b/services/appmgr/src/app_spawn_client.cpp index ef3647cd62..34e5c104b0 100644 --- a/services/appmgr/src/app_spawn_client.cpp +++ b/services/appmgr/src/app_spawn_client.cpp @@ -15,8 +15,8 @@ #include "app_spawn_client.h" -#include "app_log_wrapper.h" #include "bytrace.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -35,14 +35,14 @@ ErrCode AppSpawnClient::OpenConnection() { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); if (!socket_) { - APP_LOGE("failed to open connection without socket!"); + HILOG_ERROR("failed to open connection without socket!"); return ERR_APPEXECFWK_BAD_APPSPAWN_SOCKET; } int32_t retryCount = 1; ErrCode errCode = socket_->OpenAppSpawnConnection(); while (FAILED(errCode) && retryCount <= CONNECT_RETRY_MAX_TIMES) { - APP_LOGW("failed to OpenConnection, retry times %{public}d ...", retryCount); + HILOG_WARN("failed to OpenConnection, retry times %{public}d ...", retryCount); usleep(CONNECT_RETRY_DELAY); errCode = socket_->OpenAppSpawnConnection(); retryCount++; @@ -50,7 +50,7 @@ ErrCode AppSpawnClient::OpenConnection() if (SUCCEEDED(errCode)) { state_ = SpawnConnectionState::STATE_CONNECTED; } else { - APP_LOGE("failed to openConnection, errorCode is %{public}08x", errCode); + HILOG_ERROR("failed to openConnection, errorCode is %{public}08x", errCode); state_ = SpawnConnectionState::STATE_CONNECT_FAILED; } return errCode; @@ -62,7 +62,7 @@ ErrCode AppSpawnClient::StartProcess(const AppSpawnStartMsg &startMsg, pid_t &pi int32_t retryCount = 1; ErrCode errCode = StartProcessImpl(startMsg, pid); while (FAILED(errCode) && retryCount <= CONNECT_RETRY_MAX_TIMES) { - APP_LOGW("failed to StartProcess, retry times %{public}d ...", retryCount); + HILOG_WARN("failed to StartProcess, retry times %{public}d ...", retryCount); usleep(CONNECT_RETRY_DELAY); errCode = StartProcessImpl(startMsg, pid); retryCount++; @@ -74,7 +74,7 @@ ErrCode AppSpawnClient::StartProcessImpl(const AppSpawnStartMsg &startMsg, pid_t { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); if (!socket_) { - APP_LOGE("failed to startProcess without socket!"); + HILOG_ERROR("failed to startProcess without socket!"); return ERR_APPEXECFWK_BAD_APPSPAWN_SOCKET; } @@ -83,7 +83,7 @@ ErrCode AppSpawnClient::StartProcessImpl(const AppSpawnStartMsg &startMsg, pid_t if (state_ != SpawnConnectionState::STATE_CONNECTED) { result = OpenConnection(); if (FAILED(result)) { - APP_LOGE("connect to appspawn failed!"); + HILOG_ERROR("connect to appspawn failed!"); return result; } } @@ -92,24 +92,24 @@ ErrCode AppSpawnClient::StartProcessImpl(const AppSpawnStartMsg &startMsg, pid_t AppSpawnMsgWrapper msgWrapper; if (!msgWrapper.AssembleMsg(startMsg)) { - APP_LOGE("AssembleMsg failed!"); + HILOG_ERROR("AssembleMsg failed!"); return ERR_APPEXECFWK_ASSEMBLE_START_MSG_FAILED; } AppSpawnPidMsg pidMsg; if (msgWrapper.IsValid()) { result = socket_->WriteMessage(msgWrapper.GetMsgBuf(), msgWrapper.GetMsgLength()); if (FAILED(result)) { - APP_LOGE("WriteMessage failed!"); + HILOG_ERROR("WriteMessage failed!"); return result; } result = socket_->ReadMessage(reinterpret_cast(pidMsg.pidBuf), LEN_PID); if (FAILED(result)) { - APP_LOGE("ReadMessage failed!"); + HILOG_ERROR("ReadMessage failed!"); return result; } } if (pidMsg.pid <= 0) { - APP_LOGE("invalid pid!"); + HILOG_ERROR("invalid pid!"); result = ERR_APPEXECFWK_INVALID_PID; } else { pid = pidMsg.pid; diff --git a/services/appmgr/src/app_spawn_msg_wrapper.cpp b/services/appmgr/src/app_spawn_msg_wrapper.cpp index 7b253e2b37..9c00b38c2f 100644 --- a/services/appmgr/src/app_spawn_msg_wrapper.cpp +++ b/services/appmgr/src/app_spawn_msg_wrapper.cpp @@ -17,7 +17,7 @@ #include "securec.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -35,11 +35,11 @@ bool AppSpawnMsgWrapper::AssembleMsg(const AppSpawnStartMsg &startMsg) int32_t msgSize = sizeof(AppSpawnMsg) + 1; msg_ = static_cast(malloc(msgSize)); if (msg_ == nullptr) { - APP_LOGE("failed to malloc!"); + HILOG_ERROR("failed to malloc!"); return false; } if (memset_s(msg_, msgSize, 0, msgSize) != EOK) { - APP_LOGE("failed to memset!"); + HILOG_ERROR("failed to memset!"); return false; } msg_->uid = startMsg.uid; @@ -49,25 +49,25 @@ bool AppSpawnMsgWrapper::AssembleMsg(const AppSpawnStartMsg &startMsg) msg_->gidTable[i] = startMsg.gids[i]; } if (strcpy_s(msg_->processName, sizeof(msg_->processName), startMsg.procName.c_str()) != EOK) { - APP_LOGE("failed to transform procName!"); + HILOG_ERROR("failed to transform procName!"); return false; } if (strcpy_s(msg_->soPath, sizeof(msg_->soPath), startMsg.soPath.c_str()) != EOK) { - APP_LOGE("failed to transform soPath!"); + HILOG_ERROR("failed to transform soPath!"); return false; } msg_->accessTokenId = startMsg.accessTokenId; if (strcpy_s(msg_->apl, sizeof(msg_->apl), startMsg.apl.c_str()) != EOK) { - APP_LOGE("failed to transform apl!"); + HILOG_ERROR("failed to transform apl!"); return false; } if (strcpy_s(msg_->bundleName, sizeof(msg_->bundleName), startMsg.bundleName.c_str()) != EOK) { - APP_LOGE("failed to transform bundleName!"); + HILOG_ERROR("failed to transform bundleName!"); return false; } if (strcpy_s(msg_->renderCmd, sizeof(msg_->renderCmd), startMsg.renderParam.c_str()) != EOK) { - APP_LOGE("failed to transform renderCmd!"); + HILOG_ERROR("failed to transform renderCmd!"); return false; } msg_->flags = startMsg.coldStart ? AppSpawn::ClientSocket::APPSPAWN_COLD_BOOT : 0; @@ -80,29 +80,29 @@ bool AppSpawnMsgWrapper::AssembleMsg(const AppSpawnStartMsg &startMsg) bool AppSpawnMsgWrapper::VerifyMsg(const AppSpawnStartMsg &startMsg) const { if (startMsg.uid < 0) { - APP_LOGE("invalid uid! [%{public}d]", startMsg.uid); + HILOG_ERROR("invalid uid! [%{public}d]", startMsg.uid); return false; } if (startMsg.gid < 0) { - APP_LOGE("invalid gid! [%{public}d]", startMsg.gid); + HILOG_ERROR("invalid gid! [%{public}d]", startMsg.gid); return false; } if (startMsg.gids.size() > AppSpawn::ClientSocket::MAX_GIDS) { - APP_LOGE("too many app gids!"); + HILOG_ERROR("too many app gids!"); return false; } for (uint32_t i = 0; i < startMsg.gids.size(); ++i) { if (startMsg.gids[i] < 0) { - APP_LOGE("invalid gids array! [%{public}d]", startMsg.gids[i]); + HILOG_ERROR("invalid gids array! [%{public}d]", startMsg.gids[i]); return false; } } if (startMsg.procName.empty() || startMsg.procName.size() >= AppSpawn::ClientSocket::LEN_PROC_NAME) { - APP_LOGE("invalid procName!"); + HILOG_ERROR("invalid procName!"); return false; } @@ -114,15 +114,15 @@ void AppSpawnMsgWrapper::DumpMsg() const if (!isValid_) { return; } - APP_LOGI("************AppSpawnMsg*************"); - APP_LOGI("uid: %{public}d", msg_->uid); - APP_LOGI("gid: %{public}d", msg_->gid); + HILOG_INFO("************AppSpawnMsg*************"); + HILOG_INFO("uid: %{public}d", msg_->uid); + HILOG_INFO("gid: %{public}d", msg_->gid); for (uint32_t i = 0; i < msg_->gidCount; ++i) { - APP_LOGI("gidTable[%{public}d]: %{public}d", i, msg_->gidTable[i]); + HILOG_INFO("gidTable[%{public}d]: %{public}d", i, msg_->gidTable[i]); } - APP_LOGI("procName: %{public}s", msg_->processName); - APP_LOGI("soPath: %{private}s", msg_->soPath); - APP_LOGI("************************************"); + HILOG_INFO("procName: %{public}s", msg_->processName); + HILOG_INFO("soPath: %{private}s", msg_->soPath); + HILOG_INFO("************************************"); } void AppSpawnMsgWrapper::FreeMsg() diff --git a/services/appmgr/src/app_spawn_socket.cpp b/services/appmgr/src/app_spawn_socket.cpp index 9317c1a0dc..f8996525f2 100644 --- a/services/appmgr/src/app_spawn_socket.cpp +++ b/services/appmgr/src/app_spawn_socket.cpp @@ -15,7 +15,7 @@ #include "app_spawn_socket.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -34,20 +34,20 @@ AppSpawnSocket::~AppSpawnSocket() ErrCode AppSpawnSocket::OpenAppSpawnConnection() { - APP_LOGD("ready to open connection"); + HILOG_DEBUG("ready to open connection"); if (clientSocket_) { if (clientSocket_->CreateClient() != ERR_OK) { - APP_LOGE("failed to create socketClient"); + HILOG_ERROR("failed to create socketClient"); return ERR_APPEXECFWK_BAD_APPSPAWN_CLIENT; } if (clientSocket_->ConnectSocket() != ERR_OK) { - APP_LOGE("failed to connect socket"); + HILOG_ERROR("failed to connect socket"); return ERR_APPEXECFWK_CONNECT_APPSPAWN_FAILED; } - APP_LOGD("connection has been opened"); + HILOG_DEBUG("connection has been opened"); return ERR_OK; } - APP_LOGE("failed to open connection without socket"); + HILOG_ERROR("failed to open connection without socket"); return ERR_APPEXECFWK_BAD_APPSPAWN_SOCKET; } @@ -60,48 +60,48 @@ void AppSpawnSocket::CloseAppSpawnConnection() ErrCode AppSpawnSocket::WriteMessage(const void *buf, const int32_t len) { - APP_LOGD("ready to write message"); + HILOG_DEBUG("ready to write message"); if (len <= 0) { - APP_LOGE("failed to write message due to invalid length of message"); + HILOG_ERROR("failed to write message due to invalid length of message"); return ERR_INVALID_VALUE; } if (buf == nullptr) { - APP_LOGE("failed to write message due to null buf"); + HILOG_ERROR("failed to write message due to null buf"); return ERR_INVALID_VALUE; } if (clientSocket_) { if (clientSocket_->WriteSocketMessage(buf, len) != len) { - APP_LOGE("failed to write message due to invalid write length"); + HILOG_ERROR("failed to write message due to invalid write length"); return ERR_APPEXECFWK_SOCKET_WRITE_FAILED; } - APP_LOGD("write message success"); + HILOG_DEBUG("write message success"); return ERR_OK; } - APP_LOGE("failed to write message without socket"); + HILOG_ERROR("failed to write message without socket"); return ERR_APPEXECFWK_BAD_APPSPAWN_SOCKET; } ErrCode AppSpawnSocket::ReadMessage(void *buf, const int32_t len) { - APP_LOGD("ready to read message"); + HILOG_DEBUG("ready to read message"); if (len <= 0) { - APP_LOGE("failed to read message due to invalid length of cache"); + HILOG_ERROR("failed to read message due to invalid length of cache"); return ERR_INVALID_VALUE; } if (buf == nullptr) { - APP_LOGE("failed to read message due to null buf"); + HILOG_ERROR("failed to read message due to null buf"); return ERR_INVALID_VALUE; } if (clientSocket_) { if (clientSocket_->ReadSocketMessage(buf, len) != len) { - APP_LOGE("failed to read message due to invalid read length"); + HILOG_ERROR("failed to read message due to invalid read length"); return ERR_APPEXECFWK_SOCKET_READ_FAILED; } - APP_LOGD("read message success"); + HILOG_DEBUG("read message success"); return ERR_OK; } - APP_LOGE("failed to read message without socket"); + HILOG_ERROR("failed to read message without socket"); return ERR_APPEXECFWK_BAD_APPSPAWN_CLIENT; } diff --git a/services/appmgr/src/module_running_record.cpp b/services/appmgr/src/module_running_record.cpp index 0370732e2d..7039066c37 100644 --- a/services/appmgr/src/module_running_record.cpp +++ b/services/appmgr/src/module_running_record.cpp @@ -14,8 +14,8 @@ */ #include "module_running_record.h" -#include "app_log_wrapper.h" #include "app_mgr_service_inner.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -47,7 +47,7 @@ std::shared_ptr ModuleRunningRecord::GetAbilityRunningReco const sptr &token) const { if (!token) { - APP_LOGE("token is null"); + HILOG_ERROR("token is null"); return nullptr; } const auto &iter = abilities_.find(token); @@ -60,13 +60,13 @@ std::shared_ptr ModuleRunningRecord::GetAbilityRunningReco std::shared_ptr ModuleRunningRecord::AddAbility(const sptr &token, const std::shared_ptr &abilityInfo, const std::shared_ptr &want) { - APP_LOGI("Add ability."); + HILOG_INFO("Add ability."); if (!token || !abilityInfo) { - APP_LOGE("Param abilityInfo or token is null"); + HILOG_ERROR("Param abilityInfo or token is null"); return nullptr; } if (GetAbilityRunningRecordByToken(token)) { - APP_LOGE("AbilityRecord already exists and no need to add"); + HILOG_ERROR("AbilityRecord already exists and no need to add"); return nullptr; } auto abilityRecord = std::make_shared(abilityInfo, token); @@ -77,9 +77,9 @@ std::shared_ptr ModuleRunningRecord::AddAbility(const sptr bool ModuleRunningRecord::IsLastAbilityRecord(const sptr &token) { - APP_LOGI("Is last ability record."); + HILOG_INFO("Is last ability record."); if (!token) { - APP_LOGE("token is nullptr"); + HILOG_ERROR("token is nullptr"); return false; } @@ -95,9 +95,9 @@ const std::map, std::shared_ptr> std::shared_ptr ModuleRunningRecord::GetAbilityByTerminateLists( const sptr &token) const { - APP_LOGI("Get ability by terminateLists."); + HILOG_INFO("Get ability by terminateLists."); if (!token) { - APP_LOGE("token is null"); + HILOG_ERROR("token is null"); return nullptr; } const auto &iter = terminateAbilitys_.find(token); @@ -109,13 +109,13 @@ std::shared_ptr ModuleRunningRecord::GetAbilityByTerminate void ModuleRunningRecord::ClearAbility(const std::shared_ptr &record) { - APP_LOGI("Clear ability."); + HILOG_INFO("Clear ability."); if (!record) { - APP_LOGE("Param record is null"); + HILOG_ERROR("Param record is null"); return; } if (!GetAbilityRunningRecordByToken(record->GetToken())) { - APP_LOGE("Param record is not exist"); + HILOG_ERROR("Param record is not exist"); return; } abilities_.erase(record->GetToken()); @@ -123,7 +123,7 @@ void ModuleRunningRecord::ClearAbility(const std::shared_ptr ModuleRunningRecord::GetAbilityRunningRecord(const std::string &abilityName) const { - APP_LOGI("Get ability running record by ability name."); + HILOG_INFO("Get ability running record by ability name."); const auto &iter = std::find_if(abilities_.begin(), abilities_.end(), [&abilityName](const auto &pair) { return pair.second->GetName() == abilityName; }); @@ -132,7 +132,7 @@ std::shared_ptr ModuleRunningRecord::GetAbilityRunningReco std::shared_ptr ModuleRunningRecord::GetAbilityRunningRecord(const int64_t eventId) const { - APP_LOGI("Get ability running record by eventId."); + HILOG_INFO("Get ability running record by eventId."); const auto &iter = std::find_if(abilities_.begin(), abilities_.end(), [eventId](const auto &pair) { return pair.second->GetEventId() == eventId; }); @@ -152,14 +152,14 @@ std::shared_ptr ModuleRunningRecord::GetAbilityRunningReco void ModuleRunningRecord::OnAbilityStateChanged( const std::shared_ptr &ability, const AbilityState state) { - APP_LOGI("On ability state changed."); + HILOG_INFO("On ability state changed."); if (!ability) { - APP_LOGE("ability is null"); + HILOG_ERROR("ability is null"); return; } AbilityState oldState = ability->GetState(); ability->SetState(state); - APP_LOGI("OnAbilityStateChanged oldState:%{public}d, state:%{public}d", oldState, state); + HILOG_INFO("OnAbilityStateChanged oldState:%{public}d, state:%{public}d", oldState, state); auto serviceInner = appMgrServiceInner_.lock(); if (serviceInner) { serviceInner->OnAbilityStateChanged(ability, state); @@ -168,14 +168,14 @@ void ModuleRunningRecord::OnAbilityStateChanged( void ModuleRunningRecord::LaunchAbility(const std::shared_ptr &ability) { - APP_LOGI("Launch ability."); + HILOG_INFO("Launch ability."); if (!ability || !ability->GetToken()) { - APP_LOGE("null abilityRecord or abilityToken"); + HILOG_ERROR("null abilityRecord or abilityToken"); return; } const auto &iter = abilities_.find(ability->GetToken()); if (iter != abilities_.end() && appLifeCycleDeal_->GetApplicationClient()) { - APP_LOGI("ScheduleLaunchAbility ability:%{public}s", ability->GetName().c_str()); + HILOG_INFO("ScheduleLaunchAbility ability:%{public}s", ability->GetName().c_str()); appLifeCycleDeal_->LaunchAbility(ability); ability->SetState(AbilityState::ABILITY_STATE_READY); } @@ -183,15 +183,15 @@ void ModuleRunningRecord::LaunchAbility(const std::shared_ptrGetState()); + HILOG_INFO("state : %{public}d", item.second->GetState()); if (item.second->GetState() == AbilityState::ABILITY_STATE_CREATE) { LaunchAbility(item.second); } @@ -200,10 +200,10 @@ void ModuleRunningRecord::LaunchPendingAbilities() void ModuleRunningRecord::TerminateAbility(const sptr &token, const bool isForce) { - APP_LOGI("Terminate ability."); + HILOG_INFO("Terminate ability."); auto abilityRecord = GetAbilityRunningRecordByToken(token); if (!abilityRecord) { - APP_LOGE("abilityRecord is nullptr"); + HILOG_ERROR("abilityRecord is nullptr"); return; } @@ -216,7 +216,7 @@ void ModuleRunningRecord::TerminateAbility(const sptr &token, con if (!isForce) { auto curAbilityState = abilityRecord->GetState(); if (curAbilityState != AbilityState::ABILITY_STATE_BACKGROUND) { - APP_LOGE("current state(%{public}d) error", static_cast(curAbilityState)); + HILOG_ERROR("current state(%{public}d) error", static_cast(curAbilityState)); return; } } @@ -224,18 +224,18 @@ void ModuleRunningRecord::TerminateAbility(const sptr &token, con if (appLifeCycleDeal_) { appLifeCycleDeal_->ScheduleCleanAbility(token); } else { - APP_LOGE("appLifeCycleDeal_ is null"); + HILOG_ERROR("appLifeCycleDeal_ is null"); } - APP_LOGI("ModuleRunningRecord::TerminateAbility end"); + HILOG_INFO("ModuleRunningRecord::TerminateAbility end"); } void ModuleRunningRecord::SendEvent( uint32_t msg, int64_t timeOut, const std::shared_ptr &abilityRecord) { - APP_LOGI("Send event"); + HILOG_INFO("Send event"); if (!eventHandler_) { - APP_LOGE("eventHandler_ is nullptr"); + HILOG_ERROR("eventHandler_ is nullptr"); return; } @@ -246,20 +246,20 @@ void ModuleRunningRecord::SendEvent( void ModuleRunningRecord::AbilityTerminated(const sptr &token) { - APP_LOGI("Ability terminated."); + HILOG_INFO("Ability terminated."); if (!token) { - APP_LOGE("token is null"); + HILOG_ERROR("token is null"); return; } if (!eventHandler_) { - APP_LOGE("eventHandler_ is nullptr"); + HILOG_ERROR("eventHandler_ is nullptr"); return; } auto abilityRecord = GetAbilityByTerminateLists(token); if (!abilityRecord) { - APP_LOGE("ModuleRunningRecord::AbilityTerminated can not find ability record"); + HILOG_ERROR("ModuleRunningRecord::AbilityTerminated can not find ability record"); return; } diff --git a/services/appmgr/src/remote_client_manager.cpp b/services/appmgr/src/remote_client_manager.cpp index 3e07549469..3ed1b46738 100644 --- a/services/appmgr/src/remote_client_manager.cpp +++ b/services/appmgr/src/remote_client_manager.cpp @@ -15,10 +15,10 @@ #include "remote_client_manager.h" +#include "hilog_wrapper.h" #include "iservice_registry.h" #include "system_ability_definition.h" -#include "app_log_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -50,7 +50,7 @@ sptr RemoteClientManager::GetBundleManager() bundleManager_ = iface_cast(systemManager->GetSystemAbility(BUNDLE_MGR_SERVICE_SYS_ABILITY_ID)); } else { - APP_LOGE("AppMgrServiceInner::GetBundleManager fail to get SAMGR"); + HILOG_ERROR("AppMgrServiceInner::GetBundleManager fail to get SAMGR"); } } return bundleManager_; diff --git a/services/appmgr/src/start_via_asan.cpp b/services/appmgr/src/start_via_asan.cpp index eaef73e15c..517f07a9d5 100644 --- a/services/appmgr/src/start_via_asan.cpp +++ b/services/appmgr/src/start_via_asan.cpp @@ -15,7 +15,7 @@ #include "start_via_asan.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "properties.h" namespace OHOS { @@ -36,10 +36,10 @@ bool StartViaAsan::IsAsanVersion(const std::string &name) const std::string wrapAppName = "wrap." + name; std::string propValue = GetProperty(wrapAppName, defaultWrapValue); if (propValue != defaultWrapValue) { - APP_LOGI("%{public}s system prop set, value is %{public}s", wrapAppName.c_str(), propValue.c_str()); + HILOG_INFO("%{public}s system prop set, value is %{public}s", wrapAppName.c_str(), propValue.c_str()); return true; } - APP_LOGI("%{public}s system prop not set", wrapAppName.c_str()); + HILOG_INFO("%{public}s system prop not set", wrapAppName.c_str()); return false; } diff --git a/services/appmgr/src/system_environment_information.cpp b/services/appmgr/src/system_environment_information.cpp index dd50b8b03d..38a1ef322c 100644 --- a/services/appmgr/src/system_environment_information.cpp +++ b/services/appmgr/src/system_environment_information.cpp @@ -22,7 +22,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "kernel_system_memory_info.h" #include "securec.h" @@ -37,10 +37,10 @@ void KernelSystemMemoryInfo::Init(std::map &memInfo) auto findData = [&] (const std::string& key) -> std::string { auto iter = memInfo.find(key); if (iter != memInfo.end()) { - APP_LOGD("key[%{public}s] data[%{public}s]", key.c_str(), iter->second.c_str()); + HILOG_DEBUG("key[%{public}s] data[%{public}s]", key.c_str(), iter->second.c_str()); return iter->second; } else { - APP_LOGE("key[%{public}s]", key.c_str()); + HILOG_ERROR("key[%{public}s]", key.c_str()); return std::string(""); } }; @@ -92,7 +92,7 @@ static void RequestSystemMemoryInfo(std::map &memInfo) FILE *fp = popen("cat /proc/meminfo", "r"); if (fp == nullptr) { - APP_LOGE("open meminfo failed"); + HILOG_ERROR("open meminfo failed"); return; } @@ -104,14 +104,14 @@ static void RequestSystemMemoryInfo(std::map &memInfo) bool flag = false; flag = std::regex_search(strbuf, sm, rLabel); if (!flag) { - APP_LOGE("open meminfo failed"); + HILOG_ERROR("open meminfo failed"); continue; } std::string strLabel = sm[0]; strbuf = sm.suffix().str(); flag = std::regex_search(strbuf, sm, rData); if (!flag) { - APP_LOGE("open meminfo failed"); + HILOG_ERROR("open meminfo failed"); continue; } std::string strData = sm[0]; diff --git a/services/appmgr/test/BUILD.gn b/services/appmgr/test/BUILD.gn index 4dbcbb0b42..6a718483d6 100644 --- a/services/appmgr/test/BUILD.gn +++ b/services/appmgr/test/BUILD.gn @@ -24,11 +24,19 @@ config("appmgr_test_config") { ] defines = [ - "APP_LOG_TAG = \"AppMgrService\"", - "LOG_DOMAIN = 0xD00111E", + "AMS_LOG_TAG = \"AppMgrService\"", + "AMS_LOG_DOMAIN = 0xD00111E", ] - include_dirs = [ "${services_path}/appmgr/test/mock/include" ] + include_dirs = [ + "${services_path}/appmgr/test/mock/include", + "//base/account/os_account/interfaces/innerkits/osaccount/native/include", + "//base/notification/ces_standard/frameworks/core/include", + "//base/notification/ces_standard/interfaces/innerkits/native/include", + "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk/main/cpp/include", + "//base/global/i18n_standard/frameworks/intl/include", + "//base/hiviewdfx/hicollie/interfaces/native/innerkits/include", + ] } ohos_source_set("appmgr_test_source") { diff --git a/services/appmgr/test/mock/include/mock_app_mgr_service_inner.h b/services/appmgr/test/mock/include/mock_app_mgr_service_inner.h index 70d2ad9e2d..a0d35e1617 100644 --- a/services/appmgr/test/mock/include/mock_app_mgr_service_inner.h +++ b/services/appmgr/test/mock/include/mock_app_mgr_service_inner.h @@ -17,7 +17,7 @@ #define FOUNDATION_APPEXECFWK_SERVICES_APPMGR_TEST_MOCK_APP_MGR_SERVICE_INNER_H #include "gmock/gmock.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "semaphore_ex.h" #include "app_mgr_service_inner.h" diff --git a/services/appmgr/test/mock/include/mock_app_service_mgr.h b/services/appmgr/test/mock/include/mock_app_service_mgr.h index 1f9980fb63..51ca74ee35 100644 --- a/services/appmgr/test/mock/include/mock_app_service_mgr.h +++ b/services/appmgr/test/mock/include/mock_app_service_mgr.h @@ -17,8 +17,8 @@ #define FOUNDATION_APPEXECFWK_SERVICES_APPMGR_TEST_MOCK_APP_SERVICE_MGR_H #include "iremote_object.h" -#include "app_log_wrapper.h" #include "app_service_manager.h" +#include "hilog_wrapper.h" #include "mock_app_mgr_service.h" namespace OHOS { @@ -30,7 +30,7 @@ public: virtual sptr GetAppMgrService() const override { - APP_LOGD("Mock MockAppServiceMgr GetAppMgrService called"); + HILOG_DEBUG("Mock MockAppServiceMgr GetAppMgrService called"); return new MockAppMgrService(); } }; diff --git a/services/appmgr/test/mock/include/mock_app_spawn_socket.h b/services/appmgr/test/mock/include/mock_app_spawn_socket.h index ea102b63e8..ea4bd80826 100644 --- a/services/appmgr/test/mock/include/mock_app_spawn_socket.h +++ b/services/appmgr/test/mock/include/mock_app_spawn_socket.h @@ -19,8 +19,8 @@ #include "gmock/gmock.h" #include "app_spawn_socket.h" #include "app_spawn_msg_wrapper.h" +#include "hilog_wrapper.h" #include "securec.h" -#include "app_log_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/services/appmgr/test/unittest/ams_ability_running_record_test/ams_ability_running_record_test.cpp b/services/appmgr/test/unittest/ams_ability_running_record_test/ams_ability_running_record_test.cpp index 5a94e32d6b..51a9fd30ad 100644 --- a/services/appmgr/test/unittest/ams_ability_running_record_test/ams_ability_running_record_test.cpp +++ b/services/appmgr/test/unittest/ams_ability_running_record_test/ams_ability_running_record_test.cpp @@ -18,7 +18,7 @@ #include #include "app_running_record.h" #include "app_scheduler_host.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "mock_ability_token.h" #include "mock_application.h" @@ -111,7 +111,7 @@ std::shared_ptr AmsAbilityRunningRecordTest::GetTestAppRunning */ HWTEST_F(AmsAbilityRunningRecordTest, CreateAbilityRunningRecord_001, TestSize.Level1) { - APP_LOGD("CreateAbilityRunningRecord_001 start."); + HILOG_DEBUG("CreateAbilityRunningRecord_001 start."); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); auto appRunningRecord = GetTestAppRunningRecord(); @@ -129,7 +129,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, CreateAbilityRunningRecord_001, TestSize.L EXPECT_TRUE(abilityRunningRecord != nullptr); EXPECT_EQ(abilityRunningRecord, appRunningRecord->GetAbilityRunningRecordByToken(token)); - APP_LOGD("CreateAbilityRunningRecord_001 end."); + HILOG_DEBUG("CreateAbilityRunningRecord_001 end."); } /* @@ -142,7 +142,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, CreateAbilityRunningRecord_001, TestSize.L */ HWTEST_F(AmsAbilityRunningRecordTest, CreateAbilityRunningRecord_002, TestSize.Level1) { - APP_LOGD("CreateAbilityRunningRecord_002 start."); + HILOG_DEBUG("CreateAbilityRunningRecord_002 start."); auto appRunningRecord = GetTestAppRunningRecord(); sptr token = new MockAbilityToken(); HapModuleInfo hapModuleInfo; @@ -156,7 +156,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, CreateAbilityRunningRecord_002, TestSize.L EXPECT_TRUE(moduleRecord); auto abilityRunningRecord = moduleRecord->GetAbilityRunningRecordByToken(token); EXPECT_TRUE(abilityRunningRecord == nullptr); - APP_LOGD("CreateAbilityRunningRecord_002 end."); + HILOG_DEBUG("CreateAbilityRunningRecord_002 end."); } /* @@ -169,7 +169,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, CreateAbilityRunningRecord_002, TestSize.L */ HWTEST_F(AmsAbilityRunningRecordTest, CreateAbilityRunningRecord_003, TestSize.Level1) { - APP_LOGD("CreateAbilityRunningRecord_003 start."); + HILOG_DEBUG("CreateAbilityRunningRecord_003 start."); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); auto appRunningRecord = GetTestAppRunningRecord(); @@ -193,7 +193,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, CreateAbilityRunningRecord_003, TestSize.L EXPECT_TRUE(moduleRecord); auto abilityRunningRecordSecond = moduleRecord->GetAbilityRunningRecordByToken(token); EXPECT_TRUE(abilityRunningRecordSecond == abilityRunningRecordFirst); - APP_LOGD("CreateAbilityRunningRecord_003 end."); + HILOG_DEBUG("CreateAbilityRunningRecord_003 end."); } /* @@ -206,7 +206,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, CreateAbilityRunningRecord_003, TestSize.L */ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_001, TestSize.Level1) { - APP_LOGD("UpdateAbilityRunningRecord_001 start."); + HILOG_DEBUG("UpdateAbilityRunningRecord_001 start."); auto appRunningRecord = GetTestAppRunningRecord(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -235,7 +235,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_001, TestSize.L EXPECT_CALL(*mockedAppClient_, ScheduleBackgroundApplication()).Times(1); appRunningRecord->UpdateAbilityState(token, AbilityState::ABILITY_STATE_BACKGROUND); EXPECT_EQ(abilityRunningRecord->GetState(), AbilityState::ABILITY_STATE_BACKGROUND) << "execute fail!"; - APP_LOGD("UpdateAbilityRunningRecord_001 end."); + HILOG_DEBUG("UpdateAbilityRunningRecord_001 end."); } /* @@ -248,7 +248,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_001, TestSize.L */ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_002, TestSize.Level1) { - APP_LOGD("UpdateAbilityRunningRecord_002 start."); + HILOG_DEBUG("UpdateAbilityRunningRecord_002 start."); auto appRunningRecord = GetTestAppRunningRecord(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -270,7 +270,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_002, TestSize.L appRunningRecord->UpdateAbilityState(token, AbilityState::ABILITY_STATE_END); EXPECT_EQ(abilityRunningRecord->GetState(), state); EXPECT_NE(abilityRunningRecord->GetState(), AbilityState::ABILITY_STATE_END); - APP_LOGD("UpdateAbilityRunningRecord_002 end."); + HILOG_DEBUG("UpdateAbilityRunningRecord_002 end."); } /* @@ -283,7 +283,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_002, TestSize.L */ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_003, TestSize.Level1) { - APP_LOGD("UpdateAbilityRunningRecord_003 start."); + HILOG_DEBUG("UpdateAbilityRunningRecord_003 start."); auto appRunningRecord = GetTestAppRunningRecord(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -304,7 +304,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_003, TestSize.L appRunningRecord->UpdateAbilityState(nullptr, AbilityState::ABILITY_STATE_FOREGROUND); EXPECT_EQ(abilityRunningRecord->GetState(), state); - APP_LOGD("UpdateAbilityRunningRecord_003 end."); + HILOG_DEBUG("UpdateAbilityRunningRecord_003 end."); } /* @@ -318,7 +318,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_003, TestSize.L */ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_004, TestSize.Level1) { - APP_LOGD("UpdateAbilityRunningRecord_004 start."); + HILOG_DEBUG("UpdateAbilityRunningRecord_004 start."); auto appRunningRecord = GetTestAppRunningRecord(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -344,7 +344,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_004, TestSize.L EXPECT_TRUE(appRunningRecord->GetAbilityRunningRecordByToken(token2) == nullptr); appRunningRecord->UpdateAbilityState(token2, AbilityState::ABILITY_STATE_FOREGROUND); EXPECT_EQ(abilityRunningRecord->GetState(), state); - APP_LOGD("UpdateAbilityRunningRecord_004 end."); + HILOG_DEBUG("UpdateAbilityRunningRecord_004 end."); } /* @@ -358,7 +358,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_004, TestSize.L */ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_005, TestSize.Level1) { - APP_LOGD("UpdateAbilityRunningRecord_005 start."); + HILOG_DEBUG("UpdateAbilityRunningRecord_005 start."); auto appRunningRecord = GetTestAppRunningRecord(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -390,7 +390,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_005, TestSize.L EXPECT_CALL(*mockedAppClient_, ScheduleForegroundApplication()).Times(1); appRunningRecord->UpdateAbilityState(anotherToken, AbilityState::ABILITY_STATE_FOREGROUND); - APP_LOGD("UpdateAbilityRunningRecord_005 end."); + HILOG_DEBUG("UpdateAbilityRunningRecord_005 end."); } /* @@ -404,7 +404,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_005, TestSize.L */ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_006, TestSize.Level1) { - APP_LOGD("UpdateAbilityRunningRecord_006 start."); + HILOG_DEBUG("UpdateAbilityRunningRecord_006 start."); auto appRunningRecord = GetTestAppRunningRecord(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -440,7 +440,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_006, TestSize.L for (auto iter = abilities.begin(); iter != abilities.end(); iter++) { appRunningRecord->UpdateAbilityState(iter->second->GetToken(), AbilityState::ABILITY_STATE_BACKGROUND); } - APP_LOGD("UpdateAbilityRunningRecord_006 end."); + HILOG_DEBUG("UpdateAbilityRunningRecord_006 end."); } /* @@ -454,7 +454,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_006, TestSize.L */ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_007, TestSize.Level1) { - APP_LOGD("UpdateAbilityRunningRecord_007 start."); + HILOG_DEBUG("UpdateAbilityRunningRecord_007 start."); auto appRunningRecord = GetTestAppRunningRecord(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -490,7 +490,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_007, TestSize.L appRunningRecord->TerminateAbility(iter->second->GetToken(), false); appRunningRecord->AbilityTerminated(iter->second->GetToken()); } - APP_LOGD("UpdateAbilityRunningRecord_007 end."); + HILOG_DEBUG("UpdateAbilityRunningRecord_007 end."); } /* @@ -503,7 +503,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, UpdateAbilityRunningRecord_007, TestSize.L */ HWTEST_F(AmsAbilityRunningRecordTest, DeleteAbilityRunningRecord_001, TestSize.Level1) { - APP_LOGD("DeleteAbilityRunningRecord_001 start."); + HILOG_DEBUG("DeleteAbilityRunningRecord_001 start."); auto appRunningRecord = GetTestAppRunningRecord(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -524,7 +524,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, DeleteAbilityRunningRecord_001, TestSize.L appRunningRecord->ClearAbility(abilityRunningRecord); EXPECT_TRUE(appRunningRecord->GetAbilityRunningRecordByToken(token) == nullptr); - APP_LOGD("DeleteAbilityRunningRecord_001 end."); + HILOG_DEBUG("DeleteAbilityRunningRecord_001 end."); } /* @@ -537,7 +537,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, DeleteAbilityRunningRecord_001, TestSize.L */ HWTEST_F(AmsAbilityRunningRecordTest, DeleteAbilityRunningRecord_002, TestSize.Level1) { - APP_LOGD("DeleteAbilityRunningRecord_002 start."); + HILOG_DEBUG("DeleteAbilityRunningRecord_002 start."); auto appRunningRecord = GetTestAppRunningRecord(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -558,7 +558,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, DeleteAbilityRunningRecord_002, TestSize.L appRunningRecord->ClearAbility(nullptr); EXPECT_TRUE(appRunningRecord->GetAbilityRunningRecordByToken(token) != nullptr); - APP_LOGD("DeleteAbilityRunningRecord_002 end."); + HILOG_DEBUG("DeleteAbilityRunningRecord_002 end."); } /* @@ -571,7 +571,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, DeleteAbilityRunningRecord_002, TestSize.L */ HWTEST_F(AmsAbilityRunningRecordTest, DeleteAbilityRunningRecord_003, TestSize.Level1) { - APP_LOGD("DeleteAbilityRunningRecord_003 start."); + HILOG_DEBUG("DeleteAbilityRunningRecord_003 start."); auto appRunningRecord = GetTestAppRunningRecord(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -607,7 +607,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, DeleteAbilityRunningRecord_003, TestSize.L appRunningRecord->ClearAbility(anotherAbilityRunningRecord); EXPECT_TRUE(appRunningRecord->GetAbilityRunningRecordByToken(token) != nullptr); EXPECT_TRUE(appRunningRecord->GetAbilityRunningRecordByToken(anotherToken) == nullptr); - APP_LOGD("DeleteAbilityRunningRecord_003 end."); + HILOG_DEBUG("DeleteAbilityRunningRecord_003 end."); } /* @@ -620,7 +620,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, DeleteAbilityRunningRecord_003, TestSize.L */ HWTEST_F(AmsAbilityRunningRecordTest, IsSameState_001, TestSize.Level1) { - APP_LOGD("IsSameState_001 start."); + HILOG_DEBUG("IsSameState_001 start."); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -632,7 +632,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, IsSameState_001, TestSize.Level1) EXPECT_EQ(false, abilityRunningRecord->IsSameState(AbilityState::ABILITY_STATE_BACKGROUND)); EXPECT_EQ(true, abilityRunningRecord->IsSameState(AbilityState::ABILITY_STATE_FOREGROUND)); - APP_LOGD("IsSameState_001 end."); + HILOG_DEBUG("IsSameState_001 end."); } /* @@ -645,7 +645,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, IsSameState_001, TestSize.Level1) */ HWTEST_F(AmsAbilityRunningRecordTest, SetGetAbilityRecord_001, TestSize.Level1) { - APP_LOGD("SetGetAbilityRecord_001 start."); + HILOG_DEBUG("SetGetAbilityRecord_001 start."); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -674,7 +674,7 @@ HWTEST_F(AmsAbilityRunningRecordTest, SetGetAbilityRecord_001, TestSize.Level1) EXPECT_EQ(1, testRecord->GetPerceptibility()); EXPECT_EQ(1, testRecord->GetConnectionState()); - APP_LOGD("SetGetAbilityRecord_001 end."); + HILOG_DEBUG("SetGetAbilityRecord_001 end."); } } // namespace AppExecFwk } // namespace OHOS diff --git a/services/appmgr/test/unittest/ams_app_death_recipient_test/ams_app_death_recipient_test.cpp b/services/appmgr/test/unittest/ams_app_death_recipient_test/ams_app_death_recipient_test.cpp index ebdea2b92f..d4e7219dc8 100644 --- a/services/appmgr/test/unittest/ams_app_death_recipient_test/ams_app_death_recipient_test.cpp +++ b/services/appmgr/test/unittest/ams_app_death_recipient_test/ams_app_death_recipient_test.cpp @@ -18,8 +18,8 @@ #include "app_mgr_service_inner.h" #undef private #include -#include "app_log_wrapper.h" #include "app_mgr_service_inner.h" +#include "hilog_wrapper.h" #include "mock_ability_token.h" #include "mock_app_scheduler.h" #include "mock_app_spawn_client.h" @@ -165,13 +165,13 @@ sptr AppDeathRecipientTest::GetApp(int32_t pid, int size) HWTEST_F(AppDeathRecipientTest, AppDeathRecipient_001, TestSize.Level1) { - APP_LOGI("AppDeathRecipient_001 start"); + HILOG_INFO("AppDeathRecipient_001 start"); appDeathRecipientObject_->SetEventHandler(handler_); EXPECT_TRUE(appDeathRecipientObject_->handler_.lock() != nullptr); appDeathRecipientObject_->SetAppMgrServiceInner(appMgrServiceInner_); EXPECT_TRUE(appDeathRecipientObject_->appMgrServiceInner_.lock() != nullptr); - APP_LOGI("AppDeathRecipient_001 end"); + HILOG_INFO("AppDeathRecipient_001 end"); } /* @@ -202,7 +202,7 @@ HWTEST_F(AppDeathRecipientTest, AppDeathRecipient_002, TestSize.Level1) WaitUntilTaskFinished(handler_); EXPECT_EQ(0, static_cast(appDeathRecipientObject_->appMgrServiceInner_.lock()->GetRecentAppList().size())); - APP_LOGI("AppDeathRecipient_002 start"); + HILOG_INFO("AppDeathRecipient_002 start"); } } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file diff --git a/services/appmgr/test/unittest/ams_app_mgr_client_test/ams_app_mgr_client_test.cpp b/services/appmgr/test/unittest/ams_app_mgr_client_test/ams_app_mgr_client_test.cpp index c303b48a0b..282330f55e 100644 --- a/services/appmgr/test/unittest/ams_app_mgr_client_test/ams_app_mgr_client_test.cpp +++ b/services/appmgr/test/unittest/ams_app_mgr_client_test/ams_app_mgr_client_test.cpp @@ -19,7 +19,7 @@ #include #include "ability_info.h" #include "application_info.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "iapp_state_callback.h" #include "mock_ability_token.h" #include "mock_ams_mgr_scheduler.h" @@ -78,7 +78,7 @@ void AmsAppMgrClientTest::TearDown() */ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_GetConfiguration_0100, TestSize.Level1) { - APP_LOGI("AppMgrClient_GetConfiguration_0100 start"); + HILOG_INFO("AppMgrClient_GetConfiguration_0100 start"); EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->ConnectAppMgrService()); @@ -91,11 +91,11 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_GetConfiguration_0100, TestSize.Level Configuration config; auto result = client_->GetConfiguration(config); - APP_LOGI("result = %{public}d", result); + HILOG_INFO("result = %{public}d", result); EXPECT_EQ(result, AppMgrResultCode::RESULT_OK); - APP_LOGI("AppMgrClient_GetConfiguration_0100 end"); + HILOG_INFO("AppMgrClient_GetConfiguration_0100 end"); } /** @@ -106,7 +106,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_GetConfiguration_0100, TestSize.Level */ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_GetProcessRunningInfosByUserId_0100, TestSize.Level1) { - APP_LOGI("AppMgrClient_GetProcessRunningInfosByUserId_0100 start"); + HILOG_INFO("AppMgrClient_GetProcessRunningInfosByUserId_0100 start"); EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->ConnectAppMgrService()); @@ -118,11 +118,11 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_GetProcessRunningInfosByUserId_0100, std::vector info; int32_t userId = USER_ID; auto result = client_->GetProcessRunningInfosByUserId(info, userId); - APP_LOGI("result = %{public}d", result); + HILOG_INFO("result = %{public}d", result); EXPECT_EQ(result, AppMgrResultCode::RESULT_OK); - APP_LOGI("AppMgrClient_GetProcessRunningInfosByUserId_0100 end"); + HILOG_INFO("AppMgrClient_GetProcessRunningInfosByUserId_0100 end"); } /* @@ -135,7 +135,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_GetProcessRunningInfosByUserId_0100, */ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_001, TestSize.Level1) { - APP_LOGI("ams_app_mgr_client_test_001 start"); + HILOG_INFO("ams_app_mgr_client_test_001 start"); EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->ConnectAppMgrService()); AbilityInfo abilityInfo; @@ -152,7 +152,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_001, TestSize.Level1) .WillOnce(Return(amsMgrScheduler)); EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->LoadAbility(token_, preToken_, abilityInfo, appInfo, want)); - APP_LOGI("ams_app_mgr_client_test_001 end"); + HILOG_INFO("ams_app_mgr_client_test_001 end"); } /* @@ -165,14 +165,14 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_001, TestSize.Level1) */ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_002, TestSize.Level1) { - APP_LOGI("ams_app_mgr_client_test_002 start"); + HILOG_INFO("ams_app_mgr_client_test_002 start"); AbilityInfo abilityInfo; ApplicationInfo appInfo; Want want; EXPECT_EQ( AppMgrResultCode::ERROR_SERVICE_NOT_CONNECTED, client_->LoadAbility(token_, preToken_, abilityInfo, appInfo, want)); - APP_LOGI("ams_app_mgr_client_test_002 end"); + HILOG_INFO("ams_app_mgr_client_test_002 end"); } /* @@ -185,7 +185,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_002, TestSize.Level1) */ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_003, TestSize.Level1) { - APP_LOGI("ams_app_mgr_client_test_003 start"); + HILOG_INFO("ams_app_mgr_client_test_003 start"); EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->ConnectAppMgrService()); sptr amsMgrScheduler(new MockAmsMgrScheduler()); @@ -195,7 +195,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_003, TestSize.Level1) EXPECT_CALL(*(static_cast(amsMgrScheduler.GetRefPtr())), TerminateAbility(_)).Times(1); EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->TerminateAbility(token_)); - APP_LOGI("ams_app_mgr_client_test_003 end"); + HILOG_INFO("ams_app_mgr_client_test_003 end"); } /* @@ -208,9 +208,9 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_003, TestSize.Level1) */ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_004, TestSize.Level1) { - APP_LOGI("ams_app_mgr_client_test_004 start"); + HILOG_INFO("ams_app_mgr_client_test_004 start"); EXPECT_EQ(AppMgrResultCode::ERROR_SERVICE_NOT_CONNECTED, client_->TerminateAbility(token_)); - APP_LOGI("ams_app_mgr_client_test_004 end"); + HILOG_INFO("ams_app_mgr_client_test_004 end"); } /* @@ -223,7 +223,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_004, TestSize.Level1) */ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_005, TestSize.Level1) { - APP_LOGI("ams_app_mgr_client_test_005 start"); + HILOG_INFO("ams_app_mgr_client_test_005 start"); EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->ConnectAppMgrService()); sptr amsMgrScheduler(new MockAmsMgrScheduler()); @@ -234,7 +234,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_005, TestSize.Level1) AbilityState state = AbilityState::ABILITY_STATE_BEGIN; EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->UpdateAbilityState(token_, state)); - APP_LOGI("ams_app_mgr_client_test_005 end"); + HILOG_INFO("ams_app_mgr_client_test_005 end"); } /* @@ -247,10 +247,10 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_005, TestSize.Level1) */ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_006, TestSize.Level1) { - APP_LOGI("ams_app_mgr_client_test_006 start"); + HILOG_INFO("ams_app_mgr_client_test_006 start"); AbilityState state = AbilityState::ABILITY_STATE_BEGIN; EXPECT_EQ(AppMgrResultCode::ERROR_SERVICE_NOT_CONNECTED, client_->UpdateAbilityState(token_, state)); - APP_LOGI("ams_app_mgr_client_test_006 end"); + HILOG_INFO("ams_app_mgr_client_test_006 end"); } /* @@ -263,7 +263,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_006, TestSize.Level1) */ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_007, TestSize.Level1) { - APP_LOGI("ams_app_mgr_client_test_007 start"); + HILOG_INFO("ams_app_mgr_client_test_007 start"); EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->ConnectAppMgrService()); sptr mockCallback(new MockAppStateCallback()); sptr callback = iface_cast(mockCallback); @@ -277,7 +277,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_007, TestSize.Level1) EXPECT_CALL(*mockCallback, OnAppStateChanged(_)).Times(1); EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->RegisterAppStateCallback(callback)); - APP_LOGI("ams_app_mgr_client_test_007 end"); + HILOG_INFO("ams_app_mgr_client_test_007 end"); } /* @@ -290,10 +290,10 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_007, TestSize.Level1) */ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_008, TestSize.Level1) { - APP_LOGI("ams_app_mgr_client_test_008 start"); + HILOG_INFO("ams_app_mgr_client_test_008 start"); sptr callback; EXPECT_EQ(AppMgrResultCode::ERROR_SERVICE_NOT_CONNECTED, client_->RegisterAppStateCallback(callback)); - APP_LOGI("ams_app_mgr_client_test_008 end"); + HILOG_INFO("ams_app_mgr_client_test_008 end"); } /* @@ -306,7 +306,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_008, TestSize.Level1) */ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_009, TestSize.Level1) { - APP_LOGI("ams_app_mgr_client_test_008 start"); + HILOG_INFO("ams_app_mgr_client_test_008 start"); EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->ConnectAppMgrService()); sptr token; sptr preToken; @@ -320,7 +320,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_009, TestSize.Level1) .WillOnce(Return(amsMgrScheduler)); EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->AbilityBehaviorAnalysis(token, preToken, 1, 1, 1)); - APP_LOGI("ams_app_mgr_client_test_008 end"); + HILOG_INFO("ams_app_mgr_client_test_008 end"); } /* @@ -333,7 +333,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_009, TestSize.Level1) */ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_010, TestSize.Level1) { - APP_LOGI("ams_app_mgr_client_test_008 start"); + HILOG_INFO("ams_app_mgr_client_test_008 start"); EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->ConnectAppMgrService()); sptr token; sptr preToken; @@ -347,7 +347,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_010, TestSize.Level1) .WillOnce(Return(amsMgrScheduler)); EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->KillApplication("")); - APP_LOGI("ams_app_mgr_client_test_008 end"); + HILOG_INFO("ams_app_mgr_client_test_008 end"); } /* @@ -360,7 +360,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_010, TestSize.Level1) */ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_011, TestSize.Level1) { - APP_LOGI("ams_app_mgr_client_test_011 start"); + HILOG_INFO("ams_app_mgr_client_test_011 start"); sptr token; sptr preToken; EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->ConnectAppMgrService()); @@ -373,7 +373,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_011, TestSize.Level1) .WillOnce(Return(amsMgrScheduler)); EXPECT_EQ(AppMgrResultCode::ERROR_SERVICE_NOT_READY, client_->KillApplication("")); - APP_LOGI("ams_app_mgr_client_test_011 end"); + HILOG_INFO("ams_app_mgr_client_test_011 end"); } /* @@ -386,7 +386,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_011, TestSize.Level1) */ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_012, TestSize.Level1) { - APP_LOGI("ams_app_mgr_client_test_012 start"); + HILOG_INFO("ams_app_mgr_client_test_012 start"); sptr token; EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->ConnectAppMgrService()); sptr amsMgrScheduler(new MockAmsMgrScheduler()); @@ -398,7 +398,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_012, TestSize.Level1) .WillOnce(Return(amsMgrScheduler)); EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->KillProcessByAbilityToken(token)); - APP_LOGI("ams_app_mgr_client_test_012 end"); + HILOG_INFO("ams_app_mgr_client_test_012 end"); } /* @@ -411,7 +411,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_012, TestSize.Level1) */ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_013, TestSize.Level1) { - APP_LOGI("ams_app_mgr_client_test_013 start"); + HILOG_INFO("ams_app_mgr_client_test_013 start"); sptr token; EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->ConnectAppMgrService()); sptr amsMgrScheduler(new MockAmsMgrScheduler()); @@ -423,7 +423,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_013, TestSize.Level1) .WillOnce(Return(nullptr)); EXPECT_EQ(AppMgrResultCode::ERROR_SERVICE_NOT_CONNECTED, client_->KillProcessByAbilityToken(token)); - APP_LOGI("ams_app_mgr_client_test_013 end"); + HILOG_INFO("ams_app_mgr_client_test_013 end"); } /* @@ -473,7 +473,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_015, TestSize.Level1) */ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_016, TestSize.Level1) { - APP_LOGI("UpdateConfiguration start"); + HILOG_INFO("UpdateConfiguration start"); EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->ConnectAppMgrService()); sptr amsMgrScheduler(new MockAmsMgrScheduler()); @@ -486,7 +486,7 @@ HWTEST_F(AmsAppMgrClientTest, AppMgrClient_016, TestSize.Level1) Configuration config; EXPECT_EQ(AppMgrResultCode::RESULT_OK, client_->UpdateConfiguration(config)); - APP_LOGI("UpdateConfiguration end"); + HILOG_INFO("UpdateConfiguration end"); } } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file diff --git a/services/appmgr/test/unittest/ams_app_running_record_test/ams_app_running_record_test.cpp b/services/appmgr/test/unittest/ams_app_running_record_test/ams_app_running_record_test.cpp index ab16f6c38a..c673bb5a8a 100644 --- a/services/appmgr/test/unittest/ams_app_running_record_test/ams_app_running_record_test.cpp +++ b/services/appmgr/test/unittest/ams_app_running_record_test/ams_app_running_record_test.cpp @@ -22,11 +22,11 @@ #include "iremote_object.h" #include "refbase.h" #include "application_info.h" -#include "app_log_wrapper.h" #include "app_record_id.h" #include "app_scheduler_host.h" #include "ability_info.h" #include "ability_running_record.h" +#include "hilog_wrapper.h" #include "mock_app_scheduler.h" #include "mock_ability_token.h" #include "mock_app_spawn_client.h" @@ -536,7 +536,7 @@ HWTEST_F(AmsAppRunningRecordTest, DeleteAppRunningRecord_001, TestSize.Level1) */ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_001, TestSize.Level1) { - APP_LOGI("AmsAppRunningRecordTest AttachApplication_001 start"); + HILOG_INFO("AmsAppRunningRecordTest AttachApplication_001 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -555,7 +555,7 @@ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_001, TestSize.Level1) EXPECT_CALL(*mockAppSchedulerClient_, ScheduleLaunchAbility(_, _, _)).Times(1); service_->AttachApplication(newPid, mockAppSchedulerClient_); EXPECT_EQ(record->GetState(), ApplicationState::APP_STATE_READY); - APP_LOGI("AmsAppRunningRecordTest AttachApplication_001 end"); + HILOG_INFO("AmsAppRunningRecordTest AttachApplication_001 end"); } /* @@ -568,7 +568,7 @@ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_001, TestSize.Level1) */ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_002, TestSize.Level1) { - APP_LOGI("AmsAppRunningRecordTest AttachApplication_002 start"); + HILOG_INFO("AmsAppRunningRecordTest AttachApplication_002 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -586,7 +586,7 @@ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_002, TestSize.Level1) EXPECT_CALL(*mockAppSchedulerClient_, ScheduleLaunchApplication(_, _)).Times(0); service_->AttachApplication(invalidPid, GetMockedAppSchedulerClient()); EXPECT_EQ(record->GetState(), ApplicationState::APP_STATE_CREATE); - APP_LOGI("AmsAppRunningRecordTest AttachApplication_002 end"); + HILOG_INFO("AmsAppRunningRecordTest AttachApplication_002 end"); } /* @@ -599,7 +599,7 @@ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_002, TestSize.Level1) */ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_003, TestSize.Level1) { - APP_LOGI("AmsAppRunningRecordTest AttachApplication_003 start"); + HILOG_INFO("AmsAppRunningRecordTest AttachApplication_003 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -617,7 +617,7 @@ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_003, TestSize.Level1) EXPECT_CALL(*mockAppSchedulerClient_, ScheduleLaunchApplication(_, _)).Times(0); service_->AttachApplication(anotherPid, GetMockedAppSchedulerClient()); EXPECT_EQ(record->GetState(), ApplicationState::APP_STATE_CREATE); - APP_LOGI("AmsAppRunningRecordTest AttachApplication_003 end"); + HILOG_INFO("AmsAppRunningRecordTest AttachApplication_003 end"); } /* @@ -630,7 +630,7 @@ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_003, TestSize.Level1) */ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_004, TestSize.Level1) { - APP_LOGI("AmsAppRunningRecordTest AttachApplication_004 start"); + HILOG_INFO("AmsAppRunningRecordTest AttachApplication_004 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -646,7 +646,7 @@ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_004, TestSize.Level1) auto record = StartLoadAbility(token, abilityInfo, appInfo, newPid); service_->AttachApplication(newPid, nullptr); EXPECT_EQ(record->GetState(), ApplicationState::APP_STATE_CREATE); - APP_LOGI("AmsAppRunningRecordTest AttachApplication_004 end"); + HILOG_INFO("AmsAppRunningRecordTest AttachApplication_004 end"); } /* @@ -659,7 +659,7 @@ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_004, TestSize.Level1) */ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_005, TestSize.Level1) { - APP_LOGI("AmsAppRunningRecordTest AttachApplication_005 start"); + HILOG_INFO("AmsAppRunningRecordTest AttachApplication_005 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -684,7 +684,7 @@ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_005, TestSize.Level1) EXPECT_CALL(*mockAppSchedulerClient_, ScheduleLaunchApplication(_, _)).Times(0); service_->AttachApplication(newPid, GetMockedAppSchedulerClient()); EXPECT_EQ(record->GetState(), ApplicationState::APP_STATE_READY); - APP_LOGI("AmsAppRunningRecordTest AttachApplication_005 end"); + HILOG_INFO("AmsAppRunningRecordTest AttachApplication_005 end"); } /* @@ -697,7 +697,7 @@ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_005, TestSize.Level1) */ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_006, TestSize.Level1) { - APP_LOGI("AmsAppRunningRecordTest AttachApplication_006 start"); + HILOG_INFO("AmsAppRunningRecordTest AttachApplication_006 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -736,7 +736,7 @@ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_006, TestSize.Level1) service_->AttachApplication(PID, mockAppSchedulerClient_); EXPECT_NE(record->GetApplicationClient(), nullptr); EXPECT_EQ(record->GetState(), ApplicationState::APP_STATE_READY); - APP_LOGI("AmsAppRunningRecordTest AttachApplication_006 end"); + HILOG_INFO("AmsAppRunningRecordTest AttachApplication_006 end"); } /* @@ -749,7 +749,7 @@ HWTEST_F(AmsAppRunningRecordTest, AttachApplication_006, TestSize.Level1) */ HWTEST_F(AmsAppRunningRecordTest, LaunchAbilityForApp_001, TestSize.Level1) { - APP_LOGI("AmsAppRunningRecordTest LaunchAbilityForApp_001 start"); + HILOG_INFO("AmsAppRunningRecordTest LaunchAbilityForApp_001 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -774,7 +774,7 @@ HWTEST_F(AmsAppRunningRecordTest, LaunchAbilityForApp_001, TestSize.Level1) record->SetApplicationClient(GetMockedAppSchedulerClient()); service_->LaunchApplication(record); EXPECT_EQ(record->GetState(), ApplicationState::APP_STATE_READY); - APP_LOGI("AmsAppRunningRecordTest LaunchAbilityForApp_001 end"); + HILOG_INFO("AmsAppRunningRecordTest LaunchAbilityForApp_001 end"); } /* @@ -787,7 +787,7 @@ HWTEST_F(AmsAppRunningRecordTest, LaunchAbilityForApp_001, TestSize.Level1) */ HWTEST_F(AmsAppRunningRecordTest, LaunchAbilityForApp_002, TestSize.Level1) { - APP_LOGI("AmsAppRunningRecordTest LaunchAbilityForApp_002 start"); + HILOG_INFO("AmsAppRunningRecordTest LaunchAbilityForApp_002 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -831,7 +831,7 @@ HWTEST_F(AmsAppRunningRecordTest, LaunchAbilityForApp_002, TestSize.Level1) record->SetApplicationClient(GetMockedAppSchedulerClient()); service_->LaunchApplication(record); EXPECT_EQ(record->GetState(), ApplicationState::APP_STATE_READY); - APP_LOGI("AmsAppRunningRecordTest LaunchAbilityForApp_002 end"); + HILOG_INFO("AmsAppRunningRecordTest LaunchAbilityForApp_002 end"); } /* @@ -844,7 +844,7 @@ HWTEST_F(AmsAppRunningRecordTest, LaunchAbilityForApp_002, TestSize.Level1) */ HWTEST_F(AmsAppRunningRecordTest, LaunchAbilityForApp_003, TestSize.Level1) { - APP_LOGI("AmsAppRunningRecordTest LaunchAbilityForApp_003 start"); + HILOG_INFO("AmsAppRunningRecordTest LaunchAbilityForApp_003 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -868,7 +868,7 @@ HWTEST_F(AmsAppRunningRecordTest, LaunchAbilityForApp_003, TestSize.Level1) EXPECT_CALL(*mockAppSchedulerClient_, ScheduleLaunchAbility(_, _, _)).Times(0); service_->LaunchApplication(record); EXPECT_EQ(record->GetState(), ApplicationState::APP_STATE_READY); - APP_LOGI("AmsAppRunningRecordTest LaunchAbilityForApp_003 end"); + HILOG_INFO("AmsAppRunningRecordTest LaunchAbilityForApp_003 end"); } /* @@ -881,7 +881,7 @@ HWTEST_F(AmsAppRunningRecordTest, LaunchAbilityForApp_003, TestSize.Level1) */ HWTEST_F(AmsAppRunningRecordTest, LaunchAbilityForApp_004, TestSize.Level1) { - APP_LOGI("AmsAppRunningRecordTest LaunchAbilityForApp_004 start"); + HILOG_INFO("AmsAppRunningRecordTest LaunchAbilityForApp_004 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -918,7 +918,7 @@ HWTEST_F(AmsAppRunningRecordTest, LaunchAbilityForApp_004, TestSize.Level1) EXPECT_CALL(*mockAppSchedulerClient_, ScheduleLaunchAbility(_, _, _)).Times(1); sptr token2 = new (std::nothrow) MockAbilityToken(); service_->LoadAbility(token2, nullptr, abilityInfo2, appInfo, nullptr); - APP_LOGI("AmsAppRunningRecordTest LaunchAbilityForApp_004 end"); + HILOG_INFO("AmsAppRunningRecordTest LaunchAbilityForApp_004 end"); } /* @@ -931,7 +931,7 @@ HWTEST_F(AmsAppRunningRecordTest, LaunchAbilityForApp_004, TestSize.Level1) */ HWTEST_F(AmsAppRunningRecordTest, LaunchAbilityForApp_005, TestSize.Level1) { - APP_LOGI("AmsAppRunningRecordTest LaunchAbilityForApp_005 start"); + HILOG_INFO("AmsAppRunningRecordTest LaunchAbilityForApp_005 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -974,7 +974,7 @@ HWTEST_F(AmsAppRunningRecordTest, LaunchAbilityForApp_005, TestSize.Level1) record->SetApplicationClient(GetMockedAppSchedulerClient()); service_->LaunchApplication(record); EXPECT_EQ(record->GetState(), ApplicationState::APP_STATE_READY); - APP_LOGI("AmsAppRunningRecordTest LaunchAbilityForApp_005 end"); + HILOG_INFO("AmsAppRunningRecordTest LaunchAbilityForApp_005 end"); } /* @@ -987,13 +987,13 @@ HWTEST_F(AmsAppRunningRecordTest, LaunchAbilityForApp_005, TestSize.Level1) */ HWTEST_F(AmsAppRunningRecordTest, TerminateAbility_001, TestSize.Level1) { - APP_LOGI("AmsAppRunningRecordTest TerminateAbility_001 start"); + HILOG_INFO("AmsAppRunningRecordTest TerminateAbility_001 start"); auto record = GetTestAppRunningRecord(); EXPECT_CALL(*mockAppSchedulerClient_, ScheduleCleanAbility(_)).Times(0); record->TerminateAbility(GetMockToken(), false); - APP_LOGI("AmsAppRunningRecordTest TerminateAbility_001 end"); + HILOG_INFO("AmsAppRunningRecordTest TerminateAbility_001 end"); } /* @@ -1006,7 +1006,7 @@ HWTEST_F(AmsAppRunningRecordTest, TerminateAbility_001, TestSize.Level1) */ HWTEST_F(AmsAppRunningRecordTest, TerminateAbility_002, TestSize.Level1) { - APP_LOGI("AmsAppRunningRecordTest TerminateAbility_002 start"); + HILOG_INFO("AmsAppRunningRecordTest TerminateAbility_002 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -1028,7 +1028,7 @@ HWTEST_F(AmsAppRunningRecordTest, TerminateAbility_002, TestSize.Level1) EXPECT_CALL(*mockAppSchedulerClient_, ScheduleCleanAbility(_)).Times(0); record->TerminateAbility(GetMockToken(), false); - APP_LOGI("AmsAppRunningRecordTest TerminateAbility_002 end"); + HILOG_INFO("AmsAppRunningRecordTest TerminateAbility_002 end"); } /* @@ -1041,13 +1041,13 @@ HWTEST_F(AmsAppRunningRecordTest, TerminateAbility_002, TestSize.Level1) */ HWTEST_F(AmsAppRunningRecordTest, AbilityTerminated_001, TestSize.Level1) { - APP_LOGI("AmsAppRunningRecordTest AbilityTerminated_001 start"); + HILOG_INFO("AmsAppRunningRecordTest AbilityTerminated_001 start"); auto record = GetTestAppRunningRecord(); EXPECT_CALL(*mockAppSchedulerClient_, ScheduleTerminateApplication()).Times(0); record->AbilityTerminated(nullptr); - APP_LOGI("AmsAppRunningRecordTest AbilityTerminated_001 end"); + HILOG_INFO("AmsAppRunningRecordTest AbilityTerminated_001 end"); } /* @@ -1060,7 +1060,7 @@ HWTEST_F(AmsAppRunningRecordTest, AbilityTerminated_001, TestSize.Level1) */ HWTEST_F(AmsAppRunningRecordTest, GetAbilityRunningRecord_001, TestSize.Level1) { - APP_LOGI("AmsAppRunningRecordTest GetAbilityRunningRecord_001 start"); + HILOG_INFO("AmsAppRunningRecordTest GetAbilityRunningRecord_001 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -1081,7 +1081,7 @@ HWTEST_F(AmsAppRunningRecordTest, GetAbilityRunningRecord_001, TestSize.Level1) std::string abilityName = "not_exist_ability_name"; EXPECT_EQ(nullptr, record->GetAbilityRunningRecord(abilityName)); - APP_LOGI("AmsAppRunningRecordTest GetAbilityRunningRecord_001 end"); + HILOG_INFO("AmsAppRunningRecordTest GetAbilityRunningRecord_001 end"); } /* @@ -1094,12 +1094,12 @@ HWTEST_F(AmsAppRunningRecordTest, GetAbilityRunningRecord_001, TestSize.Level1) */ HWTEST_F(AmsAppRunningRecordTest, GetAbilityRunningRecordByToken_001, TestSize.Level1) { - APP_LOGI("AmsAppRunningRecordTest GetAbilityRunningRecordByToken_001 start"); + HILOG_INFO("AmsAppRunningRecordTest GetAbilityRunningRecordByToken_001 start"); auto record = GetTestAppRunningRecord(); EXPECT_EQ(nullptr, record->GetAbilityRunningRecordByToken(nullptr)); - APP_LOGI("AmsAppRunningRecordTest GetAbilityRunningRecordByToken_001 end"); + HILOG_INFO("AmsAppRunningRecordTest GetAbilityRunningRecordByToken_001 end"); } /* diff --git a/services/appmgr/test/unittest/ams_app_workflow_test/ams_workflow_test.cpp b/services/appmgr/test/unittest/ams_app_workflow_test/ams_workflow_test.cpp index e6a901bdf4..9432cf0720 100644 --- a/services/appmgr/test/unittest/ams_app_workflow_test/ams_workflow_test.cpp +++ b/services/appmgr/test/unittest/ams_app_workflow_test/ams_workflow_test.cpp @@ -21,7 +21,7 @@ #include "iremote_object.h" #include "refbase.h" #include "app_launch_data.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "mock_ability_token.h" #include "mock_app_scheduler.h" #include "mock_app_spawn_client.h" @@ -171,7 +171,7 @@ TestApplicationPreRecord AmsWorkFlowTest::CreateTestApplicationRecord(const std: */ HWTEST_F(AmsWorkFlowTest, BackKey_001, TestSize.Level1) { - APP_LOGI("AmsWorkFlowTest BackKey_001 start"); + HILOG_INFO("AmsWorkFlowTest BackKey_001 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); @@ -190,7 +190,7 @@ HWTEST_F(AmsWorkFlowTest, BackKey_001, TestSize.Level1) EXPECT_EQ(ApplicationState::APP_STATE_FOREGROUND, appB.appRecord_->GetState()); EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, appA.GetAbility(tokenA)->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_BACKGROUND, appA.appRecord_->GetState()); - APP_LOGI("AmsWorkFlowTest BackKey_001 end"); + HILOG_INFO("AmsWorkFlowTest BackKey_001 end"); } /* @@ -202,7 +202,7 @@ HWTEST_F(AmsWorkFlowTest, BackKey_001, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, BackKey_002, TestSize.Level1) { - APP_LOGI("AmsWorkFlowTest BackKey_002 start"); + HILOG_INFO("AmsWorkFlowTest BackKey_002 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); @@ -217,7 +217,7 @@ HWTEST_F(AmsWorkFlowTest, BackKey_002, TestSize.Level1) EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, appA.GetAbility(tokenA)->GetState()); EXPECT_EQ(AbilityState::ABILITY_STATE_FOREGROUND, appA.GetAbility(tokenB)->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_FOREGROUND, appA.appRecord_->GetState()); - APP_LOGI("AmsWorkFlowTest BackKey_002 end"); + HILOG_INFO("AmsWorkFlowTest BackKey_002 end"); } /* @@ -229,7 +229,7 @@ HWTEST_F(AmsWorkFlowTest, BackKey_002, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, BackKey_003, TestSize.Level1) { - APP_LOGI("AmsWorkFlowTest BackKey_003 start"); + HILOG_INFO("AmsWorkFlowTest BackKey_003 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); @@ -253,7 +253,7 @@ HWTEST_F(AmsWorkFlowTest, BackKey_003, TestSize.Level1) EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, appA.GetAbility(tokenA)->GetState()); EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, appA.GetAbility(tokenB)->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_BACKGROUND, appA.appRecord_->GetState()); - APP_LOGI("AmsWorkFlowTest BackKey_003 end"); + HILOG_INFO("AmsWorkFlowTest BackKey_003 end"); } /* @@ -265,7 +265,7 @@ HWTEST_F(AmsWorkFlowTest, BackKey_003, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, BackKey_004, TestSize.Level1) { - APP_LOGI("AmsWorkFlowTest BackKey_004 start"); + HILOG_INFO("AmsWorkFlowTest BackKey_004 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); @@ -294,7 +294,7 @@ HWTEST_F(AmsWorkFlowTest, BackKey_004, TestSize.Level1) EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, appA.GetAbility(tokenA)->GetState()); EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, appA.GetAbility(tokenB)->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_BACKGROUND, appA.appRecord_->GetState()); - APP_LOGI("AmsWorkFlowTest BackKey_004 end"); + HILOG_INFO("AmsWorkFlowTest BackKey_004 end"); } /* @@ -307,7 +307,7 @@ HWTEST_F(AmsWorkFlowTest, BackKey_004, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, BackKey_005, TestSize.Level1) { - APP_LOGI("AmsWorkFlowTest BackKey_005 start"); + HILOG_INFO("AmsWorkFlowTest BackKey_005 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); @@ -333,7 +333,7 @@ HWTEST_F(AmsWorkFlowTest, BackKey_005, TestSize.Level1) EXPECT_EQ(ApplicationState::APP_STATE_FOREGROUND, appB.appRecord_->GetState()); EXPECT_EQ(appA.GetAbility(tokenA), nullptr); EXPECT_EQ(ApplicationState::APP_STATE_TERMINATED, appA.appRecord_->GetState()); - APP_LOGI("AmsWorkFlowTest BackKey_005 end"); + HILOG_INFO("AmsWorkFlowTest BackKey_005 end"); } /* @@ -345,7 +345,7 @@ HWTEST_F(AmsWorkFlowTest, BackKey_005, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, BackKey_006, TestSize.Level1) { - APP_LOGI("AmsWorkFlowTest BackKey_006 start"); + HILOG_INFO("AmsWorkFlowTest BackKey_006 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); @@ -378,7 +378,7 @@ HWTEST_F(AmsWorkFlowTest, BackKey_006, TestSize.Level1) EXPECT_EQ(appA.GetAbility(tokenA), nullptr); EXPECT_EQ(appA.GetAbility(tokenB), nullptr); EXPECT_EQ(ApplicationState::APP_STATE_TERMINATED, appA.appRecord_->GetState()); - APP_LOGI("AmsWorkFlowTest BackKey_006 end"); + HILOG_INFO("AmsWorkFlowTest BackKey_006 end"); } /* @@ -391,7 +391,7 @@ HWTEST_F(AmsWorkFlowTest, BackKey_006, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, BackKey_007, TestSize.Level1) { - APP_LOGI("AmsWorkFlowTest BackKey_007 start"); + HILOG_INFO("AmsWorkFlowTest BackKey_007 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); @@ -429,7 +429,7 @@ HWTEST_F(AmsWorkFlowTest, BackKey_007, TestSize.Level1) EXPECT_EQ(appA.GetAbility(tokenA), nullptr); EXPECT_EQ(appA.GetAbility(tokenB), nullptr); EXPECT_EQ(ApplicationState::APP_STATE_TERMINATED, appA.appRecord_->GetState()); - APP_LOGI("AmsWorkFlowTest BackKey_007 end"); + HILOG_INFO("AmsWorkFlowTest BackKey_007 end"); } /* @@ -441,7 +441,7 @@ HWTEST_F(AmsWorkFlowTest, BackKey_007, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, ScreenOff_001, TestSize.Level1) { - APP_LOGI("AmsWorkFlowTest ScreenOff_001 start"); + HILOG_INFO("AmsWorkFlowTest ScreenOff_001 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); @@ -452,7 +452,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOff_001, TestSize.Level1) EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, appA.GetAbility(tokenA)->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_BACKGROUND, appA.appRecord_->GetState()); - APP_LOGI("AmsWorkFlowTest ScreenOff_001 end"); + HILOG_INFO("AmsWorkFlowTest ScreenOff_001 end"); } /* @@ -464,7 +464,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOff_001, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, ScreenOff_002, TestSize.Level1) { - APP_LOGI("AmsWorkFlowTest ScreenOff_002 start"); + HILOG_INFO("AmsWorkFlowTest ScreenOff_002 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); @@ -480,7 +480,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOff_002, TestSize.Level1) EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, appA.GetAbility(tokenA)->GetState()); EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, appA.GetAbility(tokenB)->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_BACKGROUND, appA.appRecord_->GetState()); - APP_LOGI("AmsWorkFlowTest ScreenOff_002 end"); + HILOG_INFO("AmsWorkFlowTest ScreenOff_002 end"); } /* @@ -492,7 +492,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOff_002, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, ScreenOff_003, TestSize.Level1) { - APP_LOGI("AmsWorkFlowTest ScreenOff_003 start"); + HILOG_INFO("AmsWorkFlowTest ScreenOff_003 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); @@ -507,7 +507,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOff_003, TestSize.Level1) EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, appA.GetAbility(tokenA)->GetState()); EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, appA.GetAbility(tokenB)->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_BACKGROUND, appA.appRecord_->GetState()); - APP_LOGI("AmsWorkFlowTest ScreenOff_003 end"); + HILOG_INFO("AmsWorkFlowTest ScreenOff_003 end"); } /* @@ -519,7 +519,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOff_003, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, ScreenOff_004, TestSize.Level1) { - APP_LOGI("AmsWorkFlowTest ScreenOff_004 start"); + HILOG_INFO("AmsWorkFlowTest ScreenOff_004 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); @@ -536,7 +536,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOff_004, TestSize.Level1) EXPECT_EQ(appA.GetAbility(tokenA), nullptr); EXPECT_EQ(ApplicationState::APP_STATE_TERMINATED, appA.appRecord_->GetState()); - APP_LOGI("AmsWorkFlowTest ScreenOff_004 end"); + HILOG_INFO("AmsWorkFlowTest ScreenOff_004 end"); } /* @@ -548,7 +548,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOff_004, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, ScreenOff_005, TestSize.Level1) { - APP_LOGI("AmsWorkFlowTest ScreenOff_005 start"); + HILOG_INFO("AmsWorkFlowTest ScreenOff_005 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); @@ -572,7 +572,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOff_005, TestSize.Level1) EXPECT_EQ(appA.GetAbility(tokenA), nullptr); EXPECT_EQ(appA.GetAbility(tokenB), nullptr); EXPECT_EQ(ApplicationState::APP_STATE_TERMINATED, appA.appRecord_->GetState()); - APP_LOGI("AmsWorkFlowTest ScreenOff_005 end"); + HILOG_INFO("AmsWorkFlowTest ScreenOff_005 end"); } /* @@ -585,7 +585,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOff_005, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, ScreenOff_006, TestSize.Level1) { - APP_LOGI("AmsWorkFlowTest ScreenOff_006 start"); + HILOG_INFO("AmsWorkFlowTest ScreenOff_006 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); @@ -608,7 +608,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOff_006, TestSize.Level1) EXPECT_EQ(appA.GetAbility(tokenA), nullptr); EXPECT_EQ(appA.GetAbility(tokenB), nullptr); EXPECT_EQ(ApplicationState::APP_STATE_TERMINATED, appA.appRecord_->GetState()); - APP_LOGI("AmsWorkFlowTest ScreenOff_006 end"); + HILOG_INFO("AmsWorkFlowTest ScreenOff_006 end"); } /* @@ -620,7 +620,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOff_006, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, ScreenOn_001, TestSize.Level1) { - APP_LOGI("AmsWorkFlowTest ScreenOn_001 start"); + HILOG_INFO("AmsWorkFlowTest ScreenOn_001 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_BACKGROUND, ApplicationState::APP_STATE_BACKGROUND); @@ -631,7 +631,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOn_001, TestSize.Level1) EXPECT_EQ(AbilityState::ABILITY_STATE_FOREGROUND, appA.GetAbility(tokenA)->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_FOREGROUND, appA.appRecord_->GetState()); - APP_LOGI("AmsWorkFlowTest ScreenOn_001 end"); + HILOG_INFO("AmsWorkFlowTest ScreenOn_001 end"); } /* @@ -643,7 +643,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOn_001, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, ScreenOn_002, TestSize.Level1) { - APP_LOGI("AmsWorkFlowTest ScreenOn_002 start"); + HILOG_INFO("AmsWorkFlowTest ScreenOn_002 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_BACKGROUND, ApplicationState::APP_STATE_BACKGROUND); @@ -658,7 +658,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOn_002, TestSize.Level1) EXPECT_EQ(AbilityState::ABILITY_STATE_FOREGROUND, appA.GetAbility(tokenA)->GetState()); EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, appA.GetAbility(tokenB)->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_FOREGROUND, appA.appRecord_->GetState()); - APP_LOGI("AmsWorkFlowTest ScreenOn_002 end"); + HILOG_INFO("AmsWorkFlowTest ScreenOn_002 end"); } /* @@ -670,7 +670,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOn_002, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, ScreenOn_003, TestSize.Level1) { - APP_LOGI("AmsWorkFlowTest ScreenOn_003 start"); + HILOG_INFO("AmsWorkFlowTest ScreenOn_003 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_BACKGROUND, ApplicationState::APP_STATE_BACKGROUND); @@ -686,7 +686,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOn_003, TestSize.Level1) EXPECT_EQ(AbilityState::ABILITY_STATE_FOREGROUND, appA.GetAbility(tokenA)->GetState()); EXPECT_EQ(AbilityState::ABILITY_STATE_FOREGROUND, appA.GetAbility(tokenB)->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_FOREGROUND, appA.appRecord_->GetState()); - APP_LOGI("AmsWorkFlowTest ScreenOn_003 end"); + HILOG_INFO("AmsWorkFlowTest ScreenOn_003 end"); } /* @@ -698,7 +698,7 @@ HWTEST_F(AmsWorkFlowTest, ScreenOn_003, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, ChangeAbility_001, TestSize.Level1) { - APP_LOGD("AmsWorkFlowTest ChangeAbility_001 start"); + HILOG_DEBUG("AmsWorkFlowTest ChangeAbility_001 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); @@ -731,7 +731,7 @@ HWTEST_F(AmsWorkFlowTest, ChangeAbility_001, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, ChangeAbility_002, TestSize.Level1) { - APP_LOGD("AmsWorkFlowTest ChangeAbility_001 start"); + HILOG_DEBUG("AmsWorkFlowTest ChangeAbility_001 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); @@ -772,7 +772,7 @@ HWTEST_F(AmsWorkFlowTest, ChangeAbility_002, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, ChangeAbility_003, TestSize.Level1) { - APP_LOGD("AmsWorkFlowTest ChangeAbility_001 start"); + HILOG_DEBUG("AmsWorkFlowTest ChangeAbility_001 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); @@ -814,7 +814,7 @@ HWTEST_F(AmsWorkFlowTest, ChangeAbility_003, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, ChangeAbility_004, TestSize.Level1) { - APP_LOGD("AmsWorkFlowTest ChangeAbility_004 start"); + HILOG_DEBUG("AmsWorkFlowTest ChangeAbility_004 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); @@ -865,7 +865,7 @@ HWTEST_F(AmsWorkFlowTest, ChangeAbility_004, TestSize.Level1) */ HWTEST_F(AmsWorkFlowTest, ChangeAbility_005, TestSize.Level1) { - APP_LOGD("AmsWorkFlowTest ChangeAbility_004 start"); + HILOG_DEBUG("AmsWorkFlowTest ChangeAbility_004 start"); sptr tokenA = new MockAbilityToken(); TestApplicationPreRecord appA = CreateTestApplicationRecord( "A", tokenA, "A", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); diff --git a/services/appmgr/test/unittest/ams_ipc_interface_test/ams_ipc_appmgr_interface_test.cpp b/services/appmgr/test/unittest/ams_ipc_interface_test/ams_ipc_appmgr_interface_test.cpp index 9bfd1a4b3e..4aaab58f4a 100644 --- a/services/appmgr/test/unittest/ams_ipc_interface_test/ams_ipc_appmgr_interface_test.cpp +++ b/services/appmgr/test/unittest/ams_ipc_interface_test/ams_ipc_appmgr_interface_test.cpp @@ -18,9 +18,9 @@ #include #include "errors.h" #include "ipc_types.h" -#include "app_log_wrapper.h" #include "app_mgr_proxy.h" #include "app_record_id.h" +#include "hilog_wrapper.h" #include "mock_application.h" #include "mock_app_mgr_service.h" #include "application_state_observer_stub.h" @@ -65,7 +65,7 @@ void AmsIpcAppMgrInterfaceTest::TearDown() */ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_001, TestSize.Level1) { - APP_LOGD("AppMgrIpcInterfaceTest_AppMgr_001 start"); + HILOG_DEBUG("AppMgrIpcInterfaceTest_AppMgr_001 start"); sptr mockAppMgr(new MockAppMgrService()); sptr appMgrClient = iface_cast(mockAppMgr); sptr app(new MockApplication()); @@ -74,7 +74,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_001, TestSize.Level1) .WillOnce(InvokeWithoutArgs(mockAppMgr.GetRefPtr(), &MockAppMgrService::Post)); appMgrClient->AttachApplication(app); mockAppMgr->Wait(); - APP_LOGD("AppMgrIpcInterfaceTest_AppMgr_001 end"); + HILOG_DEBUG("AppMgrIpcInterfaceTest_AppMgr_001 end"); } /* @@ -86,7 +86,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_001, TestSize.Level1) */ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_002, TestSize.Level1) { - APP_LOGD("AppMgrIpcInterfaceTest_AppMgr_002 start"); + HILOG_DEBUG("AppMgrIpcInterfaceTest_AppMgr_002 start"); sptr mockAppMgr(new MockAppMgrService()); sptr appMgrClient = iface_cast(mockAppMgr); @@ -95,7 +95,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_002, TestSize.Level1) auto recordId = AppRecordId::Create(); appMgrClient->ApplicationForegrounded(recordId); mockAppMgr->Wait(); - APP_LOGD("AppMgrIpcInterfaceTest_AppMgr_002 end"); + HILOG_DEBUG("AppMgrIpcInterfaceTest_AppMgr_002 end"); } /* @@ -107,7 +107,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_002, TestSize.Level1) */ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_003, TestSize.Level1) { - APP_LOGD("AppMgrIpcInterfaceTest_AppMgr_003 start"); + HILOG_DEBUG("AppMgrIpcInterfaceTest_AppMgr_003 start"); sptr mockAppMgr(new MockAppMgrService()); sptr appMgrClient = iface_cast(mockAppMgr); @@ -116,7 +116,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_003, TestSize.Level1) auto recordId = AppRecordId::Create(); appMgrClient->ApplicationBackgrounded(recordId); mockAppMgr->Wait(); - APP_LOGD("AppMgrIpcInterfaceTest_AppMgr_003 end"); + HILOG_DEBUG("AppMgrIpcInterfaceTest_AppMgr_003 end"); } /* @@ -128,7 +128,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_003, TestSize.Level1) */ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_004, TestSize.Level1) { - APP_LOGD("AppMgrIpcInterfaceTest_AppMgr_004 start"); + HILOG_DEBUG("AppMgrIpcInterfaceTest_AppMgr_004 start"); sptr mockAppMgr(new MockAppMgrService()); sptr appMgrClient = iface_cast(mockAppMgr); @@ -137,7 +137,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_004, TestSize.Level1) auto recordId = AppRecordId::Create(); appMgrClient->ApplicationTerminated(recordId); mockAppMgr->Wait(); - APP_LOGD("AppMgrIpcInterfaceTest_AppMgr_004 end"); + HILOG_DEBUG("AppMgrIpcInterfaceTest_AppMgr_004 end"); } /* @@ -149,7 +149,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_004, TestSize.Level1) */ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_005, TestSize.Level1) { - APP_LOGD("AppMgrIpcInterfaceTest_AppMgr_005 start"); + HILOG_DEBUG("AppMgrIpcInterfaceTest_AppMgr_005 start"); sptr mockAppMgr(new MockAppMgrService()); sptr appMgrClient = iface_cast(mockAppMgr); @@ -166,7 +166,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_005, TestSize.Level1) ret = appMgrClient->CheckPermission(recordId, "location"); EXPECT_EQ(OHOS::ERR_INVALID_STATE, ret); - APP_LOGD("AppMgrIpcInterfaceTest_AppMgr_005 end"); + HILOG_DEBUG("AppMgrIpcInterfaceTest_AppMgr_005 end"); } /* @@ -178,7 +178,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_005, TestSize.Level1) */ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_006, TestSize.Level1) { - APP_LOGD("AppMgrIpcInterfaceTest_AppMgr_006 start"); + HILOG_DEBUG("AppMgrIpcInterfaceTest_AppMgr_006 start"); sptr mockAppMgr(new MockAppMgrService()); sptr appMgrClient = iface_cast(mockAppMgr); @@ -189,7 +189,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_006, TestSize.Level1) int ret = appMgrClient->CheckPermission(recordId, "write"); EXPECT_EQ(0, ret); EXPECT_EQ("write", mockAppMgr->GetData()); - APP_LOGD("AppMgrIpcInterfaceTest_AppMgr_006 end"); + HILOG_DEBUG("AppMgrIpcInterfaceTest_AppMgr_006 end"); } /* @@ -201,7 +201,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, Interface_006, TestSize.Level1) */ HWTEST_F(AmsIpcAppMgrInterfaceTest, ClearUpApplicationData_008, TestSize.Level1) { - APP_LOGD("ClearUpApplicationData_008 start"); + HILOG_DEBUG("ClearUpApplicationData_008 start"); sptr mockAppMgr(new MockAppMgrService()); sptr appMgrClient = iface_cast(mockAppMgr); @@ -210,7 +210,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, ClearUpApplicationData_008, TestSize.Level1) appMgrClient->ClearUpApplicationData("PROCESS"); - APP_LOGD("ClearUpApplicationData_008 end"); + HILOG_DEBUG("ClearUpApplicationData_008 end"); } /* @@ -222,7 +222,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, ClearUpApplicationData_008, TestSize.Level1) */ HWTEST_F(AmsIpcAppMgrInterfaceTest, GetAllRunningProcesses_010, TestSize.Level1) { - APP_LOGD("GetAllRunningProcesses_009 start"); + HILOG_DEBUG("GetAllRunningProcesses_009 start"); sptr mockAppMgr(new MockAppMgrService()); sptr appMgrClient = iface_cast(mockAppMgr); @@ -237,7 +237,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, GetAllRunningProcesses_010, TestSize.Level1) ret = appMgrClient->GetAllRunningProcesses(runningProcessInfo); EXPECT_EQ(ret, OHOS::ERR_NONE); - APP_LOGD("GetAllRunningProcesses_009 end"); + HILOG_DEBUG("GetAllRunningProcesses_009 end"); } /* @@ -249,7 +249,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, GetAllRunningProcesses_010, TestSize.Level1) */ HWTEST_F(AmsIpcAppMgrInterfaceTest, GetSystemMemoryAttr_0100, TestSize.Level1) { - APP_LOGD("GetSystemMemoryAttr_0100 start"); + HILOG_DEBUG("GetSystemMemoryAttr_0100 start"); OHOS::AppExecFwk::SystemMemoryAttr memInfo; std::string strConfig; @@ -272,7 +272,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, GetSystemMemoryAttr_0100, TestSize.Level1) EXPECT_EQ(1, memInfo.totalSysMem_); EXPECT_TRUE(memInfo.isSysInlowMem_); - APP_LOGD("GetSystemMemoryAttr_0100 end"); + HILOG_DEBUG("GetSystemMemoryAttr_0100 end"); } /* @@ -284,7 +284,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, GetSystemMemoryAttr_0100, TestSize.Level1) */ HWTEST_F(AmsIpcAppMgrInterfaceTest, RegisterApplicationStateObserver_001, TestSize.Level0) { - APP_LOGD("RegisterApplicationStateObserver_001 start"); + HILOG_DEBUG("RegisterApplicationStateObserver_001 start"); sptr observer = new ApplicationStateObserverStub(); sptr mockAppMgr(new MockAppMgrService()); @@ -296,7 +296,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, RegisterApplicationStateObserver_001, TestSi EXPECT_EQ(OHOS::NO_ERROR, err); - APP_LOGD("RegisterApplicationStateObserver_001 end"); + HILOG_DEBUG("RegisterApplicationStateObserver_001 end"); } /* @@ -308,7 +308,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, RegisterApplicationStateObserver_001, TestSi */ HWTEST_F(AmsIpcAppMgrInterfaceTest, UnregisterApplicationStateObserver_001, TestSize.Level0) { - APP_LOGD("UnregisterApplicationStateObserver_001 start"); + HILOG_DEBUG("UnregisterApplicationStateObserver_001 start"); sptr observer = new ApplicationStateObserverStub(); sptr mockAppMgr(new MockAppMgrService()); @@ -320,7 +320,7 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, UnregisterApplicationStateObserver_001, Test EXPECT_EQ(OHOS::NO_ERROR, err); - APP_LOGD("UnregisterApplicationStateObserver_001 end"); + HILOG_DEBUG("UnregisterApplicationStateObserver_001 end"); } } // namespace AppExecFwk } // namespace OHOS diff --git a/services/appmgr/test/unittest/ams_ipc_interface_test/ams_ipc_appscheduler_interface_test.cpp b/services/appmgr/test/unittest/ams_ipc_interface_test/ams_ipc_appscheduler_interface_test.cpp index b8a470c22b..a3bb03f0cb 100644 --- a/services/appmgr/test/unittest/ams_ipc_interface_test/ams_ipc_appscheduler_interface_test.cpp +++ b/services/appmgr/test/unittest/ams_ipc_interface_test/ams_ipc_appscheduler_interface_test.cpp @@ -15,8 +15,8 @@ #include "app_scheduler_proxy.h" #include -#include "app_log_wrapper.h" #include "app_scheduler_host.h" +#include "hilog_wrapper.h" #include "mock_ability_token.h" #include "mock_application.h" @@ -67,7 +67,7 @@ void AmsIpcAppSchedulerInterfaceTest::TearDown() */ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_001, TestSize.Level1) { - APP_LOGD("AppSchedulerInterfaceTest_001 start"); + HILOG_DEBUG("AppSchedulerInterfaceTest_001 start"); sptr mockApplication(new MockApplication()); sptr client = iface_cast(mockApplication); @@ -76,7 +76,7 @@ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_001, TestSize.Level1) .WillOnce(InvokeWithoutArgs(mockApplication.GetRefPtr(), &MockApplication::Post)); client->ScheduleForegroundApplication(); mockApplication->Wait(); - APP_LOGD("AppSchedulerInterfaceTest_001 end"); + HILOG_DEBUG("AppSchedulerInterfaceTest_001 end"); } /* @@ -89,7 +89,7 @@ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_001, TestSize.Level1) */ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_002, TestSize.Level1) { - APP_LOGD("AppSchedulerInterfaceTest_002 start"); + HILOG_DEBUG("AppSchedulerInterfaceTest_002 start"); sptr mockApplication(new MockApplication()); sptr client = iface_cast(mockApplication); @@ -98,7 +98,7 @@ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_002, TestSize.Level1) .WillOnce(InvokeWithoutArgs(mockApplication.GetRefPtr(), &MockApplication::Post)); client->ScheduleBackgroundApplication(); mockApplication->Wait(); - APP_LOGD("AppSchedulerInterfaceTest_002 end"); + HILOG_DEBUG("AppSchedulerInterfaceTest_002 end"); } /* @@ -111,7 +111,7 @@ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_002, TestSize.Level1) */ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_003, TestSize.Level1) { - APP_LOGD("AppSchedulerInterfaceTest_003 start"); + HILOG_DEBUG("AppSchedulerInterfaceTest_003 start"); sptr mockApplication(new MockApplication()); sptr client = iface_cast(mockApplication); @@ -120,7 +120,7 @@ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_003, TestSize.Level1) .WillOnce(InvokeWithoutArgs(mockApplication.GetRefPtr(), &MockApplication::Post)); client->ScheduleTerminateApplication(); mockApplication->Wait(); - APP_LOGD("AppSchedulerInterfaceTest_003 end"); + HILOG_DEBUG("AppSchedulerInterfaceTest_003 end"); } /* @@ -133,7 +133,7 @@ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_003, TestSize.Level1) */ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_004, TestSize.Level1) { - APP_LOGD("AppSchedulerInterfaceTest_004 start"); + HILOG_DEBUG("AppSchedulerInterfaceTest_004 start"); sptr mockApplication(new MockApplication()); sptr client = iface_cast(mockApplication); int level = 1; @@ -146,7 +146,7 @@ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_004, TestSize.Level1) int shrinkLevel = mockApplication->GetShrinkLevel(); EXPECT_EQ(level, shrinkLevel); - APP_LOGD("AppSchedulerInterfaceTest_004 end"); + HILOG_DEBUG("AppSchedulerInterfaceTest_004 end"); } /* @@ -159,7 +159,7 @@ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_004, TestSize.Level1) */ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_005, TestSize.Level1) { - APP_LOGD("AppSchedulerInterfaceTest_005 start"); + HILOG_DEBUG("AppSchedulerInterfaceTest_005 start"); sptr mockApplication(new MockApplication()); sptr client = iface_cast(mockApplication); @@ -168,7 +168,7 @@ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_005, TestSize.Level1) .WillOnce(InvokeWithoutArgs(mockApplication.GetRefPtr(), &MockApplication::Post)); client->ScheduleLowMemory(); mockApplication->Wait(); - APP_LOGD("AppSchedulerInterfaceTest_005 end"); + HILOG_DEBUG("AppSchedulerInterfaceTest_005 end"); } /* @@ -181,7 +181,7 @@ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_005, TestSize.Level1) */ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_006, TestSize.Level1) { - APP_LOGD("AppSchedulerInterfaceTest_006 start"); + HILOG_DEBUG("AppSchedulerInterfaceTest_006 start"); sptr mockApplication(new MockApplication()); sptr client = iface_cast(mockApplication); @@ -207,7 +207,7 @@ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_006, TestSize.Level1) bool isEqual = mockApplication->CompareAppLaunchData(launchData); EXPECT_EQ(true, isEqual); - APP_LOGD("AppSchedulerInterfaceTest_006 end"); + HILOG_DEBUG("AppSchedulerInterfaceTest_006 end"); } /* @@ -220,7 +220,7 @@ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_006, TestSize.Level1) */ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_008, TestSize.Level1) { - APP_LOGD("AppSchedulerInterfaceTest_008 start"); + HILOG_DEBUG("AppSchedulerInterfaceTest_008 start"); sptr mockApplication(new MockApplication()); sptr client = iface_cast(mockApplication); @@ -229,7 +229,7 @@ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_008, TestSize.Level1) .WillOnce(InvokeWithoutArgs(mockApplication.GetRefPtr(), &MockApplication::Post)); client->ScheduleCleanAbility(GetMockToken()); mockApplication->Wait(); - APP_LOGD("AppSchedulerInterfaceTest_008 end"); + HILOG_DEBUG("AppSchedulerInterfaceTest_008 end"); } /* @@ -242,7 +242,7 @@ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_008, TestSize.Level1) */ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_009, TestSize.Level1) { - APP_LOGD("AppSchedulerInterfaceTest_009 start"); + HILOG_DEBUG("AppSchedulerInterfaceTest_009 start"); sptr mockApplication(new MockApplication()); sptr client = iface_cast(mockApplication); std::string profileName("mockProfile"); @@ -256,7 +256,7 @@ HWTEST_F(AmsIpcAppSchedulerInterfaceTest, Interface_009, TestSize.Level1) bool isEqual = mockApplication->CompareProfile(profile); EXPECT_EQ(true, isEqual); - APP_LOGD("AppSchedulerInterfaceTest_009 end"); + HILOG_DEBUG("AppSchedulerInterfaceTest_009 end"); } } // namespace AppExecFwk } // namespace OHOS diff --git a/services/appmgr/test/unittest/ams_mgr_kill_process_test/ams_mgr_kill_process_test.cpp b/services/appmgr/test/unittest/ams_mgr_kill_process_test/ams_mgr_kill_process_test.cpp index e85f21b5b0..c3414c3a23 100644 --- a/services/appmgr/test/unittest/ams_mgr_kill_process_test/ams_mgr_kill_process_test.cpp +++ b/services/appmgr/test/unittest/ams_mgr_kill_process_test/ams_mgr_kill_process_test.cpp @@ -18,8 +18,8 @@ #define private public #include "ams_mgr_scheduler.h" #undef private -#include "app_log_wrapper.h" #include "app_mgr_interface.h" +#include "hilog_wrapper.h" #include "mock_bundle_manager.h" #include "system_ability_definition.h" #include "sys_mgr_client.h" @@ -92,7 +92,7 @@ sptr AmsMgrKillProcessTest::GetAppMgrProxy(void) */ HWTEST_F(AmsMgrKillProcessTest, KillProcess_0100, TestSize.Level0) { - APP_LOGI("AmsMgrKillProcessTest_KillProcess_0100"); + HILOG_INFO("AmsMgrKillProcessTest_KillProcess_0100"); auto appMgrServiceInner = GetAppMgrServiceInner(); EXPECT_NE(appMgrServiceInner, nullptr); @@ -111,7 +111,7 @@ HWTEST_F(AmsMgrKillProcessTest, KillProcess_0100, TestSize.Level0) */ HWTEST_F(AmsMgrKillProcessTest, KillProcess_0200, TestSize.Level0) { - APP_LOGI("AmsMgrKillProcessTest_KillProcess_0200"); + HILOG_INFO("AmsMgrKillProcessTest_KillProcess_0200"); auto proxy = GetAppMgrProxy(); EXPECT_NE(proxy, nullptr); diff --git a/services/appmgr/test/unittest/ams_mgr_proxy_test/BUILD.gn b/services/appmgr/test/unittest/ams_mgr_proxy_test/BUILD.gn index 59c55e8b7d..52e1310445 100644 --- a/services/appmgr/test/unittest/ams_mgr_proxy_test/BUILD.gn +++ b/services/appmgr/test/unittest/ams_mgr_proxy_test/BUILD.gn @@ -34,6 +34,7 @@ ohos_unittest("AmsMgrProxyTest") { ] external_deps = [ + "ability_base:configuration", "ability_base:want", "ability_runtime:app_manager", "appspawn:appspawn_socket_client", diff --git a/services/appmgr/test/unittest/ams_mgr_scheduler_dump_test/BUILD.gn b/services/appmgr/test/unittest/ams_mgr_scheduler_dump_test/BUILD.gn index 085a41356c..32a6e16cfd 100644 --- a/services/appmgr/test/unittest/ams_mgr_scheduler_dump_test/BUILD.gn +++ b/services/appmgr/test/unittest/ams_mgr_scheduler_dump_test/BUILD.gn @@ -31,6 +31,7 @@ ohos_unittest("ams_mgr_scheduler_dump_test") { ] external_deps = [ + "ability_base:configuration", "ability_base:want", "ability_runtime:app_manager", "bundle_framework:appexecfwk_base", diff --git a/services/appmgr/test/unittest/ams_mgr_scheduler_dump_test/ams_mgr_scheduler_dump_test.cpp b/services/appmgr/test/unittest/ams_mgr_scheduler_dump_test/ams_mgr_scheduler_dump_test.cpp index dd48c0fd24..b18e2934a7 100644 --- a/services/appmgr/test/unittest/ams_mgr_scheduler_dump_test/ams_mgr_scheduler_dump_test.cpp +++ b/services/appmgr/test/unittest/ams_mgr_scheduler_dump_test/ams_mgr_scheduler_dump_test.cpp @@ -18,7 +18,7 @@ #define private public #include "ams_mgr_scheduler.h" #undef private -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" using namespace testing; using namespace testing::ext; @@ -57,7 +57,7 @@ void AmsMgrSchedulerDumpTest::TearDown() */ HWTEST_F(AmsMgrSchedulerDumpTest, AmsMgrSchedulerDump_GetConfiguration_0100, TestSize.Level0) { - APP_LOGI("AmsMgrSchedulerDump_GetConfiguration_0100 start"); + HILOG_INFO("AmsMgrSchedulerDump_GetConfiguration_0100 start"); auto appMgrServiceInner = std::make_shared(); EXPECT_NE(appMgrServiceInner, nullptr); @@ -80,7 +80,7 @@ HWTEST_F(AmsMgrSchedulerDumpTest, AmsMgrSchedulerDump_GetConfiguration_0100, Tes EXPECT_EQ(result, ERR_OK); EXPECT_EQ(configFromAmsMgrScheduler.defaultDisplayId_, config->defaultDisplayId_); - APP_LOGI("AmsMgrSchedulerDump_GetConfiguration_0100 end"); + HILOG_INFO("AmsMgrSchedulerDump_GetConfiguration_0100 end"); } } // namespace AppExecFwk } // namespace OHOS diff --git a/services/appmgr/test/unittest/ams_mgr_scheduler_test/ams_mgr_scheduler_test.cpp b/services/appmgr/test/unittest/ams_mgr_scheduler_test/ams_mgr_scheduler_test.cpp index 0a99396ef8..a8972c2df4 100644 --- a/services/appmgr/test/unittest/ams_mgr_scheduler_test/ams_mgr_scheduler_test.cpp +++ b/services/appmgr/test/unittest/ams_mgr_scheduler_test/ams_mgr_scheduler_test.cpp @@ -19,8 +19,8 @@ #include "ams_mgr_scheduler.h" #undef private -#include "app_log_wrapper.h" #include "app_state_callback_host.h" +#include "hilog_wrapper.h" #include "mock_ability_token.h" #include "mock_app_mgr_service_inner.h" #include "application_state_observer_stub.h" @@ -100,7 +100,7 @@ std::shared_ptr AmsMgrSchedulerTest::GetAmsEventHandler() */ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_001, TestSize.Level1) { - APP_LOGD("AmsMgrScheduler_001 start."); + HILOG_DEBUG("AmsMgrScheduler_001 start."); auto mockAppMgrServiceInner = GetMockAppMgrServiceInner(); auto amsEventHandler = GetAmsEventHandler(); @@ -119,7 +119,7 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_001, TestSize.Level1) amsMgrScheduler->LoadAbility(token, preToken, abilityInfo, applicationInfo, nullptr); mockAppMgrServiceInner->Wait(); - APP_LOGD("AmsMgrScheduler_001 end."); + HILOG_DEBUG("AmsMgrScheduler_001 end."); } /* @@ -132,7 +132,7 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_001, TestSize.Level1) */ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_002, TestSize.Level1) { - APP_LOGD("AmsMgrScheduler_002 start."); + HILOG_DEBUG("AmsMgrScheduler_002 start."); auto mockAppMgrServiceInner = std::make_shared(); auto eventRunner = EventRunner::Create("AmsMgrSchedulerTest"); @@ -155,7 +155,7 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_002, TestSize.Level1) EXPECT_CALL(*mockAppMgrServiceInner, LoadAbility(_, _, _, _, _)).Times(0); amsMgrScheduler->LoadAbility(token, preToken, abilityInfo, nullptr, nullptr); - APP_LOGD("AmsMgrScheduler_002 end."); + HILOG_DEBUG("AmsMgrScheduler_002 end."); } /* @@ -168,7 +168,7 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_002, TestSize.Level1) */ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_003, TestSize.Level1) { - APP_LOGD("AmsMgrScheduler_003 start."); + HILOG_DEBUG("AmsMgrScheduler_003 start."); auto mockAppMgrServiceInner = GetMockAppMgrServiceInner(); auto amsEventHandler = GetAmsEventHandler(); @@ -183,7 +183,7 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_003, TestSize.Level1) amsMgrScheduler->UpdateAbilityState(token, abilityState); mockAppMgrServiceInner->Wait(); - APP_LOGD("AmsMgrScheduler_003 end."); + HILOG_DEBUG("AmsMgrScheduler_003 end."); } /* @@ -196,7 +196,7 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_003, TestSize.Level1) */ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_004, TestSize.Level1) { - APP_LOGD("AmsMgrScheduler_004 start."); + HILOG_DEBUG("AmsMgrScheduler_004 start."); auto mockAppMgrServiceInner = GetMockAppMgrServiceInner(); auto amsEventHandler = GetAmsEventHandler(); @@ -209,7 +209,7 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_004, TestSize.Level1) amsMgrScheduler->TerminateAbility(token); mockAppMgrServiceInner->Wait(); - APP_LOGD("AmsMgrScheduler_004 end."); + HILOG_DEBUG("AmsMgrScheduler_004 end."); } /* @@ -222,7 +222,7 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_004, TestSize.Level1) */ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_005, TestSize.Level1) { - APP_LOGD("AmsMgrScheduler_005 start."); + HILOG_DEBUG("AmsMgrScheduler_005 start."); auto mockAppMgrServiceInner = GetMockAppMgrServiceInner(); auto amsEventHandler = GetAmsEventHandler(); @@ -235,7 +235,7 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_005, TestSize.Level1) amsMgrScheduler->RegisterAppStateCallback(appStateCallbackHost); mockAppMgrServiceInner->Wait(); - APP_LOGD("AmsMgrScheduler_005 end."); + HILOG_DEBUG("AmsMgrScheduler_005 end."); } /* @@ -248,7 +248,7 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_005, TestSize.Level1) */ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_007, TestSize.Level1) { - APP_LOGD("AmsMgrScheduler_007 start."); + HILOG_DEBUG("AmsMgrScheduler_007 start."); auto mockAppMgrServiceInner = GetMockAppMgrServiceInner(); auto amsEventHandler = GetAmsEventHandler(); @@ -267,7 +267,7 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_007, TestSize.Level1) std::make_unique(mockAppMgrServiceInner, nullptr); EXPECT_EQ(false, amsMgrScheduler3->IsReady()); - APP_LOGD("AmsMgrScheduler_007 end."); + HILOG_DEBUG("AmsMgrScheduler_007 end."); } /* @@ -280,7 +280,7 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_007, TestSize.Level1) */ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_008, TestSize.Level1) { - APP_LOGD("AmsMgrScheduler_008 start."); + HILOG_DEBUG("AmsMgrScheduler_008 start."); auto mockAppMgrServiceInner = GetMockAppMgrServiceInner(); auto amsEventHandler = GetAmsEventHandler(); @@ -307,7 +307,7 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_008, TestSize.Level1) EXPECT_EQ(ERR_OK, amsMgrScheduler4->KillApplication(GetTestAppName())); - APP_LOGD("AmsMgrScheduler_008 end."); + HILOG_DEBUG("AmsMgrScheduler_008 end."); } /* @@ -320,7 +320,7 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_008, TestSize.Level1) */ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_009, TestSize.Level1) { - APP_LOGD("AmsMgrScheduler_009 start."); + HILOG_DEBUG("AmsMgrScheduler_009 start."); auto mockAppMgrServiceInner = GetMockAppMgrServiceInner(); auto amsEventHandler = GetAmsEventHandler(); @@ -345,7 +345,7 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_009, TestSize.Level1) mockAppMgrServiceInner.reset(); amsEventHandler.reset(); - APP_LOGD("AmsMgrScheduler_009 end."); + HILOG_DEBUG("AmsMgrScheduler_009 end."); } /* @@ -358,7 +358,7 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_009, TestSize.Level1) */ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_010, TestSize.Level1) { - APP_LOGD("AmsMgrScheduler_010 start."); + HILOG_DEBUG("AmsMgrScheduler_010 start."); auto mockAppMgrServiceInner = GetMockAppMgrServiceInner(); @@ -375,7 +375,7 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_010, TestSize.Level1) amsMgrScheduler->AbilityBehaviorAnalysis(token, preToken, visibility, perceptibility, connectionState); - APP_LOGD("AmsMgrScheduler_010 end."); + HILOG_DEBUG("AmsMgrScheduler_010 end."); } /* @@ -387,14 +387,14 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_010, TestSize.Level1) */ HWTEST_F(AmsMgrSchedulerTest, RegisterApplicationStateObserver_001, TestSize.Level0) { - APP_LOGD("RegisterApplicationStateObserver_001 start"); + HILOG_DEBUG("RegisterApplicationStateObserver_001 start"); sptr observer = new ApplicationStateObserverStub(); auto mockAppMgrServiceInner = std::make_shared(); mockAppMgrServiceInner->RegisterApplicationStateObserver(observer); int32_t err = mockAppMgrServiceInner->RegisterApplicationStateObserver(observer); // repeat register return ERR_INVALID_VALUE EXPECT_EQ(ERR_INVALID_VALUE, err); - APP_LOGD("RegisterApplicationStateObserver_001 end"); + HILOG_DEBUG("RegisterApplicationStateObserver_001 end"); } /* @@ -406,7 +406,7 @@ HWTEST_F(AmsMgrSchedulerTest, RegisterApplicationStateObserver_001, TestSize.Lev */ HWTEST_F(AmsMgrSchedulerTest, UnregisterApplicationStateObserver_001, TestSize.Level0) { - APP_LOGD("UnregisterApplicationStateObserver_001 start"); + HILOG_DEBUG("UnregisterApplicationStateObserver_001 start"); sptr observer = new ApplicationStateObserverStub(); auto mockAppMgrServiceInner = std::make_shared(); int32_t err1 = mockAppMgrServiceInner->UnregisterApplicationStateObserver(observer); @@ -415,7 +415,7 @@ HWTEST_F(AmsMgrSchedulerTest, UnregisterApplicationStateObserver_001, TestSize.L int32_t err2 = mockAppMgrServiceInner->UnregisterApplicationStateObserver(nullptr); // unregister null return ERR_INVALID_VALUE EXPECT_EQ(ERR_INVALID_VALUE, err2); - APP_LOGD("UnregisterApplicationStateObserver_001 end"); + HILOG_DEBUG("UnregisterApplicationStateObserver_001 end"); } } // namespace AppExecFwk } // namespace OHOS diff --git a/services/appmgr/test/unittest/ams_service_app_spawn_client_test/ams_service_app_spawn_client_test.cpp b/services/appmgr/test/unittest/ams_service_app_spawn_client_test/ams_service_app_spawn_client_test.cpp index ba1743cb58..764868692a 100644 --- a/services/appmgr/test/unittest/ams_service_app_spawn_client_test/ams_service_app_spawn_client_test.cpp +++ b/services/appmgr/test/unittest/ams_service_app_spawn_client_test/ams_service_app_spawn_client_test.cpp @@ -20,7 +20,7 @@ #undef protected #include #include "securec.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "mock_app_spawn_socket.h" using namespace testing::ext; @@ -115,7 +115,7 @@ void AmsServiceAppSpawnClientTest::TearDown() */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_001, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_001 start"); + HILOG_INFO("ams_service_app_spawn_client_001 start"); std::shared_ptr appMgrService = std::make_shared(); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appMgrService->QueryServiceState().connectionState); std::shared_ptr innerService = std::make_shared(); @@ -126,7 +126,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_001, TestSize.Level1) EXPECT_CALL(*(innerService->GetSocket()), CloseAppSpawnConnection()).Times(1); appMgrService->OnStop(); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appMgrService->QueryServiceState().connectionState); - APP_LOGI("ams_service_app_spawn_client_001 end"); + HILOG_INFO("ams_service_app_spawn_client_001 end"); } /* @@ -139,7 +139,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_001, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_002, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_002 start"); + HILOG_INFO("ams_service_app_spawn_client_002 start"); std::shared_ptr appMgrService = std::make_shared(); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appMgrService->QueryServiceState().connectionState); std::shared_ptr innerService = std::make_shared(); @@ -150,7 +150,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_002, TestSize.Level1) EXPECT_EQ(SpawnConnectionState::STATE_CONNECT_FAILED, appMgrService->QueryServiceState().connectionState); appMgrService->OnStop(); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appMgrService->QueryServiceState().connectionState); - APP_LOGI("ams_service_app_spawn_client_002 end"); + HILOG_INFO("ams_service_app_spawn_client_002 end"); } /* @@ -163,7 +163,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_002, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_003, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_003 start"); + HILOG_INFO("ams_service_app_spawn_client_003 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -171,7 +171,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_003, TestSize.Level1) EXPECT_CALL(*socketMock, OpenAppSpawnConnection()).WillOnce(Return(ERR_OK)); EXPECT_EQ(ERR_OK, appSpawnClient->OpenConnection()); EXPECT_EQ(SpawnConnectionState::STATE_CONNECTED, appSpawnClient->QueryConnectionState()); - APP_LOGI("ams_service_app_spawn_client_003 end"); + HILOG_INFO("ams_service_app_spawn_client_003 end"); } /* @@ -184,7 +184,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_003, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_004, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_004 start"); + HILOG_INFO("ams_service_app_spawn_client_004 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -192,7 +192,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_004, TestSize.Level1) EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appSpawnClient->QueryConnectionState()); EXPECT_EQ(ERR_APPEXECFWK_CONNECT_APPSPAWN_FAILED, appSpawnClient->OpenConnection()); EXPECT_EQ(SpawnConnectionState::STATE_CONNECT_FAILED, appSpawnClient->QueryConnectionState()); - APP_LOGI("ams_service_app_spawn_client_004 end"); + HILOG_INFO("ams_service_app_spawn_client_004 end"); } /* @@ -205,7 +205,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_004, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_005, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_005 start"); + HILOG_INFO("ams_service_app_spawn_client_005 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -220,7 +220,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_005, TestSize.Level1) socketMock->SetExpectPid(expectPid); appSpawnClient->StartProcess(params, newPid); EXPECT_EQ(expectPid, newPid); - APP_LOGI("ams_service_app_spawn_client_005 end"); + HILOG_INFO("ams_service_app_spawn_client_005 end"); } /* @@ -234,7 +234,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_005, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_006, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_006 start"); + HILOG_INFO("ams_service_app_spawn_client_006 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -250,7 +250,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_006, TestSize.Level1) socketMock->SetExpectPid(expectPid); appSpawnClient->StartProcess(params, newPid); EXPECT_EQ(expectPid, newPid); - APP_LOGI("ams_service_app_spawn_client_006 end"); + HILOG_INFO("ams_service_app_spawn_client_006 end"); } /* @@ -264,7 +264,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_006, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_007, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_007 start"); + HILOG_INFO("ams_service_app_spawn_client_007 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -274,7 +274,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_007, TestSize.Level1) pid_t newPid = 0; ErrCode result = appSpawnClient->StartProcess(params, newPid); EXPECT_EQ(ERR_APPEXECFWK_CONNECT_APPSPAWN_FAILED, result); - APP_LOGI("ams_service_app_spawn_client_007 end"); + HILOG_INFO("ams_service_app_spawn_client_007 end"); } /* @@ -287,7 +287,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_007, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_008, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_008 start"); + HILOG_INFO("ams_service_app_spawn_client_008 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -301,7 +301,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_008, TestSize.Level1) socketMock->SetExpectPid(expectPid); appSpawnClient->StartProcess(params, newPid); EXPECT_EQ(expectPid, newPid); - APP_LOGI("ams_service_app_spawn_client_008 end"); + HILOG_INFO("ams_service_app_spawn_client_008 end"); } /* @@ -314,7 +314,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_008, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_009, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_009 start"); + HILOG_INFO("ams_service_app_spawn_client_009 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -323,7 +323,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_009, TestSize.Level1) pid_t newPid = 0; ErrCode result = appSpawnClient->StartProcess(params, newPid); EXPECT_EQ(ERR_APPEXECFWK_CONNECT_APPSPAWN_FAILED, result); - APP_LOGI("ams_service_app_spawn_client_009 end"); + HILOG_INFO("ams_service_app_spawn_client_009 end"); } /* @@ -336,7 +336,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_009, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_010, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_010 start"); + HILOG_INFO("ams_service_app_spawn_client_010 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -348,7 +348,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_010, TestSize.Level1) pid_t newPid = 0; ErrCode result = appSpawnClient->StartProcess(params, newPid); EXPECT_EQ(ERR_APPEXECFWK_SOCKET_WRITE_FAILED, result); - APP_LOGI("ams_service_app_spawn_client_010 end"); + HILOG_INFO("ams_service_app_spawn_client_010 end"); } /* @@ -361,7 +361,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_010, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_011, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_011 start"); + HILOG_INFO("ams_service_app_spawn_client_011 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -374,7 +374,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_011, TestSize.Level1) pid_t newPid = 0; ErrCode result = appSpawnClient->StartProcess(params, newPid); EXPECT_EQ(ERR_APPEXECFWK_SOCKET_READ_FAILED, result); - APP_LOGI("ams_service_app_spawn_client_011 end"); + HILOG_INFO("ams_service_app_spawn_client_011 end"); } /* @@ -387,7 +387,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_011, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_012, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_012 start"); + HILOG_INFO("ams_service_app_spawn_client_012 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -398,7 +398,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_012, TestSize.Level1) pid_t newPid = 0; ErrCode result = appSpawnClient->StartProcess(params, newPid); EXPECT_EQ(ERR_APPEXECFWK_ASSEMBLE_START_MSG_FAILED, result); - APP_LOGI("ams_service_app_spawn_client_012 end"); + HILOG_INFO("ams_service_app_spawn_client_012 end"); } /* @@ -411,7 +411,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_012, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_013, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_013 start"); + HILOG_INFO("ams_service_app_spawn_client_013 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); @@ -428,7 +428,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_013, TestSize.Level1) pid_t newPid = 0; ErrCode result = appSpawnClient->StartProcess(params, newPid); EXPECT_EQ(ERR_APPEXECFWK_ASSEMBLE_START_MSG_FAILED, result); - APP_LOGI("ams_service_app_spawn_client_013 end"); + HILOG_INFO("ams_service_app_spawn_client_013 end"); } /* @@ -441,7 +441,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_013, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_014, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_014 start"); + HILOG_INFO("ams_service_app_spawn_client_014 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -456,7 +456,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_014, TestSize.Level1) pid_t newPid = 0; ErrCode result = appSpawnClient->StartProcess(params, newPid); EXPECT_EQ(ERR_APPEXECFWK_ASSEMBLE_START_MSG_FAILED, result); - APP_LOGI("ams_service_app_spawn_client_014 end"); + HILOG_INFO("ams_service_app_spawn_client_014 end"); } /* @@ -469,7 +469,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_014, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_015, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_015 start"); + HILOG_INFO("ams_service_app_spawn_client_015 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -484,7 +484,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_015, TestSize.Level1) pid_t newPid = 0; ErrCode result = appSpawnClient->StartProcess(params, newPid); EXPECT_EQ(ERR_APPEXECFWK_ASSEMBLE_START_MSG_FAILED, result); - APP_LOGI("ams_service_app_spawn_client_015 end"); + HILOG_INFO("ams_service_app_spawn_client_015 end"); } /* @@ -497,7 +497,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_015, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_016, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_016 start"); + HILOG_INFO("ams_service_app_spawn_client_016 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -506,7 +506,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_016, TestSize.Level1) EXPECT_EQ(ERR_OK, appSpawnClient->OpenConnection()); appSpawnClient->CloseConnection(); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appSpawnClient->QueryConnectionState()); - APP_LOGI("ams_service_app_spawn_client_016 end"); + HILOG_INFO("ams_service_app_spawn_client_016 end"); } /* @@ -519,14 +519,14 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_016, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_017, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_017 start"); + HILOG_INFO("ams_service_app_spawn_client_017 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appSpawnClient->QueryConnectionState()); appSpawnClient->CloseConnection(); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appSpawnClient->QueryConnectionState()); - APP_LOGI("ams_service_app_spawn_client_017 end"); + HILOG_INFO("ams_service_app_spawn_client_017 end"); } /* @@ -539,7 +539,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_017, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_018, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_018 start"); + HILOG_INFO("ams_service_app_spawn_client_018 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -547,7 +547,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_018, TestSize.Level1) EXPECT_EQ(ERR_APPEXECFWK_CONNECT_APPSPAWN_FAILED, appSpawnClient->OpenConnection()); appSpawnClient->CloseConnection(); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appSpawnClient->QueryConnectionState()); - APP_LOGI("ams_service_app_spawn_client_018 end"); + HILOG_INFO("ams_service_app_spawn_client_018 end"); } /* @@ -561,7 +561,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_018, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_019, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_client_019 start"); + HILOG_INFO("ams_service_app_spawn_client_019 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -580,7 +580,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_019, TestSize.Level1) ErrCode result = appSpawnClient->StartProcess(params, newPid); EXPECT_EQ(expectPid, newPid); EXPECT_EQ(ERR_OK, result); - APP_LOGI("ams_service_app_spawn_client_019 end"); + HILOG_INFO("ams_service_app_spawn_client_019 end"); } /* @@ -593,7 +593,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, AppSpawnClient_019, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, ReConnectAppSpawn_001, TestSize.Level1) { - APP_LOGI("ams_service_reconnect_app_spawn_001 start"); + HILOG_INFO("ams_service_reconnect_app_spawn_001 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -603,7 +603,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, ReConnectAppSpawn_001, TestSize.Level1) .WillOnce(Return(ERR_OK)); EXPECT_EQ(ERR_OK, appSpawnClient->OpenConnection()); EXPECT_EQ(SpawnConnectionState::STATE_CONNECTED, appSpawnClient->QueryConnectionState()); - APP_LOGI("ams_service_reconnect_app_spawn_001 end"); + HILOG_INFO("ams_service_reconnect_app_spawn_001 end"); } /* @@ -616,7 +616,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, ReConnectAppSpawn_001, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, ReConnectAppSpawn_002, TestSize.Level1) { - APP_LOGI("ams_service_reconnect_app_spawn_002 start"); + HILOG_INFO("ams_service_reconnect_app_spawn_002 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -630,7 +630,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, ReConnectAppSpawn_002, TestSize.Level1) EXPECT_EQ(ERR_OK, appSpawnClient->OpenConnection()); EXPECT_EQ(SpawnConnectionState::STATE_CONNECTED, appSpawnClient->QueryConnectionState()); - APP_LOGI("ams_service_reconnect_app_spawn_002 end"); + HILOG_INFO("ams_service_reconnect_app_spawn_002 end"); } /* @@ -643,7 +643,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, ReConnectAppSpawn_002, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, ReConnectAppSpawn_003, TestSize.Level1) { - APP_LOGI("ams_service_reconnect_app_spawn_003 start"); + HILOG_INFO("ams_service_reconnect_app_spawn_003 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -654,7 +654,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, ReConnectAppSpawn_003, TestSize.Level1) EXPECT_EQ(ERR_APPEXECFWK_CONNECT_APPSPAWN_FAILED, appSpawnClient->OpenConnection()); EXPECT_EQ(SpawnConnectionState::STATE_CONNECT_FAILED, appSpawnClient->QueryConnectionState()); - APP_LOGI("ams_service_reconnect_app_spawn_003 end"); + HILOG_INFO("ams_service_reconnect_app_spawn_003 end"); } /* @@ -667,7 +667,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, ReConnectAppSpawn_003, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, ReConnectAppSpawn_004, TestSize.Level1) { - APP_LOGI("ams_service_reconnect_app_spawn_004 start"); + HILOG_INFO("ams_service_reconnect_app_spawn_004 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -684,7 +684,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, ReConnectAppSpawn_004, TestSize.Level1) ErrCode result = appSpawnClient->StartProcess(params, newPid); EXPECT_EQ(expectPid, newPid); EXPECT_EQ(ERR_OK, result); - APP_LOGI("ams_service_reconnect_app_spawn_004 end"); + HILOG_INFO("ams_service_reconnect_app_spawn_004 end"); } /* @@ -697,7 +697,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, ReConnectAppSpawn_004, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, ReConnectAppSpawn_005, TestSize.Level1) { - APP_LOGI("ams_service_reconnect_app_spawn_005 start"); + HILOG_INFO("ams_service_reconnect_app_spawn_005 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -719,7 +719,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, ReConnectAppSpawn_005, TestSize.Level1) ErrCode result = appSpawnClient->StartProcess(params, newPid); EXPECT_EQ(expectPid, newPid); EXPECT_EQ(ERR_OK, result); - APP_LOGI("ams_service_reconnect_app_spawn_005 end"); + HILOG_INFO("ams_service_reconnect_app_spawn_005 end"); } /* @@ -732,7 +732,7 @@ HWTEST_F(AmsServiceAppSpawnClientTest, ReConnectAppSpawn_005, TestSize.Level1) */ HWTEST_F(AmsServiceAppSpawnClientTest, ReConnectAppSpawn_006, TestSize.Level1) { - APP_LOGI("ams_service_reconnect_app_spawn_006 start"); + HILOG_INFO("ams_service_reconnect_app_spawn_006 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr socketMock = std::make_shared(); appSpawnClient->SetSocket(socketMock); @@ -744,5 +744,5 @@ HWTEST_F(AmsServiceAppSpawnClientTest, ReConnectAppSpawn_006, TestSize.Level1) pid_t newPid = 0; ErrCode result = appSpawnClient->StartProcess(params, newPid); EXPECT_EQ(ERR_APPEXECFWK_SOCKET_READ_FAILED, result); - APP_LOGI("ams_service_reconnect_app_spawn_006 end"); + HILOG_INFO("ams_service_reconnect_app_spawn_006 end"); } diff --git a/services/appmgr/test/unittest/ams_service_app_spawn_msg_wrapper_test/ams_service_app_spawn_msg_wrapper_test.cpp b/services/appmgr/test/unittest/ams_service_app_spawn_msg_wrapper_test/ams_service_app_spawn_msg_wrapper_test.cpp index b331180f84..1d4b6b175d 100644 --- a/services/appmgr/test/unittest/ams_service_app_spawn_msg_wrapper_test/ams_service_app_spawn_msg_wrapper_test.cpp +++ b/services/appmgr/test/unittest/ams_service_app_spawn_msg_wrapper_test/ams_service_app_spawn_msg_wrapper_test.cpp @@ -15,8 +15,8 @@ #include -#include "app_log_wrapper.h" #include "app_spawn_msg_wrapper.h" +#include "hilog_wrapper.h" #include "securec.h" using namespace testing::ext; @@ -59,14 +59,14 @@ void AmsServiceAppSpawnMsgWrapperTest::TearDown() */ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_001, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_msg_wrapper_001 start"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_001 start"); std::unique_ptr appSpawnMsgWrapper = std::make_unique(); AppSpawnStartMsg params = {10000, 10000, {10001, 10002}, "processName", "soPath"}; EXPECT_EQ(true, appSpawnMsgWrapper->AssembleMsg(params)); - APP_LOGI("ams_service_app_spawn_msg_wrapper_001 end"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_001 end"); } /* @@ -79,14 +79,14 @@ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_001, TestSize.Level1 */ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_002, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_msg_wrapper_002 start"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_002 start"); std::unique_ptr appSpawnMsgWrapper = std::make_unique(); AppSpawnStartMsg params = {10000, 10000, {10001, 10002}, "processName", "soPath"}; EXPECT_EQ(true, appSpawnMsgWrapper->AssembleMsg(params)); - APP_LOGI("ams_service_app_spawn_msg_wrapper_002 end"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_002 end"); } /* @@ -99,7 +99,7 @@ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_002, TestSize.Level1 */ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_003, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_msg_wrapper_003 start"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_003 start"); std::unique_ptr appSpawnMsgWrapper = std::make_unique(); // gids limit, max 64 @@ -190,7 +190,7 @@ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_003, TestSize.Level1 "soPath"}; EXPECT_EQ(false, appSpawnMsgWrapper->AssembleMsg(params)); - APP_LOGI("ams_service_app_spawn_msg_wrapper_003 end"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_003 end"); } /* @@ -203,13 +203,13 @@ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_003, TestSize.Level1 */ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_004, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_msg_wrapper_004 start"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_004 start"); std::unique_ptr appSpawnMsgWrapper = std::make_unique(); AppSpawnStartMsg params = {10000, 10000, {10001, 10001}, "", "soPath"}; EXPECT_EQ(false, appSpawnMsgWrapper->AssembleMsg(params)); - APP_LOGI("ams_service_app_spawn_msg_wrapper_004 end"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_004 end"); } /* @@ -222,7 +222,7 @@ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_004, TestSize.Level1 */ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_005, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_msg_wrapper_005 start"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_005 start"); std::unique_ptr appSpawnMsgWrapper = std::make_unique(); std::string invalid = @@ -234,7 +234,7 @@ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_005, TestSize.Level1 AppSpawnStartMsg params = {10000, 10000, {10001, 10001}, invalid, "soPath"}; EXPECT_EQ(false, appSpawnMsgWrapper->AssembleMsg(params)); - APP_LOGI("ams_service_app_spawn_msg_wrapper_005 end"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_005 end"); } /* @@ -248,13 +248,13 @@ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_005, TestSize.Level1 HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_006, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_msg_wrapper_006 start"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_006 start"); std::unique_ptr appSpawnMsgWrapper = std::make_unique(); AppSpawnStartMsg params = {10000, 10000, {10001, 10001}, "", ""}; EXPECT_EQ(false, appSpawnMsgWrapper->AssembleMsg(params)); - APP_LOGI("ams_service_app_spawn_msg_wrapper_006 end"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_006 end"); } /* @@ -267,7 +267,7 @@ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_006, TestSize.Level1 */ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_007, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_msg_wrapper_007 start"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_007 start"); std::unique_ptr appSpawnMsgWrapper = std::make_unique(); std::string invalid = @@ -279,7 +279,7 @@ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_007, TestSize.Level1 AppSpawnStartMsg params = {10000, 10000, {10001, 10001}, "processName", invalid}; EXPECT_EQ(false, appSpawnMsgWrapper->AssembleMsg(params)); - APP_LOGI("ams_service_app_spawn_msg_wrapper_007 end"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_007 end"); } /* @@ -292,13 +292,13 @@ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_007, TestSize.Level1 */ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_008, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_msg_wrapper_008 start"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_008 start"); std::unique_ptr appSpawnMsgWrapper = std::make_unique(); AppSpawnStartMsg params = {10000, 10000, {10001, 10001}, "processName", "soPath"}; EXPECT_EQ(true, appSpawnMsgWrapper->AssembleMsg(params)); - APP_LOGI("ams_service_app_spawn_msg_wrapper_008 end"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_008 end"); } /* @@ -311,7 +311,7 @@ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_008, TestSize.Level1 */ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_009, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_msg_wrapper_009 start"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_009 start"); std::unique_ptr appSpawnMsgWrapper = std::make_unique(); AppSpawnStartMsg params = {10000, 10000, {10001, 10001}, "processName", "soPath"}; @@ -320,7 +320,7 @@ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_009, TestSize.Level1 int32_t lhs = sizeof(AppSpawnMsg); EXPECT_EQ(lhs, appSpawnMsgWrapper->GetMsgLength()); - APP_LOGI("ams_service_app_spawn_msg_wrapper_009 end"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_009 end"); } /* @@ -333,7 +333,7 @@ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_009, TestSize.Level1 */ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_010, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_msg_wrapper_010 start"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_010 start"); std::unique_ptr appSpawnMsgWrapper = std::make_unique(); AppSpawnStartMsg params = {10000, 10000, {10001, 10001}, "", "soPath"}; @@ -342,7 +342,7 @@ HWTEST(AmsServiceAppSpawnMsgWrapperTest, AppSpawnMsgWrapper_010, TestSize.Level1 int32_t lhs = 0; EXPECT_EQ(lhs, appSpawnMsgWrapper->GetMsgLength()); - APP_LOGI("ams_service_app_spawn_msg_wrapper_010 end"); + HILOG_INFO("ams_service_app_spawn_msg_wrapper_010 end"); } } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file diff --git a/services/appmgr/test/unittest/ams_service_app_spawn_socket_test/ams_service_app_spawn_socket_test.cpp b/services/appmgr/test/unittest/ams_service_app_spawn_socket_test/ams_service_app_spawn_socket_test.cpp index 4b7f75bc09..ad0a9132cb 100644 --- a/services/appmgr/test/unittest/ams_service_app_spawn_socket_test/ams_service_app_spawn_socket_test.cpp +++ b/services/appmgr/test/unittest/ams_service_app_spawn_socket_test/ams_service_app_spawn_socket_test.cpp @@ -15,8 +15,8 @@ #include -#include "app_log_wrapper.h" #include "app_spawn_socket.h" +#include "hilog_wrapper.h" #include "mock_client_socket.h" #include "securec.h" @@ -66,7 +66,7 @@ void AmsServiceAppSpawnSocketTest::TearDown() */ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_001, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_socket_001 start"); + HILOG_INFO("ams_service_app_spawn_socket_001 start"); std::shared_ptr mockClientSocket = std::make_shared(); @@ -76,7 +76,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_001, TestSize.Level1) EXPECT_CALL(*mockClientSocket, CreateClient()).WillOnce(Return(-1)); EXPECT_EQ(ERR_APPEXECFWK_BAD_APPSPAWN_CLIENT, appSpawnSocket->OpenAppSpawnConnection()); - APP_LOGI("ams_service_app_spawn_socket_001 end"); + HILOG_INFO("ams_service_app_spawn_socket_001 end"); } /* @@ -89,7 +89,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_001, TestSize.Level1) */ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_002, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_socket_002 start"); + HILOG_INFO("ams_service_app_spawn_socket_002 start"); std::shared_ptr mockClientSocket = std::make_shared(); @@ -100,7 +100,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_002, TestSize.Level1) EXPECT_CALL(*mockClientSocket, ConnectSocket()).WillOnce(Return(-1)); EXPECT_EQ(ERR_APPEXECFWK_CONNECT_APPSPAWN_FAILED, appSpawnSocket->OpenAppSpawnConnection()); - APP_LOGI("ams_service_app_spawn_socket_002 end"); + HILOG_INFO("ams_service_app_spawn_socket_002 end"); } /* @@ -113,7 +113,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_002, TestSize.Level1) */ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_003, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_socket_003 start"); + HILOG_INFO("ams_service_app_spawn_socket_003 start"); std::shared_ptr mockClientSocket = std::make_shared(); @@ -124,7 +124,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_003, TestSize.Level1) EXPECT_CALL(*mockClientSocket, ConnectSocket()).WillOnce(Return(ERR_OK)); EXPECT_EQ(ERR_OK, appSpawnSocket->OpenAppSpawnConnection()); - APP_LOGI("ams_service_app_spawn_socket_003 end"); + HILOG_INFO("ams_service_app_spawn_socket_003 end"); } /* @@ -137,7 +137,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_003, TestSize.Level1) */ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_004, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_socket_004 start"); + HILOG_INFO("ams_service_app_spawn_socket_004 start"); std::shared_ptr mockClientSocket = std::make_shared(); @@ -148,7 +148,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_004, TestSize.Level1) appSpawnSocket->SetClientSocket(mockClientSocket); EXPECT_EQ(ERR_INVALID_VALUE, appSpawnSocket->ReadMessage(buff.get(), len)); - APP_LOGI("ams_service_app_spawn_socket_004 end"); + HILOG_INFO("ams_service_app_spawn_socket_004 end"); } /* @@ -161,7 +161,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_004, TestSize.Level1) */ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_005, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_socket_005 start"); + HILOG_INFO("ams_service_app_spawn_socket_005 start"); std::shared_ptr mockClientSocket = std::make_shared(); @@ -172,7 +172,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_005, TestSize.Level1) appSpawnSocket->SetClientSocket(mockClientSocket); EXPECT_EQ(ERR_INVALID_VALUE, appSpawnSocket->ReadMessage(buff.get(), len)); - APP_LOGI("ams_service_app_spawn_socket_005 end"); + HILOG_INFO("ams_service_app_spawn_socket_005 end"); } /* @@ -185,7 +185,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_005, TestSize.Level1) */ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_006, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_socket_006 start"); + HILOG_INFO("ams_service_app_spawn_socket_006 start"); std::shared_ptr mockClientSocket = std::make_shared(); @@ -196,7 +196,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_006, TestSize.Level1) appSpawnSocket->SetClientSocket(mockClientSocket); EXPECT_EQ(ERR_INVALID_VALUE, appSpawnSocket->ReadMessage(buff.get(), len)); - APP_LOGI("ams_service_app_spawn_socket_006 end"); + HILOG_INFO("ams_service_app_spawn_socket_006 end"); } /* @@ -209,7 +209,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_006, TestSize.Level1) */ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_007, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_socket_007 start"); + HILOG_INFO("ams_service_app_spawn_socket_007 start"); std::shared_ptr mockClientSocket = std::make_shared(); @@ -221,7 +221,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_007, TestSize.Level1) EXPECT_CALL(*mockClientSocket, ReadSocketMessage(_, _)).WillOnce(Return(len)); EXPECT_EQ(ERR_OK, appSpawnSocket->ReadMessage(buff.get(), len)); - APP_LOGI("ams_service_app_spawn_socket_007 end"); + HILOG_INFO("ams_service_app_spawn_socket_007 end"); } /* @@ -234,7 +234,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_007, TestSize.Level1) */ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_008, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_socket_008 start"); + HILOG_INFO("ams_service_app_spawn_socket_008 start"); std::shared_ptr mockClientSocket = std::make_shared(); @@ -246,7 +246,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_008, TestSize.Level1) EXPECT_CALL(*mockClientSocket, ReadSocketMessage(_, _)).WillOnce(Return(11)); EXPECT_EQ(ERR_APPEXECFWK_SOCKET_READ_FAILED, appSpawnSocket->ReadMessage(buff.get(), len)); - APP_LOGI("ams_service_app_spawn_socket_008 end"); + HILOG_INFO("ams_service_app_spawn_socket_008 end"); } /* @@ -259,7 +259,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_008, TestSize.Level1) */ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_009, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_socket_009 start"); + HILOG_INFO("ams_service_app_spawn_socket_009 start"); std::shared_ptr mockClientSocket = std::make_shared(); std::unique_ptr appSpawnSocket = std::make_unique(); @@ -269,7 +269,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_009, TestSize.Level1) appSpawnSocket->SetClientSocket(mockClientSocket); EXPECT_EQ(ERR_INVALID_VALUE, appSpawnSocket->WriteMessage(buff.get(), len)); - APP_LOGI("ams_service_app_spawn_socket_009 end"); + HILOG_INFO("ams_service_app_spawn_socket_009 end"); } /* @@ -282,7 +282,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_009, TestSize.Level1) */ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_010, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_socket_010 start"); + HILOG_INFO("ams_service_app_spawn_socket_010 start"); std::shared_ptr mockClientSocket = std::make_shared(); @@ -293,7 +293,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_010, TestSize.Level1) appSpawnSocket->SetClientSocket(mockClientSocket); EXPECT_EQ(ERR_INVALID_VALUE, appSpawnSocket->WriteMessage(buff.get(), len)); - APP_LOGI("ams_service_app_spawn_socket_010 end"); + HILOG_INFO("ams_service_app_spawn_socket_010 end"); } /* @@ -306,7 +306,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_010, TestSize.Level1) */ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_011, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_socket_011 start"); + HILOG_INFO("ams_service_app_spawn_socket_011 start"); std::shared_ptr mockClientSocket = std::make_shared(); @@ -317,7 +317,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_011, TestSize.Level1) appSpawnSocket->SetClientSocket(mockClientSocket); EXPECT_EQ(ERR_INVALID_VALUE, appSpawnSocket->WriteMessage(buff.get(), len)); - APP_LOGI("ams_service_app_spawn_socket_011 end"); + HILOG_INFO("ams_service_app_spawn_socket_011 end"); } /* @@ -330,7 +330,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_011, TestSize.Level1) */ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_012, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_socket_012 start"); + HILOG_INFO("ams_service_app_spawn_socket_012 start"); std::shared_ptr mockClientSocket = std::make_shared(); @@ -342,7 +342,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_012, TestSize.Level1) EXPECT_CALL(*mockClientSocket, WriteSocketMessage(_, _)).WillOnce(Return(len)); EXPECT_EQ(ERR_OK, appSpawnSocket->WriteMessage(buff.get(), len)); - APP_LOGI("ams_service_app_spawn_socket_012 end"); + HILOG_INFO("ams_service_app_spawn_socket_012 end"); } /* @@ -355,7 +355,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_012, TestSize.Level1) */ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_013, TestSize.Level1) { - APP_LOGI("ams_service_app_spawn_socket_013 start"); + HILOG_INFO("ams_service_app_spawn_socket_013 start"); std::shared_ptr mockClientSocket = std::make_shared(); @@ -367,7 +367,7 @@ HWTEST(AmsServiceAppSpawnSocketTest, AppSpawnSocket_013, TestSize.Level1) EXPECT_CALL(*mockClientSocket, WriteSocketMessage(_, _)).WillOnce(Return(11)); EXPECT_EQ(ERR_APPEXECFWK_SOCKET_WRITE_FAILED, appSpawnSocket->WriteMessage(buff.get(), len)); - APP_LOGI("ams_service_app_spawn_socket_013 end"); + HILOG_INFO("ams_service_app_spawn_socket_013 end"); } } // namespace AppExecFwk } // namespace OHOS diff --git a/services/appmgr/test/unittest/ams_service_event_drive_test/ams_service_event_drive_test.cpp b/services/appmgr/test/unittest/ams_service_event_drive_test/ams_service_event_drive_test.cpp index 576239b327..dc576bec39 100644 --- a/services/appmgr/test/unittest/ams_service_event_drive_test/ams_service_event_drive_test.cpp +++ b/services/appmgr/test/unittest/ams_service_event_drive_test/ams_service_event_drive_test.cpp @@ -20,8 +20,8 @@ #undef private #undef protected #include -#include "app_log_wrapper.h" #include "errors.h" +#include "hilog_wrapper.h" #include "iremote_object.h" #include "mock_app_mgr_service_inner.h" #include"system_environment_information.h" @@ -76,7 +76,7 @@ void AmsServiceEventDriveTest::TearDown() */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_001, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_001 start"); + HILOG_INFO("ams_service_event_drive_test_001 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); @@ -92,7 +92,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_001, TestSize.Level1) appMgrService_->AttachApplication(client); innerService->Wait(); - APP_LOGI("ams_service_event_drive_test_001 end"); + HILOG_INFO("ams_service_event_drive_test_001 end"); } /* @@ -105,7 +105,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_001, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_002, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_002 start"); + HILOG_INFO("ams_service_event_drive_test_002 start"); std::shared_ptr innerService = std::make_shared(); std::unique_ptr appMgrService = std::make_unique(); @@ -119,7 +119,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_002, TestSize.Level1) appMgrService->ApplicationForegrounded(recordId); innerService->Wait(); - APP_LOGI("ams_service_event_drive_test_002 end"); + HILOG_INFO("ams_service_event_drive_test_002 end"); } /* @@ -132,7 +132,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_002, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_003, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_003 start"); + HILOG_INFO("ams_service_event_drive_test_003 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); @@ -145,7 +145,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_003, TestSize.Level1) appMgrService_->ApplicationBackgrounded(recordId); innerService->Wait(); - APP_LOGI("ams_service_event_drive_test_003 end"); + HILOG_INFO("ams_service_event_drive_test_003 end"); } /* @@ -158,7 +158,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_003, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_004, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_004 start"); + HILOG_INFO("ams_service_event_drive_test_004 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); @@ -171,7 +171,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_004, TestSize.Level1) appMgrService_->ApplicationTerminated(recordId); innerService->Wait(); - APP_LOGI("ams_service_event_drive_test_004 end"); + HILOG_INFO("ams_service_event_drive_test_004 end"); } /* @@ -184,7 +184,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_004, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_005, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_005 start"); + HILOG_INFO("ams_service_event_drive_test_005 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); @@ -197,7 +197,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_005, TestSize.Level1) appMgrService_->AbilityCleaned(token); innerService->Wait(); - APP_LOGI("ams_service_event_drive_test_005 end"); + HILOG_INFO("ams_service_event_drive_test_005 end"); } /* @@ -210,7 +210,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_005, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_006, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_006 start"); + HILOG_INFO("ams_service_event_drive_test_006 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); @@ -223,7 +223,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_006, TestSize.Level1) appMgrService_->ClearUpApplicationData(appName); innerService->Wait(); - APP_LOGI("ams_service_event_drive_test_006 end"); + HILOG_INFO("ams_service_event_drive_test_006 end"); } /* @@ -236,7 +236,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_006, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_008, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_008 start"); + HILOG_INFO("ams_service_event_drive_test_008 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); @@ -247,7 +247,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_008, TestSize.Level1) std::vector runningProcessInfo; EXPECT_EQ(0, appMgrService_->GetAllRunningProcesses(runningProcessInfo)); - APP_LOGI("ams_service_event_drive_test_008 end"); + HILOG_INFO("ams_service_event_drive_test_008 end"); } /* @@ -260,7 +260,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_008, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_009, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_009 start"); + HILOG_INFO("ams_service_event_drive_test_009 start"); appMgrService_->OnStop(); std::shared_ptr innerService = std::make_shared(); @@ -271,7 +271,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_009, TestSize.Level1) sptr client; appMgrService_->AttachApplication(client); - APP_LOGI("ams_service_event_drive_test_009 end"); + HILOG_INFO("ams_service_event_drive_test_009 end"); } /* @@ -284,7 +284,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_009, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_010, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_010 start"); + HILOG_INFO("ams_service_event_drive_test_010 start"); appMgrService_->OnStop(); std::shared_ptr innerService = std::make_shared(); @@ -295,7 +295,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_010, TestSize.Level1) int32_t recordId = 0; appMgrService_->ApplicationForegrounded(recordId); - APP_LOGI("ams_service_event_drive_test_010 end"); + HILOG_INFO("ams_service_event_drive_test_010 end"); } /* @@ -308,7 +308,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_010, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_011, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_011 start"); + HILOG_INFO("ams_service_event_drive_test_011 start"); appMgrService_->OnStop(); std::shared_ptr innerService = std::make_shared(); @@ -319,7 +319,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_011, TestSize.Level1) int32_t recordId = 0; appMgrService_->ApplicationBackgrounded(recordId); - APP_LOGI("ams_service_event_drive_test_011 end"); + HILOG_INFO("ams_service_event_drive_test_011 end"); } /* @@ -332,7 +332,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_011, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_012, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_012 start"); + HILOG_INFO("ams_service_event_drive_test_012 start"); appMgrService_->OnStop(); std::shared_ptr innerService = std::make_shared(); @@ -343,7 +343,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_012, TestSize.Level1) int32_t recordId = 0; appMgrService_->ApplicationTerminated(recordId); - APP_LOGI("ams_service_event_drive_test_012 end"); + HILOG_INFO("ams_service_event_drive_test_012 end"); } /* @@ -356,7 +356,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_012, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_013, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_013 start"); + HILOG_INFO("ams_service_event_drive_test_013 start"); appMgrService_->OnStop(); std::shared_ptr innerService = std::make_shared(); @@ -367,7 +367,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_013, TestSize.Level1) sptr token; appMgrService_->AbilityCleaned(token); - APP_LOGI("ams_service_event_drive_test_013 end"); + HILOG_INFO("ams_service_event_drive_test_013 end"); } /* @@ -380,7 +380,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_013, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_014, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_014 start"); + HILOG_INFO("ams_service_event_drive_test_014 start"); appMgrService_->OnStop(); std::shared_ptr innerService = std::make_shared(); @@ -391,7 +391,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_014, TestSize.Level1) std::string appName = "appName"; appMgrService_->ClearUpApplicationData(appName); - APP_LOGI("ams_service_event_drive_test_014 end"); + HILOG_INFO("ams_service_event_drive_test_014 end"); } /* @@ -404,7 +404,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_014, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_016, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_016 start"); + HILOG_INFO("ams_service_event_drive_test_016 start"); appMgrService_->OnStop(); std::shared_ptr innerService = std::make_shared(); @@ -413,7 +413,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_016, TestSize.Level1) std::vector runningProcessInfo; EXPECT_EQ(OHOS::ERR_INVALID_OPERATION, appMgrService_->GetAllRunningProcesses(runningProcessInfo)); - APP_LOGI("ams_service_event_drive_test_016 end"); + HILOG_INFO("ams_service_event_drive_test_016 end"); } /* @@ -426,7 +426,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_016, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_017, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_017 start"); + HILOG_INFO("ams_service_event_drive_test_017 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); @@ -438,7 +438,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_017, TestSize.Level1) sptr client; appMgrService_->AttachApplication(client); - APP_LOGI("ams_service_event_drive_test_017 end"); + HILOG_INFO("ams_service_event_drive_test_017 end"); } /* @@ -451,7 +451,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_017, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_018, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_018 start"); + HILOG_INFO("ams_service_event_drive_test_018 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); @@ -463,7 +463,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_018, TestSize.Level1) int32_t recordId = 0; appMgrService_->ApplicationForegrounded(recordId); - APP_LOGI("ams_service_event_drive_test_018 end"); + HILOG_INFO("ams_service_event_drive_test_018 end"); } /* @@ -476,7 +476,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_018, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_019, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_019 start"); + HILOG_INFO("ams_service_event_drive_test_019 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); @@ -488,7 +488,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_019, TestSize.Level1) int32_t recordId = 0; appMgrService_->ApplicationBackgrounded(recordId); - APP_LOGI("ams_service_event_drive_test_019 end"); + HILOG_INFO("ams_service_event_drive_test_019 end"); } /* @@ -501,7 +501,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_019, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_020, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_020 start"); + HILOG_INFO("ams_service_event_drive_test_020 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); @@ -513,7 +513,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_020, TestSize.Level1) int32_t recordId = 0; appMgrService_->ApplicationTerminated(recordId); - APP_LOGI("ams_service_event_drive_test_020 end"); + HILOG_INFO("ams_service_event_drive_test_020 end"); } /* @@ -526,7 +526,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_020, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_021, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_021 start"); + HILOG_INFO("ams_service_event_drive_test_021 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -537,7 +537,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_021, TestSize.Level1) sptr token; appMgrService_->AbilityCleaned(token); - APP_LOGI("ams_service_event_drive_test_021 end"); + HILOG_INFO("ams_service_event_drive_test_021 end"); } /* @@ -550,7 +550,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_021, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_022, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_022 start"); + HILOG_INFO("ams_service_event_drive_test_022 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -561,7 +561,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_022, TestSize.Level1) std::string appName = "appName"; appMgrService_->ClearUpApplicationData(appName); - APP_LOGI("ams_service_event_drive_test_022 end"); + HILOG_INFO("ams_service_event_drive_test_022 end"); } /* @@ -574,7 +574,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_022, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_024, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_024 start"); + HILOG_INFO("ams_service_event_drive_test_024 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -585,7 +585,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_024, TestSize.Level1) std::vector runningProcessInfo; EXPECT_EQ(OHOS::ERR_INVALID_OPERATION, appMgrService_->GetAllRunningProcesses(runningProcessInfo)); - APP_LOGI("ams_service_event_drive_test_024 end"); + HILOG_INFO("ams_service_event_drive_test_024 end"); } /* @@ -598,7 +598,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_024, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_025, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_025 start"); + HILOG_INFO("ams_service_event_drive_test_025 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -614,7 +614,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_025, TestSize.Level1) appMgrService_->ApplicationBackgrounded(recordId); appMgrService_->ApplicationForegrounded(recordId); innerService->Wait(); - APP_LOGI("ams_service_event_drive_test_025 end"); + HILOG_INFO("ams_service_event_drive_test_025 end"); } /* @@ -627,7 +627,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_025, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_026, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_026 start"); + HILOG_INFO("ams_service_event_drive_test_026 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -643,7 +643,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_026, TestSize.Level1) appMgrService_->ApplicationForegrounded(recordId); appMgrService_->ApplicationBackgrounded(recordId); innerService->Wait(); - APP_LOGI("ams_service_event_drive_test_026 end"); + HILOG_INFO("ams_service_event_drive_test_026 end"); } /* @@ -656,7 +656,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_026, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_027, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_027 start"); + HILOG_INFO("ams_service_event_drive_test_027 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -672,7 +672,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_027, TestSize.Level1) appMgrService_->ApplicationBackgrounded(recordId); appMgrService_->ApplicationTerminated(recordId); innerService->Wait(); - APP_LOGI("ams_service_event_drive_test_027 end"); + HILOG_INFO("ams_service_event_drive_test_027 end"); } /* @@ -685,7 +685,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_027, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_028, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_028 start"); + HILOG_INFO("ams_service_event_drive_test_028 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -701,7 +701,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_028, TestSize.Level1) appMgrService_->ApplicationForegrounded(recordId); appMgrService_->ApplicationTerminated(recordId); innerService->Wait(); - APP_LOGI("ams_service_event_drive_test_028 end"); + HILOG_INFO("ams_service_event_drive_test_028 end"); } /* @@ -714,7 +714,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_028, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_029, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_029 start"); + HILOG_INFO("ams_service_event_drive_test_029 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -730,7 +730,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_029, TestSize.Level1) appMgrService_->ApplicationTerminated(recordId); appMgrService_->ApplicationForegrounded(recordId); innerService->Wait(); - APP_LOGI("ams_service_event_drive_test_029 end"); + HILOG_INFO("ams_service_event_drive_test_029 end"); } /* @@ -743,7 +743,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_029, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_030, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_030 start"); + HILOG_INFO("ams_service_event_drive_test_030 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -759,7 +759,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_030, TestSize.Level1) appMgrService_->ApplicationTerminated(recordId); appMgrService_->ApplicationBackgrounded(recordId); innerService->Wait(); - APP_LOGI("ams_service_event_drive_test_030 end"); + HILOG_INFO("ams_service_event_drive_test_030 end"); } /* @@ -772,7 +772,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_030, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_034, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_034 start"); + HILOG_INFO("ams_service_event_drive_test_034 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -783,7 +783,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_034, TestSize.Level1) pid_t pid = 1; appMgrService_->AddAppDeathRecipient(pid); innerService->Wait(); - APP_LOGI("ams_service_event_drive_test_034 end"); + HILOG_INFO("ams_service_event_drive_test_034 end"); } /* @@ -796,7 +796,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_034, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_035, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_035 start"); + HILOG_INFO("ams_service_event_drive_test_035 start"); appMgrService_->OnStop(); std::shared_ptr innerService = std::make_shared(); @@ -807,7 +807,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_035, TestSize.Level1) pid_t pid = 1; appMgrService_->AddAppDeathRecipient(pid); - APP_LOGI("ams_service_event_drive_test_035 end"); + HILOG_INFO("ams_service_event_drive_test_035 end"); } /* @@ -820,7 +820,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_035, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_036, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_036 start"); + HILOG_INFO("ams_service_event_drive_test_036 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); @@ -832,7 +832,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_036, TestSize.Level1) pid_t pid = 1; appMgrService_->AddAppDeathRecipient(pid); - APP_LOGI("ams_service_event_drive_test_036 end"); + HILOG_INFO("ams_service_event_drive_test_036 end"); } /* @@ -845,7 +845,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_036, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_037, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_037 start"); + HILOG_INFO("ams_service_event_drive_test_037 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); @@ -856,7 +856,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_037, TestSize.Level1) EXPECT_EQ(ServiceRunningState::STATE_RUNNING, appMgrService_->QueryServiceState().serviceRunningState); EXPECT_EQ(SpawnConnectionState::STATE_CONNECTED, appMgrService_->QueryServiceState().connectionState); - APP_LOGI("ams_service_event_drive_test_037 end"); + HILOG_INFO("ams_service_event_drive_test_037 end"); } /* @@ -869,7 +869,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_037, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_038, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_038 start"); + HILOG_INFO("ams_service_event_drive_test_038 start"); appMgrService_->OnStop(); std::shared_ptr innerService = std::make_shared(); @@ -879,7 +879,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_038, TestSize.Level1) EXPECT_EQ(ServiceRunningState::STATE_NOT_START, appMgrService_->QueryServiceState().serviceRunningState); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appMgrService_->QueryServiceState().connectionState); - APP_LOGI("ams_service_event_drive_test_038 end"); + HILOG_INFO("ams_service_event_drive_test_038 end"); } /* @@ -892,7 +892,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_038, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_039, TestSize.Level1) { - APP_LOGI("ams_service_event_drive_test_039 start"); + HILOG_INFO("ams_service_event_drive_test_039 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); @@ -903,7 +903,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_039, TestSize.Level1) EXPECT_EQ(ServiceRunningState::STATE_NOT_START, appMgrService_->QueryServiceState().serviceRunningState); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appMgrService_->QueryServiceState().connectionState); - APP_LOGI("ams_service_event_drive_test_039 end"); + HILOG_INFO("ams_service_event_drive_test_039 end"); } /* @@ -916,7 +916,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_039, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_040, TestSize.Level1) { - APP_LOGI("AppMgrService::EventDrive_040 start 1"); + HILOG_INFO("AppMgrService::EventDrive_040 start 1"); OHOS::AppExecFwk::SystemMemoryAttr memInfo; nlohmann::json memJson = { "memoryThreshold", 25 }; std::string strConfig = memJson.dump(); @@ -931,7 +931,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_040, TestSize.Level1) EXPECT_NE(-1, memInfo.totalSysMem_); EXPECT_NE(-1, memInfo.threshold_); - APP_LOGI("AppMgrService::EventDrive_040 end"); + HILOG_INFO("AppMgrService::EventDrive_040 end"); } /* @@ -944,7 +944,7 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_040, TestSize.Level1) */ HWTEST_F(AmsServiceEventDriveTest, EventDrive_041, TestSize.Level1) { - APP_LOGI("AppMgrService::EventDrive_041 start"); + HILOG_INFO("AppMgrService::EventDrive_041 start"); OHOS::AppExecFwk::SystemMemoryAttr memInfo; std::string strConfig; @@ -958,5 +958,5 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_041, TestSize.Level1) EXPECT_NE(-1, memInfo.totalSysMem_); EXPECT_NE(-1, memInfo.threshold_); - APP_LOGI("AppMgrService::EventDrive_041 end"); + HILOG_INFO("AppMgrService::EventDrive_041 end"); } diff --git a/services/appmgr/test/unittest/ams_service_load_ability_process_test/ams_service_load_ability_process_test.cpp b/services/appmgr/test/unittest/ams_service_load_ability_process_test/ams_service_load_ability_process_test.cpp index e5a0e354bc..993b52c688 100644 --- a/services/appmgr/test/unittest/ams_service_load_ability_process_test/ams_service_load_ability_process_test.cpp +++ b/services/appmgr/test/unittest/ams_service_load_ability_process_test/ams_service_load_ability_process_test.cpp @@ -22,10 +22,10 @@ #include "ability_running_record.h" #include "app_mgr_service.h" #include "app_running_record.h" -#include "app_log_wrapper.h" #include "app_record_id.h" #include "ability_info.h" #include "application_info.h" +#include "hilog_wrapper.h" #include "mock_app_scheduler.h" #include "mock_bundle_manager.h" #include "mock_ability_token.h" @@ -123,7 +123,7 @@ std::shared_ptr AmsServiceLoadAbilityProcessTest::StartLoadAbi */ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_001, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest LoadAbility_001 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LoadAbility_001 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -153,7 +153,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_001, TestSize.Level1) EXPECT_NE(abilityRecord, nullptr); CHECK_POINTER_IS_NULLPTR(abilityRecord); EXPECT_EQ(abilityRecord->GetState(), AbilityState::ABILITY_STATE_CREATE); - APP_LOGI("AmsServiceLoadAbilityProcessTest LoadAbility_001 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LoadAbility_001 end"); } /* @@ -166,7 +166,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_001, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_002, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest LoadAbility_002 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LoadAbility_002 start"); EXPECT_TRUE(service_ != nullptr); service_->ClearRecentAppList(); @@ -229,7 +229,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_002, TestSize.Level1) EXPECT_NE(abilityRecord2, nullptr); CHECK_POINTER_IS_NULLPTR(abilityRecord2); EXPECT_EQ(abilityRecord2->GetState(), AbilityState::ABILITY_STATE_CREATE); - APP_LOGI("AmsServiceLoadAbilityProcessTest LoadAbility_002 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LoadAbility_002 end"); } /* @@ -242,7 +242,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_002, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_003, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest LoadAbility_003 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LoadAbility_003 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -260,7 +260,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_003, TestSize.Level1) const auto &recordMap = service_->GetRecordMap(); EXPECT_EQ(recordMap.size(), (uint32_t)0); - APP_LOGI("AmsServiceLoadAbilityProcessTest LoadAbility_003 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LoadAbility_003 end"); } /* @@ -273,7 +273,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_003, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_004, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest LoadAbility_004 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LoadAbility_004 start"); sptr token = GetMockToken(); auto abilityInfo = std::make_shared(); abilityInfo->name = ""; @@ -291,7 +291,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_004, TestSize.Level1) service_->LoadAbility(token, nullptr, abilityInfo, appInfo, nullptr); const auto &recordMap = service_->GetRecordMap(); EXPECT_EQ(recordMap.size(), (uint32_t)0); - APP_LOGI("AmsServiceLoadAbilityProcessTest LoadAbility_004 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LoadAbility_004 end"); } /* @@ -304,7 +304,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_004, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_005, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest LoadAbility_005 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LoadAbility_005 start"); sptr token = GetMockToken(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -321,7 +321,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_005, TestSize.Level1) service_->LoadAbility(token, nullptr, abilityInfo, appInfo, nullptr); const auto &recordMap = service_->GetRecordMap(); EXPECT_EQ(recordMap.size(), (uint32_t)0); - APP_LOGI("AmsServiceLoadAbilityProcessTest LoadAbility_005 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LoadAbility_005 end"); } /* @@ -334,7 +334,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_005, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_006, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest LoadAbility_006 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LoadAbility_006 start"); sptr token = GetMockToken(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -352,7 +352,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_006, TestSize.Level1) service_->LoadAbility(token, nullptr, abilityInfo, appInfo, nullptr); const auto &recordMap = service_->GetRecordMap(); EXPECT_EQ(recordMap.size(), (uint32_t)0); - APP_LOGI("AmsServiceLoadAbilityProcessTest LoadAbility_006 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LoadAbility_006 end"); } /* @@ -365,7 +365,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_006, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_007, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest LoadAbility_007 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LoadAbility_007 start"); sptr token = GetMockToken(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -407,7 +407,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_007, TestSize.Level1) EXPECT_EQ(record2, record); const auto &abilityMap2 = record2->GetAbilities(); EXPECT_EQ(abilityMap2.size(), (uint32_t)1); - APP_LOGI("AmsServiceLoadAbilityProcessTest LoadAbility_007 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LoadAbility_007 end"); } /* @@ -420,7 +420,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_007, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_008, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest LoadAbility_008 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LoadAbility_008 start"); sptr token = GetMockToken(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -473,7 +473,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_008, TestSize.Level1) CHECK_POINTER_IS_NULLPTR(abilityRecord2); EXPECT_EQ(abilityRecord2->GetState(), AbilityState::ABILITY_STATE_CREATE); EXPECT_EQ(abilityRecord2->GetPreToken(), token); - APP_LOGI("AmsServiceLoadAbilityProcessTest LoadAbility_008 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LoadAbility_008 end"); } /* @@ -486,7 +486,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LoadAbility_008, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, RequestProcess_001, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest RequestProcess_001 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest RequestProcess_001 start"); sptr token = GetMockToken(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -516,7 +516,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, RequestProcess_001, TestSize.Level1) CHECK_POINTER_IS_NULLPTR(record); EXPECT_EQ(record->GetPriorityObject()->GetPid(), PID); EXPECT_EQ(record->GetState(), ApplicationState::APP_STATE_CREATE); - APP_LOGI("AmsServiceLoadAbilityProcessTest RequestProcess_001 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest RequestProcess_001 end"); } /* @@ -529,7 +529,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, RequestProcess_001, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, RequestProcess_002, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest RequestProcess_002 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest RequestProcess_002 start"); sptr token = GetMockToken(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -549,7 +549,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, RequestProcess_002, TestSize.Level1) const auto &recordMap = service_->GetRecordMap(); EXPECT_EQ(recordMap.size(), (uint32_t)0); - APP_LOGI("AmsServiceLoadAbilityProcessTest RequestProcess_002 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest RequestProcess_002 end"); } /* @@ -562,7 +562,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, RequestProcess_002, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, SavePid_001, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest SavePid_001 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest SavePid_001 start"); sptr token = GetMockToken(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -587,7 +587,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, SavePid_001, TestSize.Level1) auto record = service_->appRunningManager_->CheckAppRunningRecordIsExist( appInfo->name, GetTestAppName(), appInfo->uid, bundleInfo); EXPECT_EQ(record->GetPriorityObject()->GetPid(), PID); - APP_LOGI("AmsServiceLoadAbilityProcessTest SavePid_001 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest SavePid_001 end"); } /* @@ -600,7 +600,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, SavePid_001, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, SavePid_002, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest SavePid_002 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest SavePid_002 start"); sptr token = GetMockToken(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -622,7 +622,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, SavePid_002, TestSize.Level1) auto record = service_->appRunningManager_->CheckAppRunningRecordIsExist( appInfo->name, GetTestAppName(), appInfo->uid, bundleInfo); EXPECT_EQ(record, nullptr); - APP_LOGI("AmsServiceLoadAbilityProcessTest SavePid_002 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest SavePid_002 end"); } /* @@ -635,7 +635,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, SavePid_002, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, LaunchMode_001, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest LaunchMode_001 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LaunchMode_001 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -665,7 +665,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LaunchMode_001, TestSize.Level1) EXPECT_NE(abilityRecord, nullptr); CHECK_POINTER_IS_NULLPTR(abilityRecord); EXPECT_EQ(abilityRecord->GetState(), AbilityState::ABILITY_STATE_CREATE); - APP_LOGI("AmsServiceLoadAbilityProcessTest LaunchMode_001 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LaunchMode_001 end"); } /* @@ -678,7 +678,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LaunchMode_001, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, LaunchMode_002, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest LaunchMode_002 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LaunchMode_002 start"); sptr token = GetMockToken(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -721,7 +721,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LaunchMode_002, TestSize.Level1) EXPECT_EQ(record2, record); const auto &abilityMap2 = record2->GetAbilities(); EXPECT_EQ(abilityMap2.size(), (uint32_t)1); - APP_LOGI("AmsServiceLoadAbilityProcessTest LaunchMode_002 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest LaunchMode_002 end"); } /* @@ -734,7 +734,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, LaunchMode_002, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_001, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest StartAbility_001 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartAbility_001 start"); sptr token = GetMockToken(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -788,7 +788,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_001, TestSize.Level1) EXPECT_NE(abilityrecord1, nullptr); CHECK_POINTER_IS_NULLPTR(abilityrecord1); EXPECT_EQ(abilityrecord1->GetState(), AbilityState::ABILITY_STATE_READY); - APP_LOGI("AmsServiceLoadAbilityProcessTest StartAbility_001 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartAbility_001 end"); } /* @@ -801,7 +801,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_001, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_002, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest StartAbility_002 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartAbility_002 start"); sptr token = GetMockToken(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -850,7 +850,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_002, TestSize.Level1) appInfo->name, GetTestAppName(), appInfo->uid, bundleInfo); const auto &abilityMap1 = record1->GetAbilities(); EXPECT_EQ(abilityMap1.size(), (uint32_t)1); - APP_LOGI("AmsServiceLoadAbilityProcessTest StartAbility_002 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartAbility_002 end"); } /* @@ -863,7 +863,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_002, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_003, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest StartAbility_003 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartAbility_003 start"); sptr token = GetMockToken(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -916,7 +916,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_003, TestSize.Level1) appInfo->name, GetTestAppName(), appInfo->uid, bundleInfo); const auto &abilityMap1 = record1->GetAbilities(); EXPECT_EQ(abilityMap1.size(), (uint32_t)1); - APP_LOGI("AmsServiceLoadAbilityProcessTest StartAbility_003 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartAbility_003 end"); } /* @@ -929,7 +929,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_003, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_004, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest StartAbility_004 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartAbility_004 start"); sptr token = GetMockToken(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -976,7 +976,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_004, TestSize.Level1) appInfo->name, GetTestAppName(), appInfo->uid, bundleInfo); const auto &abilityMap1 = record1->GetAbilities(); EXPECT_EQ(abilityMap1.size(), (uint32_t)1); - APP_LOGI("AmsServiceLoadAbilityProcessTest StartAbility_004 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartAbility_004 end"); } /* @@ -989,7 +989,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_004, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_005, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest StartAbility_005 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartAbility_005 start"); sptr token = GetMockToken(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -1042,7 +1042,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_005, TestSize.Level1) EXPECT_NE(abilityrecord1, nullptr); CHECK_POINTER_IS_NULLPTR(abilityrecord1); EXPECT_EQ(abilityrecord1->GetState(), AbilityState::ABILITY_STATE_READY); - APP_LOGI("AmsServiceLoadAbilityProcessTest StartAbility_005 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartAbility_005 end"); } /* @@ -1055,7 +1055,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_005, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_006, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest StartAbility_006 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartAbility_006 start"); sptr token = GetMockToken(); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); @@ -1100,7 +1100,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_006, TestSize.Level1) appInfo->name, GetTestAppName(), appInfo->uid, bundleInfo); const auto &abilityMap1 = record1->GetAbilities(); EXPECT_EQ(abilityMap1.size(), (uint32_t)1); - APP_LOGI("AmsServiceLoadAbilityProcessTest StartAbility_006 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartAbility_006 end"); } /* @@ -1113,7 +1113,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartAbility_006, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartProcess001, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest StartProcess001 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartProcess001 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -1157,7 +1157,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartProcess001, TestSize.Level1) EXPECT_NE(abilityRecord, nullptr); CHECK_POINTER_IS_NULLPTR(abilityRecord); EXPECT_EQ(abilityRecord->GetState(), AbilityState::ABILITY_STATE_CREATE); - APP_LOGI("AmsServiceLoadAbilityProcessTest StartProcess001 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartProcess001 end"); } /* @@ -1170,7 +1170,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartProcess001, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartProcess002, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest StartProcess002 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartProcess002 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -1200,7 +1200,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartProcess002, TestSize.Level1) appInfo->name, GetTestAppName(), appInfo->uid, bundleInfo); EXPECT_NE(record1, nullptr); CHECK_POINTER_IS_NULLPTR(record1); - APP_LOGI("AmsServiceLoadAbilityProcessTest StartProcess002 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartProcess002 end"); } /* @@ -1213,7 +1213,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartProcess002, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartProcess003, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest StartProcess003 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartProcess003 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -1244,7 +1244,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartProcess003, TestSize.Level1) appInfo->name, GetTestAppName(), appInfo->uid, bundleInfo); EXPECT_NE(record1, nullptr); CHECK_POINTER_IS_NULLPTR(record1); - APP_LOGI("AmsServiceLoadAbilityProcessTest StartProcess003 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartProcess003 end"); } /* @@ -1257,7 +1257,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartProcess003, TestSize.Level1) */ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartProcess004, TestSize.Level1) { - APP_LOGI("AmsServiceLoadAbilityProcessTest StartProcess004 start"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartProcess004 start"); auto abilityInfo = std::make_shared(); abilityInfo->name = GetTestAbilityName(); abilityInfo->applicationName = GetTestAppName(); @@ -1292,7 +1292,7 @@ HWTEST_F(AmsServiceLoadAbilityProcessTest, StartProcess004, TestSize.Level1) abilityInfo->applicationInfo.bundleName); auto record1 = service_->GetAppRunningRecordByAppRecordId(record->GetRecordId()); EXPECT_EQ(record1, nullptr); - APP_LOGI("AmsServiceLoadAbilityProcessTest StartProcess004 end"); + HILOG_INFO("AmsServiceLoadAbilityProcessTest StartProcess004 end"); } } // namespace AppExecFwk diff --git a/services/appmgr/test/unittest/ams_service_startup_test/ams_service_startup_test.cpp b/services/appmgr/test/unittest/ams_service_startup_test/ams_service_startup_test.cpp index 44b3030193..526b60bfb9 100644 --- a/services/appmgr/test/unittest/ams_service_startup_test/ams_service_startup_test.cpp +++ b/services/appmgr/test/unittest/ams_service_startup_test/ams_service_startup_test.cpp @@ -20,7 +20,7 @@ #undef private #undef protected #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" using namespace testing; using namespace testing::ext; @@ -63,7 +63,7 @@ void AmsServiceStartupTest::TearDown() */ HWTEST_F(AmsServiceStartupTest, Startup_001, TestSize.Level1) { - APP_LOGI("ams_service_startup_001 start"); + HILOG_INFO("ams_service_startup_001 start"); std::shared_ptr appMgrService = std::make_shared(); std::shared_ptr innerService = std::make_shared(); appMgrService->SetInnerService(innerService); @@ -72,7 +72,7 @@ HWTEST_F(AmsServiceStartupTest, Startup_001, TestSize.Level1) EXPECT_EQ(ServiceRunningState::STATE_RUNNING, appMgrService->QueryServiceState().serviceRunningState); appMgrService->OnStop(); EXPECT_EQ(ServiceRunningState::STATE_NOT_START, appMgrService->QueryServiceState().serviceRunningState); - APP_LOGI("ams_service_startup_001 end"); + HILOG_INFO("ams_service_startup_001 end"); } /* @@ -85,7 +85,7 @@ HWTEST_F(AmsServiceStartupTest, Startup_001, TestSize.Level1) */ HWTEST_F(AmsServiceStartupTest, Startup_002, TestSize.Level1) { - APP_LOGI("ams_service_startup_002 start"); + HILOG_INFO("ams_service_startup_002 start"); std::shared_ptr appMgrService = std::make_shared(); std::shared_ptr innerService = std::make_shared(); appMgrService->SetInnerService(innerService); @@ -96,7 +96,7 @@ HWTEST_F(AmsServiceStartupTest, Startup_002, TestSize.Level1) EXPECT_EQ(ServiceRunningState::STATE_RUNNING, appMgrService->QueryServiceState().serviceRunningState); appMgrService->OnStop(); EXPECT_EQ(ServiceRunningState::STATE_NOT_START, appMgrService->QueryServiceState().serviceRunningState); - APP_LOGI("ams_service_startup_002 end"); + HILOG_INFO("ams_service_startup_002 end"); } /* @@ -109,14 +109,14 @@ HWTEST_F(AmsServiceStartupTest, Startup_002, TestSize.Level1) */ HWTEST_F(AmsServiceStartupTest, Startup_003, TestSize.Level1) { - APP_LOGI("ams_service_startup_003 start"); + HILOG_INFO("ams_service_startup_003 start"); std::shared_ptr appMgrService = std::make_shared(); std::shared_ptr innerService = std::make_shared(); appMgrService->SetInnerService(innerService); EXPECT_EQ(ServiceRunningState::STATE_NOT_START, appMgrService->QueryServiceState().serviceRunningState); appMgrService->OnStop(); EXPECT_EQ(ServiceRunningState::STATE_NOT_START, appMgrService->QueryServiceState().serviceRunningState); - APP_LOGI("ams_service_startup_003 end"); + HILOG_INFO("ams_service_startup_003 end"); } /* @@ -129,7 +129,7 @@ HWTEST_F(AmsServiceStartupTest, Startup_003, TestSize.Level1) */ HWTEST_F(AmsServiceStartupTest, Startup_004, TestSize.Level1) { - APP_LOGI("ams_service_startup_004 start"); + HILOG_INFO("ams_service_startup_004 start"); std::shared_ptr appMgrService = std::make_shared(); std::shared_ptr innerService = std::make_shared(); appMgrService->SetInnerService(innerService); @@ -140,7 +140,7 @@ HWTEST_F(AmsServiceStartupTest, Startup_004, TestSize.Level1) EXPECT_EQ(ServiceRunningState::STATE_NOT_START, appMgrService->QueryServiceState().serviceRunningState); appMgrService->OnStop(); EXPECT_EQ(ServiceRunningState::STATE_NOT_START, appMgrService->QueryServiceState().serviceRunningState); - APP_LOGI("ams_service_startup_004 end"); + HILOG_INFO("ams_service_startup_004 end"); } /* @@ -153,7 +153,7 @@ HWTEST_F(AmsServiceStartupTest, Startup_004, TestSize.Level1) */ HWTEST_F(AmsServiceStartupTest, Startup_005, TestSize.Level1) { - APP_LOGI("ams_service_startup_005 start"); + HILOG_INFO("ams_service_startup_005 start"); std::shared_ptr appMgrService = std::make_shared(); std::shared_ptr innerService = std::make_shared(); appMgrService->SetInnerService(innerService); @@ -166,7 +166,7 @@ HWTEST_F(AmsServiceStartupTest, Startup_005, TestSize.Level1) EXPECT_EQ(ServiceRunningState::STATE_RUNNING, appMgrService->QueryServiceState().serviceRunningState); appMgrService->OnStop(); EXPECT_EQ(ServiceRunningState::STATE_NOT_START, appMgrService->QueryServiceState().serviceRunningState); - APP_LOGI("ams_service_startup_005 end"); + HILOG_INFO("ams_service_startup_005 end"); } } // namespace AppExecFwk } // namespace OHOS diff --git a/services/appmgr/test/unittest/ams_start_via_asan_test/ams_start_via_asan_test.cpp b/services/appmgr/test/unittest/ams_start_via_asan_test/ams_start_via_asan_test.cpp index 3603273892..70a9bde724 100644 --- a/services/appmgr/test/unittest/ams_start_via_asan_test/ams_start_via_asan_test.cpp +++ b/services/appmgr/test/unittest/ams_start_via_asan_test/ams_start_via_asan_test.cpp @@ -16,7 +16,7 @@ #include "start_via_asan.h" #include #include "properties.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" using namespace testing::ext; namespace OHOS { @@ -51,12 +51,12 @@ void AmsStartViaAsanTest::TearDown() */ HWTEST_F(AmsStartViaAsanTest, IsAsanVersion_001, TestSize.Level1) { - APP_LOGD("IsAsanVersion_001 start"); + HILOG_DEBUG("IsAsanVersion_001 start"); std::string appName = "com.ohos.hiworld"; bool result = DelayedSingleton::GetInstance()->IsAsanVersion(appName); EXPECT_EQ(result, false); - APP_LOGD("IsAsanVersion_001 end"); + HILOG_DEBUG("IsAsanVersion_001 end"); } /* @@ -69,12 +69,12 @@ HWTEST_F(AmsStartViaAsanTest, IsAsanVersion_001, TestSize.Level1) */ HWTEST_F(AmsStartViaAsanTest, GetAsanStartMsg_001, TestSize.Level1) { - APP_LOGD("GetAsanStartMsg_001 start"); + HILOG_DEBUG("GetAsanStartMsg_001 start"); std::string appName = "com.ohos.hiworld"; AppSpawnStartMsg startMsg = {appName, "clsName", "funcName", "soPath"}; DelayedSingleton::GetInstance()->GetAsanStartMsg(startMsg); EXPECT_EQ(startMsg.arg, "wrap." + appName); - APP_LOGD("GetAsanStartMsg_001 end"); + HILOG_DEBUG("GetAsanStartMsg_001 end"); } } // namespace AppExecFwk } // namespace OHOS diff --git a/services/appmgr/test/unittest/app_mgr_service_event_handler_test/app_mgr_service_event_handler_test.cpp b/services/appmgr/test/unittest/app_mgr_service_event_handler_test/app_mgr_service_event_handler_test.cpp index 977e188955..18f4a03a2b 100644 --- a/services/appmgr/test/unittest/app_mgr_service_event_handler_test/app_mgr_service_event_handler_test.cpp +++ b/services/appmgr/test/unittest/app_mgr_service_event_handler_test/app_mgr_service_event_handler_test.cpp @@ -17,11 +17,11 @@ #include "app_mgr_service_event_handler.h" #undef private -#include "app_log_wrapper.h" #include "app_mgr_service_inner.h" #include #include #include "mock_app_scheduler.h" +#include "hilog_wrapper.h" #include "inner_event.h" #include @@ -113,20 +113,20 @@ MockAMSEventHandler::~MockAMSEventHandler() HWTEST_F(AMSEventHandlerTest, app_mgr_service_event_handler_test_001, TestSize.Level1) { - APP_LOGI("app_mgr_service_event_handler_test start"); + HILOG_INFO("app_mgr_service_event_handler_test start"); if (!runner_) { - APP_LOGI("app_mgr_service_event_handler_test : runner_ is null"); + HILOG_INFO("app_mgr_service_event_handler_test : runner_ is null"); } if (!testAms) { - APP_LOGI("app_mgr_service_event_handler_test : testAms is null"); + HILOG_INFO("app_mgr_service_event_handler_test : testAms is null"); } EXPECT_FALSE(eventHandler_); // init eventHandler_ = std::make_shared(runner_, testAms); EXPECT_TRUE(eventHandler_); - APP_LOGI("app_mgr_service_event_handler_test end"); + HILOG_INFO("app_mgr_service_event_handler_test end"); } /* @@ -140,7 +140,7 @@ HWTEST_F(AMSEventHandlerTest, app_mgr_service_event_handler_test_001, TestSize.L HWTEST_F(AMSEventHandlerTest, app_mgr_service_event_handler_test_002, TestSize.Level1) { - APP_LOGI("app_mgr_service_event_handler_test start"); + HILOG_INFO("app_mgr_service_event_handler_test start"); if (!eventHandler_) { eventHandler_ = std::make_shared(runner_, testAms); @@ -160,7 +160,7 @@ HWTEST_F(AMSEventHandlerTest, app_mgr_service_event_handler_test_002, TestSize.L WaitUntilTaskFinished(eventHandler_); EXPECT_TRUE(eventHandlerFlag_); - APP_LOGI("app_mgr_service_event_handler_test end"); + HILOG_INFO("app_mgr_service_event_handler_test end"); } } // namespace AppExecFwk } // namespace OHOS diff --git a/services/appmgr/test/unittest/app_running_processes_info_test/app_running_processes_info_test.cpp b/services/appmgr/test/unittest/app_running_processes_info_test/app_running_processes_info_test.cpp index 0785dcac99..aa93e58aa4 100644 --- a/services/appmgr/test/unittest/app_running_processes_info_test/app_running_processes_info_test.cpp +++ b/services/appmgr/test/unittest/app_running_processes_info_test/app_running_processes_info_test.cpp @@ -22,11 +22,11 @@ #include "iremote_object.h" #include "refbase.h" #include "application_info.h" -#include "app_log_wrapper.h" #include "app_record_id.h" #include "app_scheduler_host.h" #include "ability_info.h" #include "ability_running_record.h" +#include "hilog_wrapper.h" #include "mock_app_scheduler.h" #include "mock_ability_token.h" #include "mock_app_spawn_client.h" diff --git a/services/dataobsmgr/BUILD.gn b/services/dataobsmgr/BUILD.gn index 67763b9787..c48189213f 100644 --- a/services/dataobsmgr/BUILD.gn +++ b/services/dataobsmgr/BUILD.gn @@ -28,14 +28,8 @@ group("unittest") { config("dataobsms_config") { include_dirs = [ "include/", - "${innerkits_path}/base/include", "${services_path}/common/include", - "//utils/native/base/include", - "//utils/system/safwk/native/include", - "//prebuilts/jdk/jdk8/linux-x86/include", - "//prebuilts/jdk/jdk8/linux-x86/include/linux", "//third_party/json/include", - "//foundation/aafwk/standard/interfaces/innerkits/dataobs_manager/include", ] cflags = [] if (target_cpu == "arm") { @@ -48,22 +42,20 @@ ohos_shared_library("dataobsms") { configs = [ ":dataobsms_config" ] - deps = [ - "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", - "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", - "//foundation/aafwk/standard/interfaces/innerkits/base:base", - "//foundation/aafwk/standard/interfaces/innerkits/dataobs_manager:dataobs_manager", - "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler", - "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//utils/native/base:utils", - ] + deps = [ "${innerkits_path}/dataobs_manager:dataobs_manager" ] external_deps = [ + "ability_base:base", "ability_base:zuri", + "ability_runtime:abilitykit_native", + "ability_runtime:app_manager", "bundle_framework:appexecfwk_core", + "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "safwk:system_ability_fwk", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] subsystem_name = "aafwk" diff --git a/services/formmgr/BUILD.gn b/services/formmgr/BUILD.gn index e28f0081cc..2ea626ec79 100644 --- a/services/formmgr/BUILD.gn +++ b/services/formmgr/BUILD.gn @@ -18,7 +18,6 @@ config("formmgr_config") { include_dirs = [ "include", "//third_party/json/include", - "//utils/system/safwk/native/include", # "//base/miscservices/time/interfaces/innerkits/include", ] @@ -31,10 +30,7 @@ group("fms_target") { ohos_shared_library("libfms") { include_dirs = [ "${services_path}/common:perm_verification", - "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", - "//foundation/aafwk/standard/interfaces/innerkits/ability_manager/include", - "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk/main/cpp/include", - "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/include/bundlemgr", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "//foundation/aafwk/standard/frameworks/kits/appkit/native/ability_runtime", @@ -75,13 +71,12 @@ ohos_shared_library("libfms") { ] defines = [ - "APP_LOG_TAG = \"FormMgrService\"", - "LOG_DOMAIN = 0xD001120", + "AMS_LOG_TAG = \"FormMgrService\"", + "AMS_LOG_DOMAIN = 0xD001120", ] configs = [ ":formmgr_config", - "//base/miscservices/time/services:time_service_config", "${aafwk_path}/interfaces/innerkits/form_manager:formmgr_sdk_config", ] cflags = [] @@ -90,13 +85,8 @@ ohos_shared_library("libfms") { } deps = [ "${appexecfwk_path}/common:libappexecfwk_common", - "${appexecfwk_path}/libs/libeventhandler:libeventhandler_target", "${services_path}/common:perm_verification", - "//base/miscservices/time/services:time_service", "//foundation/aafwk/standard/frameworks/kits/appkit:app_context", - "//foundation/aafwk/standard/frameworks/kits/wantagent:wantagent_innerkits", - "//foundation/distributeddatamgr/distributeddatamgr/interfaces/innerkits/distributeddata:distributeddata_inner", - "//utils/native/base:utils", # "//third_party/libuuid:libuuid_static", ] @@ -105,11 +95,15 @@ ohos_shared_library("libfms") { "ability_base:base", "ability_base:want", "ability_base:zuri", + "ability_runtime:ability_manager", "ability_runtime:app_manager", + "ability_runtime:wantagent_innerkits", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "ces_standard:cesfwk_core", "ces_standard:cesfwk_innerkits", + "distributeddatamgr:distributeddata_inner", + "eventhandler:libeventhandler", "form_runtime:form_manager", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", @@ -119,6 +113,8 @@ ohos_shared_library("libfms") { "power_manager_native:powermgr_client", "safwk:system_ability_fwk", "samgr_standard:samgr_proxy", + "time_native:time_service", + "utils_base:utils", ] subsystem_name = "aafwk" diff --git a/services/formmgr/include/form_host_record.h b/services/formmgr/include/form_host_record.h index cc4dd8d7a4..af525378d8 100644 --- a/services/formmgr/include/form_host_record.h +++ b/services/formmgr/include/form_host_record.h @@ -19,10 +19,10 @@ #include #include #include -#include "app_log_wrapper.h" #include "form_host_callback.h" #include "form_item_info.h" #include "form_record.h" +#include "hilog_wrapper.h" #include "iremote_object.h" namespace OHOS { diff --git a/services/formmgr/src/form_ability_connection.cpp b/services/formmgr/src/form_ability_connection.cpp index d797ea517a..87823df95b 100644 --- a/services/formmgr/src/form_ability_connection.cpp +++ b/services/formmgr/src/form_ability_connection.cpp @@ -17,10 +17,10 @@ #include #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "form_ability_connection.h" #include "form_supply_callback.h" #include "form_task_mgr.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "message_parcel.h" #include "want.h" @@ -37,14 +37,14 @@ void FormAbilityConnection::OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) { if (resultCode != ERR_OK) { - APP_LOGE("%{public}s, formId:%{public}" PRId64 ", resultCode:%{public}d", + HILOG_ERROR("%{public}s, formId:%{public}" PRId64 ", resultCode:%{public}d", __func__, formId_, resultCode); return; } if (isFreeInstall_) { // Handle free install for form provider app - APP_LOGI("%{public}s current is Free Install.", __func__); + HILOG_INFO("%{public}s current is Free Install.", __func__); } } @@ -55,12 +55,13 @@ void FormAbilityConnection::OnAbilityConnectDone( */ void FormAbilityConnection::OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) { - APP_LOGD("%{public}s, element:%{public}s, resultCode:%{public}d", __func__, element.GetURI().c_str(), resultCode); + HILOG_DEBUG( + "%{public}s, element:%{public}s, resultCode:%{public}d", __func__, element.GetURI().c_str(), resultCode); if (connectId_ != 0) { FormSupplyCallback::GetInstance()->RemoveConnection(connectId_); connectId_ = 0; } else { - APP_LOGE("%{public}s fail, connectId_ invalidate. connectId_: %{public}ld", __func__, connectId_); + HILOG_ERROR("%{public}s fail, connectId_ invalidate. connectId_: %{public}ld", __func__, connectId_); } } @@ -74,7 +75,7 @@ void FormAbilityConnection::OnConnectDied(const wptr &remoteObjec FormSupplyCallback::GetInstance()->RemoveConnection(connectId_); connectId_ = 0; } else { - APP_LOGE("%{public}s fail, connectId_ invalidate. connectId_: %{public}ld", __func__, connectId_); + HILOG_ERROR("%{public}s fail, connectId_ invalidate. connectId_: %{public}ld", __func__, connectId_); } } @@ -84,7 +85,7 @@ void FormAbilityConnection::OnConnectDied(const wptr &remoteObjec */ void FormAbilityConnection::SetConnectId(long connectId) { - APP_LOGI("%{public}s, connectId_: %{public}ld", __func__, connectId); + HILOG_INFO("%{public}s, connectId_: %{public}ld", __func__, connectId); connectId_ = connectId; } diff --git a/services/formmgr/src/form_acquire_connection.cpp b/services/formmgr/src/form_acquire_connection.cpp index a1c7ef6dd9..78be3bbd89 100644 --- a/services/formmgr/src/form_acquire_connection.cpp +++ b/services/formmgr/src/form_acquire_connection.cpp @@ -17,12 +17,12 @@ #include #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "form_acquire_connection.h" #include "form_constants.h" #include "form_supply_callback.h" #include "form_task_mgr.h" #include "form_util.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "message_parcel.h" #include "want.h" @@ -48,10 +48,10 @@ FormAcquireConnection::FormAcquireConnection( void FormAcquireConnection::OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (resultCode != ERR_OK) { - APP_LOGE("%{public}s, abilityName:%{public}s, formId:%{public}" PRId64 ", resultCode:%{public}d", + HILOG_ERROR("%{public}s, abilityName:%{public}s, formId:%{public}" PRId64 ", resultCode:%{public}d", __func__, element.GetAbilityName().c_str(), formId_, resultCode); return; } @@ -66,7 +66,7 @@ void FormAcquireConnection::OnAbilityConnectDone( } want.SetParam(Constants::FORM_CONNECT_ID, this->GetConnectId()); want.SetElementName(info_.GetDeviceId(), info_.GetProviderBundleName(), info_.GetAbilityName()); - APP_LOGI("%{public}s , deviceId: %{public}s, bundleName: %{public}s, abilityName: %{public}s.", + HILOG_INFO("%{public}s , deviceId: %{public}s, bundleName: %{public}s, abilityName: %{public}s.", __func__, info_.GetDeviceId().c_str(), info_.GetProviderBundleName().c_str(), info_.GetAbilityName().c_str()); FormTaskMgr::GetInstance().PostAcquireTask(formId_, want, remoteObject); diff --git a/services/formmgr/src/form_ams_helper.cpp b/services/formmgr/src/form_ams_helper.cpp index 079fadac86..da24ea8366 100644 --- a/services/formmgr/src/form_ams_helper.cpp +++ b/services/formmgr/src/form_ams_helper.cpp @@ -15,8 +15,8 @@ #include "form_ams_helper.h" #include "ability_manager_interface.h" -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" +#include "hilog_wrapper.h" #include "if_system_ability_manager.h" #include "ipc_skeleton.h" #include "iservice_registry.h" @@ -37,15 +37,15 @@ sptr FormAmsHelper::GetAbilityManager() if (abilityManager_ == nullptr) { sptr systemManager = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (systemManager == nullptr) { - APP_LOGE("%{public}s:fail to get registry", __func__); + HILOG_ERROR("%{public}s:fail to get registry", __func__); return nullptr; } sptr remoteObject = systemManager->GetSystemAbility(ABILITY_MGR_SERVICE_ID); if (remoteObject == nullptr) { - APP_LOGE("%{public}s:fail to connect AbilityMgrService", __func__); + HILOG_ERROR("%{public}s:fail to connect AbilityMgrService", __func__); return nullptr; } - APP_LOGD("connect AbilityMgrService success"); + HILOG_DEBUG("connect AbilityMgrService success"); abilityManager_ = iface_cast(remoteObject); } @@ -62,10 +62,10 @@ sptr FormAmsHelper::GetAbilityManager() ErrCode FormAmsHelper::ConnectServiceAbility( const Want &want, const sptr &connect) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); sptr ams = GetAbilityManager(); if (ams == nullptr) { - APP_LOGE("%{public}s:ability service not connect", __func__); + HILOG_ERROR("%{public}s:ability service not connect", __func__); return ERR_APPEXECFWK_FORM_BIND_PROVIDER_FAILED; } return ams->ConnectAbility(want, connect, nullptr); @@ -78,10 +78,10 @@ ErrCode FormAmsHelper::ConnectServiceAbility( */ ErrCode FormAmsHelper::DisConnectServiceAbility(const sptr &connect) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); sptr ams = GetAbilityManager(); if (ams == nullptr) { - APP_LOGE("%{public}s:ability service not connect", __func__); + HILOG_ERROR("%{public}s:ability service not connect", __func__); return ERR_APPEXECFWK_FORM_BIND_PROVIDER_FAILED; } return ams->DisconnectAbility(connect); @@ -95,7 +95,7 @@ ErrCode FormAmsHelper::DisConnectServiceAbility(const sptr &connect) { if (eventHandler_ == nullptr) { - APP_LOGE("%{public}s fail, eventhandler invalidate", __func__); + HILOG_ERROR("%{public}s fail, eventhandler invalidate", __func__); return ERR_INVALID_OPERATION; } std::function disConnectAbilityFunc = std::bind( @@ -103,7 +103,7 @@ ErrCode FormAmsHelper::DisConnectServiceAbilityDelay(const sptrPostTask(disConnectAbilityFunc, FORM_DISCONNECT_DELAY_TIME)) { - APP_LOGE("%{public}s, failed to disconnect ability", __func__); + HILOG_ERROR("%{public}s, failed to disconnect ability", __func__); return ERR_APPEXECFWK_FORM_BIND_PROVIDER_FAILED; } return ERR_OK; @@ -126,7 +126,7 @@ void FormAmsHelper::DisConnectAbilityTask(const sptr { sptr ams = GetAbilityManager(); if (ams == nullptr) { - APP_LOGE("%{public}s, ability service not connect", __func__); + HILOG_ERROR("%{public}s, ability service not connect", __func__); return; } ams->DisconnectAbility(connect); diff --git a/services/formmgr/src/form_batch_delete_connection.cpp b/services/formmgr/src/form_batch_delete_connection.cpp index b5c090ba3f..735589847d 100644 --- a/services/formmgr/src/form_batch_delete_connection.cpp +++ b/services/formmgr/src/form_batch_delete_connection.cpp @@ -15,12 +15,12 @@ */ #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "form_batch_delete_connection.h" #include "form_constants.h" #include "form_supply_callback.h" #include "form_task_mgr.h" #include "form_util.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "message_parcel.h" #include "want.h" @@ -42,9 +42,9 @@ FormBatchDeleteConnection::FormBatchDeleteConnection(const std::set &fo void FormBatchDeleteConnection::OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (resultCode != ERR_OK) { - APP_LOGE("%{public}s, abilityName:%{public}s, resultCode:%{public}d", + HILOG_ERROR("%{public}s, abilityName:%{public}s, resultCode:%{public}d", __func__, element.GetAbilityName().c_str(), resultCode); return; } diff --git a/services/formmgr/src/form_bms_helper.cpp b/services/formmgr/src/form_bms_helper.cpp index c0c3101b95..95e5082f0a 100644 --- a/services/formmgr/src/form_bms_helper.cpp +++ b/services/formmgr/src/form_bms_helper.cpp @@ -15,8 +15,8 @@ #include "form_bms_helper.h" #include "ability_manager_interface.h" -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" +#include "hilog_wrapper.h" #include "if_system_ability_manager.h" #include "ipc_skeleton.h" #include "iservice_registry.h" @@ -36,20 +36,20 @@ FormBmsHelper::~FormBmsHelper() */ sptr FormBmsHelper::GetBundleMgr() { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (iBundleMgr_ == nullptr) { sptr systemAbilityManager = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); auto remoteObject = systemAbilityManager->GetSystemAbility(BUNDLE_MGR_SERVICE_SYS_ABILITY_ID); if (remoteObject == nullptr) { - APP_LOGE("%{public}s error, failed to get bundle manager service.", __func__); + HILOG_ERROR("%{public}s error, failed to get bundle manager service.", __func__); return nullptr; } iBundleMgr_ = iface_cast(remoteObject); if (iBundleMgr_ == nullptr) { - APP_LOGE("%{public}s error, failed to get bundle manager service", __func__); + HILOG_ERROR("%{public}s error, failed to get bundle manager service", __func__); return nullptr; } } @@ -62,7 +62,7 @@ sptr FormBmsHelper::GetBundleMgr() */ void FormBmsHelper::SetBundleManager(const sptr &bundleManager) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); iBundleMgr_ = bundleManager; } @@ -73,17 +73,17 @@ void FormBmsHelper::SetBundleManager(const sptr &bundleManager) */ void FormBmsHelper::NotifyModuleRemovable(const std::string &bundleName, const std::string &moduleName) { - APP_LOGI("%{public}s, bundleName:%{public}s, moduleName:%{public}s", + HILOG_INFO("%{public}s, bundleName:%{public}s, moduleName:%{public}s", __func__, bundleName.c_str(), moduleName.c_str()); if (bundleName.empty() || moduleName.empty()) { return; } std::string key = GenerateModuleKey(bundleName, moduleName); - APP_LOGI("%{public}s, begin to notify %{public}s removable", __func__, key.c_str()); + HILOG_INFO("%{public}s, begin to notify %{public}s removable", __func__, key.c_str()); sptr iBundleMgr = GetBundleMgr(); if (iBundleMgr == nullptr) { - APP_LOGE("%{public}s, failed to get IBundleMgr.", __func__); + HILOG_ERROR("%{public}s, failed to get IBundleMgr.", __func__); return; } @@ -99,7 +99,7 @@ void FormBmsHelper::NotifyModuleRemovable(const std::string &bundleName, const s void FormBmsHelper::NotifyModuleNotRemovable(const std::string &bundleName, const std::string &moduleName) const { std::string key = GenerateModuleKey(bundleName, moduleName); - APP_LOGI("%{public}s, begin to notify %{public}s not removable", __func__, key.c_str()); + HILOG_INFO("%{public}s, begin to notify %{public}s not removable", __func__, key.c_str()); } std::string FormBmsHelper::GenerateModuleKey(const std::string &bundleName, const std::string &moduleName) const diff --git a/services/formmgr/src/form_cache_mgr.cpp b/services/formmgr/src/form_cache_mgr.cpp index 873decdb6a..428748abe2 100644 --- a/services/formmgr/src/form_cache_mgr.cpp +++ b/services/formmgr/src/form_cache_mgr.cpp @@ -13,18 +13,18 @@ * limitations under the License. */ -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "form_cache_mgr.h" namespace OHOS { namespace AppExecFwk { FormCacheMgr::FormCacheMgr() { - APP_LOGI("create form cache manager instance"); + HILOG_INFO("create form cache manager instance"); } FormCacheMgr::~FormCacheMgr() { - APP_LOGI("destroy form cache manager instance"); + HILOG_INFO("destroy form cache manager instance"); } /** @@ -35,15 +35,15 @@ FormCacheMgr::~FormCacheMgr() */ bool FormCacheMgr::GetData(const int64_t formId, std::string &data) const { - APP_LOGI("get cache data"); + HILOG_INFO("get cache data"); std::lock_guard lock(cacheMutex_); if (cacheData_.empty()) { - APP_LOGE("form cache is empty"); + HILOG_ERROR("form cache is empty"); return false; } auto formData = cacheData_.find(formId); if (formData == cacheData_.end()) { - APP_LOGE("cache data not find"); + HILOG_ERROR("cache data not find"); return false; } @@ -60,7 +60,7 @@ bool FormCacheMgr::GetData(const int64_t formId, std::string &data) const */ bool FormCacheMgr::AddData(const int64_t formId, const std::string &data) { - APP_LOGI("add new cache data"); + HILOG_INFO("add new cache data"); std::lock_guard lock(cacheMutex_); cacheData_[formId] = data; return true; @@ -73,11 +73,11 @@ bool FormCacheMgr::AddData(const int64_t formId, const std::string &data) */ bool FormCacheMgr::DeleteData(const int64_t formId) { - APP_LOGI("delete cache data"); + HILOG_INFO("delete cache data"); std::lock_guard lock(cacheMutex_); auto formData = cacheData_.find(formId); if (formData == cacheData_.end()) { - APP_LOGW("cache data is not exist"); + HILOG_WARN("cache data is not exist"); return true; } @@ -92,11 +92,11 @@ bool FormCacheMgr::DeleteData(const int64_t formId) */ bool FormCacheMgr::UpdateData(const int64_t formId, const std::string &data) { - APP_LOGI("update cache data"); + HILOG_INFO("update cache data"); std::lock_guard lock(cacheMutex_); auto formData = cacheData_.find(formId); if (formData == cacheData_.end()) { - APP_LOGE("cache data is not exist"); + HILOG_ERROR("cache data is not exist"); return false; } @@ -110,15 +110,15 @@ bool FormCacheMgr::UpdateData(const int64_t formId, const std::string &data) */ bool FormCacheMgr::IsExist(const int64_t formId) const { - APP_LOGI("get cache data"); + HILOG_INFO("get cache data"); std::lock_guard lock(cacheMutex_); if (cacheData_.empty()) { - APP_LOGE("form cache is empty"); + HILOG_ERROR("form cache is empty"); return false; } auto formData = cacheData_.find(formId); if (formData == cacheData_.end()) { - APP_LOGE("cache data not find"); + HILOG_ERROR("cache data not find"); return false; } diff --git a/services/formmgr/src/form_cast_temp_connection.cpp b/services/formmgr/src/form_cast_temp_connection.cpp index 20e4db2c60..b08cf6486b 100644 --- a/services/formmgr/src/form_cast_temp_connection.cpp +++ b/services/formmgr/src/form_cast_temp_connection.cpp @@ -17,11 +17,11 @@ #include #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "form_cast_temp_connection.h" #include "form_constants.h" #include "form_supply_callback.h" #include "form_task_mgr.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "message_parcel.h" @@ -42,9 +42,9 @@ FormCastTempConnection::FormCastTempConnection(const int64_t formId, const std:: void FormCastTempConnection::OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (resultCode != ERR_OK) { - APP_LOGE("%{public}s, abilityName:%{public}s, formId:%{public}" PRId64 ", resultCode:%{public}d", + HILOG_ERROR("%{public}s, abilityName:%{public}s, formId:%{public}" PRId64 ", resultCode:%{public}d", __func__, element.GetAbilityName().c_str(), formId_, resultCode); return; } diff --git a/services/formmgr/src/form_data_mgr.cpp b/services/formmgr/src/form_data_mgr.cpp index bcadf972f7..64fa341a4e 100644 --- a/services/formmgr/src/form_data_mgr.cpp +++ b/services/formmgr/src/form_data_mgr.cpp @@ -16,12 +16,12 @@ #include #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "form_cache_mgr.h" #include "form_constants.h" #include "form_data_mgr.h" #include "form_provider_mgr.h" #include "form_util.h" +#include "hilog_wrapper.h" #include "ipc_skeleton.h" @@ -29,12 +29,12 @@ namespace OHOS { namespace AppExecFwk { FormDataMgr::FormDataMgr() { - APP_LOGI("create form data manager instance"); + HILOG_INFO("create form data manager instance"); udidHash_ = 0L; } FormDataMgr::~FormDataMgr() { - APP_LOGI("destroy form data manager instance"); + HILOG_INFO("destroy form data manager instance"); } /** @@ -46,7 +46,7 @@ FormDataMgr::~FormDataMgr() */ FormRecord FormDataMgr::AllotFormRecord(const FormItemInfo &formInfo, const int callingUid, const int32_t userId) { - APP_LOGI("%{public}s, allot form info", __func__); + HILOG_INFO("%{public}s, allot form info", __func__); if (formInfo.IsTemporaryForm() && !ExistTempForm(formInfo.GetFormId())) { std::lock_guard lock(formTempMutex_); tempForms_.emplace_back(formInfo.GetFormId()); @@ -55,13 +55,13 @@ FormRecord FormDataMgr::AllotFormRecord(const FormItemInfo &formInfo, const int { std::lock_guard lock(formRecordMutex_); if (formRecords_.empty()) { // formRecords_ is empty, create a new one - APP_LOGD("%{public}s, form info not exist", __func__); + HILOG_DEBUG("%{public}s, form info not exist", __func__); record = CreateFormRecord(formInfo, callingUid, userId); formRecords_.emplace(formInfo.GetFormId(), record); } else { auto info = formRecords_.find(formInfo.GetFormId()); if (info == formRecords_.end()) { - APP_LOGD("%{public}s, form info not find", __func__); + HILOG_DEBUG("%{public}s, form info not find", __func__); record = CreateFormRecord(formInfo, callingUid, userId); formRecords_.emplace(formInfo.GetFormId(), record); } else { @@ -69,7 +69,7 @@ FormRecord FormDataMgr::AllotFormRecord(const FormItemInfo &formInfo, const int } } } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return record; } /** @@ -79,11 +79,11 @@ FormRecord FormDataMgr::AllotFormRecord(const FormItemInfo &formInfo, const int */ bool FormDataMgr::DeleteFormRecord(const int64_t formId) { - APP_LOGI("%{public}s, delete form info", __func__); + HILOG_INFO("%{public}s, delete form info", __func__); std::lock_guard lock(formRecordMutex_); auto iter = formRecords_.find(formId); if (iter == formRecords_.end()) { - APP_LOGE("%{public}s, form info is not exist", __func__); + HILOG_ERROR("%{public}s, form info is not exist", __func__); return true; } formRecords_.erase(iter); @@ -101,12 +101,12 @@ bool FormDataMgr::DeleteFormRecord(const int64_t formId) bool FormDataMgr::AllotFormHostRecord(const FormItemInfo &info, const sptr &callerToken, const int64_t formId, const int callingUid) { - APP_LOGI("%{public}s, allot form Host info", __func__); + HILOG_INFO("%{public}s, allot form Host info", __func__); std::lock_guard lock(formHostRecordMutex_); for (auto &record : clientRecords_) { if (callerToken == record.GetClientStub()) { record.AddForm(formId); - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return true; } } @@ -115,10 +115,10 @@ bool FormDataMgr::AllotFormHostRecord(const FormItemInfo &info, const sptr= Constants::MAX_TEMP_FORMS) { - APP_LOGW("%{public}s, already exist %{public}d temp forms in system", __func__, Constants::MAX_TEMP_FORMS); + HILOG_WARN("%{public}s, already exist %{public}d temp forms in system", __func__, Constants::MAX_TEMP_FORMS); return ERR_APPEXECFWK_FORM_MAX_SYSTEM_TEMP_FORMS; } return ERR_OK; @@ -225,7 +225,7 @@ int FormDataMgr::CheckTempEnoughForm() const */ int FormDataMgr::CheckEnoughForm(const int callingUid, const int32_t currentUserId) const { - APP_LOGI("%{public}s, callingUid: %{public}d, current userId: %{public}d", __func__, callingUid, currentUserId); + HILOG_INFO("%{public}s, callingUid: %{public}d, current userId: %{public}d", __func__, callingUid, currentUserId); int formsInSystem = 0; int callingUidFormCounts = 0; @@ -233,13 +233,13 @@ int FormDataMgr::CheckEnoughForm(const int callingUid, const int32_t currentUser FormRecord record = recordPair.second; if ((record.userId == currentUserId) && !record.formTempFlg) { if (++formsInSystem >= Constants::MAX_FORMS) { - APP_LOGW("%{public}s, already exist %{public}d forms in system", __func__, Constants::MAX_FORMS); + HILOG_WARN("%{public}s, already exist %{public}d forms in system", __func__, Constants::MAX_FORMS); return ERR_APPEXECFWK_FORM_MAX_SYSTEM_FORMS; } for (auto &userUid : record.formUserUids) { if (userUid == callingUid) { if (++callingUidFormCounts >= Constants::MAX_RECORD_PER_APP) { - APP_LOGW("%{public}s, already use %{public}d forms", __func__, Constants::MAX_RECORD_PER_APP); + HILOG_WARN("%{public}s, already use %{public}d forms", __func__, Constants::MAX_RECORD_PER_APP); return ERR_APPEXECFWK_FORM_MAX_FORMS_PER_CLIENT; } break; @@ -259,7 +259,7 @@ bool FormDataMgr::DeleteTempForm(const int64_t formId) std::lock_guard lock(formTempMutex_); auto iter = std::find(tempForms_.begin(), tempForms_.end(), formId); if (iter == tempForms_.end()) { - APP_LOGE("%{public}s, temp form is not exist", __func__); + HILOG_ERROR("%{public}s, temp form is not exist", __func__); return false; } tempForms_.erase(iter); @@ -298,10 +298,10 @@ bool FormDataMgr::IsCallingUidValid(const std::vector &formUserUids) const */ bool FormDataMgr::ModifyFormTempFlg(const int64_t formId, const bool formTempFlg) { - APP_LOGI("%{public}s, modify form temp flag by formId", __func__); + HILOG_INFO("%{public}s, modify form temp flag by formId", __func__); std::lock_guard lock(formRecordMutex_); if (!ExistFormRecord(formId)) { - APP_LOGE("%{public}s, form info is not exist", __func__); + HILOG_ERROR("%{public}s, form info is not exist", __func__); return false; } formRecords_[formId].formTempFlg = formTempFlg; @@ -315,10 +315,10 @@ bool FormDataMgr::ModifyFormTempFlg(const int64_t formId, const bool formTempFlg */ bool FormDataMgr::AddFormUserUid(const int64_t formId, const int formUserUid) { - APP_LOGI("%{public}s, add form user uid by formId", __func__); + HILOG_INFO("%{public}s, add form user uid by formId", __func__); std::lock_guard lock(formRecordMutex_); if (!ExistFormRecord(formId)) { - APP_LOGE("%{public}s, form info is not exist", __func__); + HILOG_ERROR("%{public}s, form info is not exist", __func__); return false; } if (std::find(formRecords_[formId].formUserUids.begin(), formRecords_[formId].formUserUids.end(), @@ -335,7 +335,7 @@ bool FormDataMgr::AddFormUserUid(const int64_t formId, const int formUserUid) */ bool FormDataMgr::DeleteFormUserUid(const int64_t formId, const int uid) { - APP_LOGI("%{public}s, delete form user uid from form record", __func__); + HILOG_INFO("%{public}s, delete form user uid from form record", __func__); std::lock_guard lock(formRecordMutex_); if (ExistFormRecord(formId)) { auto iter = std::find(formRecords_.at(formId).formUserUids.begin(), @@ -345,7 +345,7 @@ bool FormDataMgr::DeleteFormUserUid(const int64_t formId, const int uid) } return true; } else { - APP_LOGE("%{public}s, form info not find", __func__); + HILOG_ERROR("%{public}s, form info not find", __func__); return false; } } @@ -357,7 +357,7 @@ bool FormDataMgr::DeleteFormUserUid(const int64_t formId, const int uid) */ bool FormDataMgr::UpdateFormRecord(const int64_t formId, const FormRecord &formRecord) { - APP_LOGI("%{public}s, get form record by formId", __func__); + HILOG_INFO("%{public}s, get form record by formId", __func__); std::lock_guard lock(formRecordMutex_); auto info = formRecords_.find(formId); if (info != formRecords_.end()) { @@ -374,16 +374,16 @@ bool FormDataMgr::UpdateFormRecord(const int64_t formId, const FormRecord &formR */ bool FormDataMgr::GetFormRecord(const int64_t formId, FormRecord &formRecord) const { - APP_LOGI("%{public}s, get form record by formId", __func__); + HILOG_INFO("%{public}s, get form record by formId", __func__); std::lock_guard lock(formRecordMutex_); auto info = formRecords_.find(formId); if (info == formRecords_.end()) { - APP_LOGE("%{public}s, form info not find", __func__); + HILOG_ERROR("%{public}s, form info not find", __func__); return false; } formRecord = info->second; - APP_LOGI("%{public}s, get form record successfully", __func__); + HILOG_INFO("%{public}s, get form record successfully", __func__); return true; } /** @@ -394,7 +394,7 @@ bool FormDataMgr::GetFormRecord(const int64_t formId, FormRecord &formRecord) co */ bool FormDataMgr::GetFormRecord(const std::string &bundleName, std::vector &formInfos) { - APP_LOGI("%{public}s, get form record by bundleName", __func__); + HILOG_INFO("%{public}s, get form record by bundleName", __func__); std::lock_guard lock(formRecordMutex_); std::map::iterator itFormRecord; for (itFormRecord = formRecords_.begin(); itFormRecord != formRecords_.end(); itFormRecord++) { @@ -405,7 +405,7 @@ bool FormDataMgr::GetFormRecord(const std::string &bundleName, std::vector 0) { return true; } else { - APP_LOGI("%{public}s, form info not find", __func__); + HILOG_INFO("%{public}s, form info not find", __func__); return false; } } @@ -416,7 +416,7 @@ bool FormDataMgr::GetFormRecord(const std::string &bundleName, std::vector 0); } /** @@ -426,7 +426,7 @@ bool FormDataMgr::ExistFormRecord(const int64_t formId) const */ bool FormDataMgr::HasFormUserUids(const int64_t formId) const { - APP_LOGI("%{public}s, check form has user uids", __func__); + HILOG_INFO("%{public}s, check form has user uids", __func__); FormRecord record; if (GetFormRecord(formId, record)) { return record.formUserUids.empty() ? false : true; @@ -441,7 +441,7 @@ bool FormDataMgr::HasFormUserUids(const int64_t formId) const */ bool FormDataMgr::GetFormHostRecord(const int64_t formId, FormHostRecord &formHostRecord) const { - APP_LOGI("%{public}s, get form host record by formId", __func__); + HILOG_INFO("%{public}s, get form host record by formId", __func__); std::lock_guard lock(formHostRecordMutex_); for (auto &record : clientRecords_) { if (record.Contains(formId)) { @@ -450,7 +450,7 @@ bool FormDataMgr::GetFormHostRecord(const int64_t formId, FormHostRecord &formHo } } - APP_LOGE("%{public}s, form host record not find", __func__); + HILOG_ERROR("%{public}s, form host record not find", __func__); return false; } /** @@ -461,7 +461,7 @@ bool FormDataMgr::GetFormHostRecord(const int64_t formId, FormHostRecord &formHo */ bool FormDataMgr::DeleteHostRecord(const sptr &callerToken, const int64_t formId) { - APP_LOGI("%{public}s start, delete form host record", __func__); + HILOG_INFO("%{public}s start, delete form host record", __func__); std::lock_guard lock(formHostRecordMutex_); std::vector::iterator iter; for (iter = clientRecords_.begin(); iter != clientRecords_.end(); ++iter) { @@ -474,7 +474,7 @@ bool FormDataMgr::DeleteHostRecord(const sptr &callerToken, const break; } } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return true; } /** @@ -483,7 +483,7 @@ bool FormDataMgr::DeleteHostRecord(const sptr &callerToken, const */ void FormDataMgr::CleanHostRemovedForms(const std::vector &removedFormIds) { - APP_LOGI("%{public}s start, delete form host record by formId list", __func__); + HILOG_INFO("%{public}s start, delete form host record by formId list", __func__); std::vector matchedIds; std::lock_guard lock(formHostRecordMutex_); std::vector::iterator itHostRecord; @@ -495,12 +495,12 @@ void FormDataMgr::CleanHostRemovedForms(const std::vector &removedFormI } } if (!matchedIds.empty()) { - APP_LOGI("%{public}s, OnFormUninstalled called", __func__); + HILOG_INFO("%{public}s, OnFormUninstalled called", __func__); itHostRecord->OnFormUninstalled(matchedIds); } } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** * @brief Handle form host died. @@ -515,7 +515,7 @@ void FormDataMgr::HandleHostDied(const sptr &remoteHost) for (itHostRecord = clientRecords_.begin(); itHostRecord != clientRecords_.end();) { if (remoteHost == itHostRecord->GetClientStub()) { HandleHostDiedForTempForms(*itHostRecord, recordTempForms); - APP_LOGI("find died client, remove it"); + HILOG_INFO("find died client, remove it"); itHostRecord->CleanResource(); itHostRecord = clientRecords_.erase(itHostRecord); break; @@ -584,7 +584,7 @@ int64_t FormDataMgr::GenerateFormId() { // generate udidHash_ if (udidHash_ < 0) { - APP_LOGE("%{public}s fail, generateFormId no invalid udidHash_", __func__); + HILOG_ERROR("%{public}s fail, generateFormId no invalid udidHash_", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } return FormUtil::GenerateFormId(udidHash_); @@ -601,7 +601,7 @@ bool FormDataMgr::GenerateUdidHash() bool bGenUdid = FormUtil::GenerateUdidHash(udidHash_); if (!bGenUdid) { - APP_LOGE("%{public}s, Failed to generate udid.", __func__); + HILOG_ERROR("%{public}s, Failed to generate udid.", __func__); return false; } @@ -633,7 +633,7 @@ void FormDataMgr::SetUdidHash(const int64_t udidHash) */ bool FormDataMgr::GetMatchedHostClient(const sptr &callerToken, FormHostRecord &formHostRecord) const { - APP_LOGI("%{public}s, get the matched form host record by client stub.", __func__); + HILOG_INFO("%{public}s, get the matched form host record by client stub.", __func__); std::lock_guard lock(formHostRecordMutex_); for (const FormHostRecord &record : clientRecords_) { if (callerToken == record.GetClientStub()) { @@ -642,7 +642,7 @@ bool FormDataMgr::GetMatchedHostClient(const sptr &callerToken, F } } - APP_LOGE("%{public}s, form host record not find.", __func__); + HILOG_ERROR("%{public}s, form host record not find.", __func__); return false; } @@ -656,7 +656,7 @@ void FormDataMgr::SetNeedRefresh(const int64_t formId, const bool needRefresh) std::lock_guard lock(formRecordMutex_); auto itFormRecord = formRecords_.find(formId); if (itFormRecord == formRecords_.end()) { - APP_LOGE("%{public}s, form info not find", __func__); + HILOG_ERROR("%{public}s, form info not find", __func__); return; } itFormRecord->second.needRefresh = needRefresh; @@ -672,7 +672,7 @@ void FormDataMgr::SetCountTimerRefresh(const int64_t formId, const bool countTim std::lock_guard lock(formRecordMutex_); auto itFormRecord = formRecords_.find(formId); if (itFormRecord == formRecords_.end()) { - APP_LOGE("%{public}s, form info not find", __func__); + HILOG_ERROR("%{public}s, form info not find", __func__); return; } itFormRecord->second.isCountTimerRefresh = countTimerRefresh; @@ -691,14 +691,14 @@ bool FormDataMgr::GetUpdatedForm( FormInfo &updatedForm) { if (targetForms.empty()) { - APP_LOGE("%{public}s error, targetForms is empty.", __func__); + HILOG_ERROR("%{public}s error, targetForms is empty.", __func__); return false; } for (const FormInfo &item : targetForms) { if (IsSameForm(record, item)) { updatedForm = item; - APP_LOGD("%{public}s, find matched form.", __func__); + HILOG_DEBUG("%{public}s, find matched form.", __func__); return true; } } @@ -714,7 +714,7 @@ void FormDataMgr::SetEnableUpdate(const int64_t formId, const bool enableUpdate) std::lock_guard lock(formRecordMutex_); auto itFormRecord = formRecords_.find(formId); if (itFormRecord == formRecords_.end()) { - APP_LOGE("%{public}s, form info not find", __func__); + HILOG_ERROR("%{public}s, form info not find", __func__); return; } itFormRecord->second.isEnableUpdate = enableUpdate; @@ -737,7 +737,7 @@ void FormDataMgr::SetUpdateInfo( std::lock_guard lock(formRecordMutex_); auto itFormRecord = formRecords_.find(formId); if (itFormRecord == formRecords_.end()) { - APP_LOGE("%{public}s, form info not find", __func__); + HILOG_ERROR("%{public}s, form info not find", __func__); return; } @@ -771,7 +771,7 @@ bool FormDataMgr::IsSameForm(const FormRecord &record, const FormInfo &formInfo) */ void FormDataMgr::CleanRemovedFormRecords(const std::string &bundleName, std::set &removedForms) { - APP_LOGI("%{public}s, clean removed form records", __func__); + HILOG_INFO("%{public}s, clean removed form records", __func__); std::lock_guard lock(formRecordMutex_); std::map::iterator itFormRecord; for (itFormRecord = formRecords_.begin(); itFormRecord != formRecords_.end();) { @@ -790,7 +790,7 @@ void FormDataMgr::CleanRemovedFormRecords(const std::string &bundleName, std::se */ void FormDataMgr::CleanRemovedTempFormRecords(const std::string &bundleName, std::set &removedForms) { - APP_LOGI("%{public}s, clean removed form records", __func__); + HILOG_INFO("%{public}s, clean removed form records", __func__); std::set removedTempForms; { std::lock_guard lock(formRecordMutex_); @@ -842,7 +842,7 @@ void FormDataMgr::SetFormCacheInited(const int64_t formId, bool isInited) std::lock_guard lock(formRecordMutex_); auto itFormRecord = formRecords_.find(formId); if (itFormRecord == formRecords_.end()) { - APP_LOGE("%{public}s, form info not find", __func__); + HILOG_ERROR("%{public}s, form info not find", __func__); return; } itFormRecord->second.isInited = isInited; @@ -858,7 +858,7 @@ void FormDataMgr::SetVersionUpgrade(const int64_t formId, const bool versionUpgr std::lock_guard lock(formRecordMutex_); auto itFormRecord = formRecords_.find(formId); if (itFormRecord == formRecords_.end()) { - APP_LOGE("%{public}s, form info not find", __func__); + HILOG_ERROR("%{public}s, form info not find", __func__); return; } itFormRecord->second.versionUpgrade = versionUpgrade; @@ -889,7 +889,7 @@ void FormDataMgr::UpdateFormProviderInfo(const int64_t formId, const FormProvide std::lock_guard lock(formRecordMutex_); auto itFormRecord = formRecords_.find(formId); if (itFormRecord == formRecords_.end()) { - APP_LOGE("%{public}s, form info not find", __func__); + HILOG_ERROR("%{public}s, form info not find", __func__); return; } itFormRecord->second.formProviderInfo = formProviderInfo; @@ -907,7 +907,7 @@ bool FormDataMgr::UpdateHostForm(const int64_t formId, const FormRecord &formRec std::vector::iterator itHostRecord; for (itHostRecord = clientRecords_.begin(); itHostRecord != clientRecords_.end(); itHostRecord++) { bool enableRefresh = itHostRecord->IsEnableRefresh(formId); - APP_LOGI("formId:%{public}" PRId64 " enableRefresh:%{public}d", formId, enableRefresh); + HILOG_INFO("formId:%{public}" PRId64 " enableRefresh:%{public}d", formId, enableRefresh); if (enableRefresh) { // update form itHostRecord->OnUpdate(formId, formRecord); @@ -932,20 +932,20 @@ int32_t FormDataMgr::UpdateHostFormFlag( const bool flag, std::vector &refreshForms) { - APP_LOGI("%{public}s start, flag: %{public}d", __func__, flag); + HILOG_INFO("%{public}s start, flag: %{public}d", __func__, flag); std::lock_guard lock(formHostRecordMutex_); std::vector::iterator itHostRecord; for (itHostRecord = clientRecords_.begin(); itHostRecord != clientRecords_.end(); itHostRecord++) { if (callerToken == itHostRecord->GetClientStub()) { for (const int64_t formId : formIds) { if (formId <= 0) { - APP_LOGW("%{public}s, formId %{public}" PRId64 " is less than 0", __func__, formId); + HILOG_WARN("%{public}s, formId %{public}" PRId64 " is less than 0", __func__, formId); continue; } int64_t matchedFormId = FindMatchedFormId(formId); if (!itHostRecord->Contains(matchedFormId)) { - APP_LOGW("%{public}s, form %{public}d is not owned by this client, don't need to update flag", + HILOG_WARN("%{public}s, form %{public}d is not owned by this client, don't need to update flag", __func__, (int32_t)formId); continue; } @@ -953,42 +953,42 @@ int32_t FormDataMgr::UpdateHostFormFlag( itHostRecord->SetEnableRefresh(matchedFormId, flag); // set disable if (!flag) { - APP_LOGI("%{public}s, flag is disable", __func__); + HILOG_INFO("%{public}s, flag is disable", __func__); continue; } FormRecord formRecord; if (GetFormRecord(matchedFormId, formRecord)) { if (formRecord.needRefresh) { - APP_LOGI("%{public}s, formRecord need refresh", __func__); + HILOG_INFO("%{public}s, formRecord need refresh", __func__); refreshForms.emplace_back(matchedFormId); continue; } } else { - APP_LOGW("%{public}s, not exist such form:%{public}" PRId64 "", __func__, matchedFormId); + HILOG_WARN("%{public}s, not exist such form:%{public}" PRId64 "", __func__, matchedFormId); continue; } // if set enable flag, should check whether to refresh form if (!itHostRecord->IsNeedRefresh(matchedFormId)) { - APP_LOGI("%{public}s, host need not refresh", __func__); + HILOG_INFO("%{public}s, host need not refresh", __func__); continue; } if (IsFormCached(formRecord)) { - APP_LOGI("%{public}s, form cached", __func__); + HILOG_INFO("%{public}s, form cached", __func__); itHostRecord->OnUpdate(matchedFormId, formRecord); itHostRecord->SetNeedRefresh(matchedFormId, false); } else { - APP_LOGI("%{public}s, form no cache", __func__); + HILOG_INFO("%{public}s, form no cache", __func__); refreshForms.emplace_back(matchedFormId); continue; } } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return ERR_OK; } } - APP_LOGE("%{public}s, can't find target client", __func__); + HILOG_ERROR("%{public}s, can't find target client", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } /** @@ -1095,7 +1095,7 @@ void FormDataMgr::ParseUpdateConfig(FormRecord &record, const FormItemInfo &info */ void FormDataMgr::ParseIntervalConfig(FormRecord &record, const int configDuration) const { - APP_LOGI("%{public}s, configDuration:%{public}d", __func__, configDuration); + HILOG_INFO("%{public}s, configDuration:%{public}d", __func__, configDuration); if (configDuration <= Constants::MIN_CONFIG_DURATION) { record.updateDuration = Constants::MIN_PERIOD; } else if (configDuration >= Constants::MAX_CONFIG_DURATION) { @@ -1103,7 +1103,7 @@ void FormDataMgr::ParseIntervalConfig(FormRecord &record, const int configDurati } else { record.updateDuration = configDuration * Constants::TIME_CONVERSION; } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** @@ -1116,14 +1116,14 @@ void FormDataMgr::ParseAtTimerConfig(FormRecord &record, const FormItemInfo &inf record.isEnableUpdate = false; record.updateDuration = 0; std::string configAtTime = info.GetScheduledUpdateTime(); - APP_LOGI("%{public}s, parseAsUpdateAt updateAt:%{public}s", __func__, configAtTime.c_str()); + HILOG_INFO("%{public}s, parseAsUpdateAt updateAt:%{public}s", __func__, configAtTime.c_str()); if (configAtTime.empty()) { return; } std::vector temp = FormUtil::StringSplit(configAtTime, Constants::TIME_DELIMETER); if (temp.size() != Constants::UPDATE_AT_CONFIG_COUNT) { - APP_LOGE("%{public}s, invalid config", __func__); + HILOG_ERROR("%{public}s, invalid config", __func__); return; } int hour = -1; @@ -1132,7 +1132,7 @@ void FormDataMgr::ParseAtTimerConfig(FormRecord &record, const FormItemInfo &inf min = std::stoi(temp[1]); if (hour < Constants::MIN_TIME || hour > Constants::MAX_HOUR || min < Constants::MIN_TIME || min > Constants::MAX_MININUTE) { - APP_LOGE("%{public}s, time is invalid", __func__); + HILOG_ERROR("%{public}s, time is invalid", __func__); return; } record.updateAtHour = hour; @@ -1161,7 +1161,7 @@ bool FormDataMgr::IsFormCached(const FormRecord record) */ void FormDataMgr::DeleteFormsByUserId(const int32_t userId, std::vector &removedFormIds) { - APP_LOGI("%{public}s, delete forms by userId", __func__); + HILOG_INFO("%{public}s, delete forms by userId", __func__); // handle formRecords_ std::vector removedTempForms; diff --git a/services/formmgr/src/form_db_cache.cpp b/services/formmgr/src/form_db_cache.cpp index 0888c12ab6..e18f977ded 100644 --- a/services/formmgr/src/form_db_cache.cpp +++ b/services/formmgr/src/form_db_cache.cpp @@ -15,24 +15,24 @@ #include -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" #include "form_bms_helper.h" #include "form_db_cache.h" #include "form_db_info.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { FormDbCache::FormDbCache() { - APP_LOGI("FormDbCache is created"); + HILOG_INFO("FormDbCache is created"); dataStorage_ = std::make_shared(); formDBInfos_.clear(); } FormDbCache::~FormDbCache() { - APP_LOGI("FormDbCache is destroyed"); + HILOG_INFO("FormDbCache is destroyed"); } /** @@ -41,12 +41,12 @@ FormDbCache::~FormDbCache() */ void FormDbCache::Start() { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::lock_guard lock(formDBInfosMutex_); std::vector innerFormInfos; innerFormInfos.clear(); if (dataStorage_->LoadFormData(innerFormInfos) != ERR_OK) { - APP_LOGE("%{public}s, LoadFormData failed.", __func__); + HILOG_ERROR("%{public}s, LoadFormData failed.", __func__); return; } @@ -63,17 +63,17 @@ void FormDbCache::Start() */ ErrCode FormDbCache::SaveFormInfo(const FormDBInfo &formDBInfo) { - APP_LOGI("%{public}s called, formId:%{public}" PRId64 "", __func__, formDBInfo.formId); + HILOG_INFO("%{public}s called, formId:%{public}" PRId64 "", __func__, formDBInfo.formId); std::lock_guard lock(formDBInfosMutex_); auto iter = find(formDBInfos_.begin(), formDBInfos_.end(), formDBInfo); if (iter != formDBInfos_.end()) { if (iter->Compare(formDBInfo) == false) { - APP_LOGW("%{public}s, need update, formId[%{public}" PRId64 "].", __func__, formDBInfo.formId); + HILOG_WARN("%{public}s, need update, formId[%{public}" PRId64 "].", __func__, formDBInfo.formId); *iter = formDBInfo; InnerFormInfo innerFormInfo(formDBInfo); return dataStorage_->ModifyStorageFormInfo(innerFormInfo); } else { - APP_LOGW("%{public}s, already exist, formId[%{public}" PRId64 "].", __func__, formDBInfo.formId); + HILOG_WARN("%{public}s, already exist, formId[%{public}" PRId64 "].", __func__, formDBInfo.formId); return ERR_OK; } } else { @@ -90,16 +90,16 @@ ErrCode FormDbCache::SaveFormInfo(const FormDBInfo &formDBInfo) */ ErrCode FormDbCache::SaveFormInfoNolock(const FormDBInfo &formDBInfo) { - APP_LOGI("%{public}s called, formId:%{public}" PRId64 "", __func__, formDBInfo.formId); + HILOG_INFO("%{public}s called, formId:%{public}" PRId64 "", __func__, formDBInfo.formId); auto iter = find(formDBInfos_.begin(), formDBInfos_.end(), formDBInfo); if (iter != formDBInfos_.end()) { if (iter->Compare(formDBInfo) == false) { - APP_LOGW("%{public}s, need update, formId[%{public}" PRId64 "].", __func__, formDBInfo.formId); + HILOG_WARN("%{public}s, need update, formId[%{public}" PRId64 "].", __func__, formDBInfo.formId); *iter = formDBInfo; InnerFormInfo innerFormInfo(formDBInfo); return dataStorage_->ModifyStorageFormInfo(innerFormInfo); } else { - APP_LOGW("%{public}s, already exist, formId[%{public}" PRId64 "].", __func__, formDBInfo.formId); + HILOG_WARN("%{public}s, already exist, formId[%{public}" PRId64 "].", __func__, formDBInfo.formId); return ERR_OK; } } else { @@ -121,7 +121,7 @@ ErrCode FormDbCache::DeleteFormInfo(int64_t formId) tmpForm.formId = formId; auto iter = find(formDBInfos_.begin(), formDBInfos_.end(), tmpForm); if (iter == formDBInfos_.end()) { - APP_LOGW("%{public}s, not find formId[%{public}" PRId64 "]", __func__, formId); + HILOG_WARN("%{public}s, not find formId[%{public}" PRId64 "]", __func__, formId); } else { formDBInfos_.erase(iter); } @@ -164,7 +164,7 @@ ErrCode FormDbCache::DeleteFormInfoByBundleName(const std::string &bundleName, s */ void FormDbCache::GetAllFormInfo(std::vector &formDBInfos) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::lock_guard lock(formDBInfosMutex_); formDBInfos = formDBInfos_; } @@ -189,7 +189,7 @@ ErrCode FormDbCache::GetDBRecord(const int64_t formId, FormRecord &record) const return ERR_OK; } } - APP_LOGE("%{public}s, not find formId[%{public}" PRId64 "]", __func__, formId); + HILOG_ERROR("%{public}s, not find formId[%{public}" PRId64 "]", __func__, formId); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } /** @@ -207,7 +207,7 @@ ErrCode FormDbCache::GetDBRecord(const int64_t formId, FormDBInfo &record) const return ERR_OK; } } - APP_LOGE("%{public}s, not find formId[%{public}" PRId64 "]", __func__, formId); + HILOG_ERROR("%{public}s, not find formId[%{public}" PRId64 "]", __func__, formId); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } /** @@ -293,7 +293,7 @@ void FormDbCache::DeleteDBFormsByUserId(const int32_t userId) if (dataStorage_->DeleteStorageFormInfo(std::to_string(formId)) == ERR_OK) { itRecord = formDBInfos_.erase(itRecord); } else { - APP_LOGE("%{public}s, failed to delete form, formId[%{public}" PRId64 "]", __func__, formId); + HILOG_ERROR("%{public}s, failed to delete form, formId[%{public}" PRId64 "]", __func__, formId); itRecord++; } } else { diff --git a/services/formmgr/src/form_delete_connection.cpp b/services/formmgr/src/form_delete_connection.cpp index c75e3090d8..42a4cb56d3 100755 --- a/services/formmgr/src/form_delete_connection.cpp +++ b/services/formmgr/src/form_delete_connection.cpp @@ -17,11 +17,11 @@ #include #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "form_constants.h" #include "form_delete_connection.h" #include "form_supply_callback.h" #include "form_task_mgr.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "message_parcel.h" #include "want.h" @@ -43,9 +43,9 @@ FormDeleteConnection::FormDeleteConnection(const int64_t formId, const std::stri void FormDeleteConnection::OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (resultCode != ERR_OK) { - APP_LOGE("%{public}s, abilityName:%{public}s, formId:%{public}" PRId64 ", resultCode:%{public}d", + HILOG_ERROR("%{public}s, abilityName:%{public}s, formId:%{public}" PRId64 ", resultCode:%{public}d", __func__, element.GetAbilityName().c_str(), formId_, resultCode); return; } @@ -53,7 +53,7 @@ void FormDeleteConnection::OnAbilityConnectDone( Want want; want.SetParam(Constants::FORM_CONNECT_ID, this->GetConnectId()); - APP_LOGD("%{public}s, connectId :%{public}ld", __func__, this->GetConnectId()); + HILOG_DEBUG("%{public}s, connectId :%{public}ld", __func__, this->GetConnectId()); FormTaskMgr::GetInstance().PostDeleteTask(formId_, want, remoteObject); } } // namespace AppExecFwk diff --git a/services/formmgr/src/form_dump_mgr.cpp b/services/formmgr/src/form_dump_mgr.cpp index 51a2ae50ec..fe26029834 100644 --- a/services/formmgr/src/form_dump_mgr.cpp +++ b/services/formmgr/src/form_dump_mgr.cpp @@ -12,8 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "app_log_wrapper.h" #include "form_cache_mgr.h" +#include "hilog_wrapper.h" #include "form_dump_mgr.h" namespace OHOS { @@ -50,7 +50,7 @@ void FormDumpMgr::DumpStorageFormInfos(const std::vector &storageInf */ void FormDumpMgr::DumpFormInfos(const std::vector &formRecordInfos, std::string &formInfos) const { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); for (const auto &info : formRecordInfos) { formInfos += " FormId [" + std::to_string(info.formId) + "]"; formInfos += " formName [" + info.formName + "]"; @@ -95,7 +95,7 @@ void FormDumpMgr::DumpFormInfos(const std::vector &formRecordInfos, } } - APP_LOGI("%{public}s success. Form infos:%{public}s", __func__, formInfos.c_str()); + HILOG_INFO("%{public}s success. Form infos:%{public}s", __func__, formInfos.c_str()); } /** * @brief Dump form infos. @@ -104,11 +104,11 @@ void FormDumpMgr::DumpFormInfos(const std::vector &formRecordInfos, */ void FormDumpMgr::DumpFormHostInfo(const FormHostRecord &formHostRecord, std::string &formInfo) const { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); formInfo += " ================FormHostRecord================="; formInfo += " callerUid [" + std::to_string(formHostRecord.GetCallerUid()) + "]"; formInfo += " hostBundleName [" + formHostRecord.GetHostBundleName() + "]"; - APP_LOGI("%{public}s success. Host Form infos:%{public}s", __func__, formInfo.c_str()); + HILOG_INFO("%{public}s success. Host Form infos:%{public}s", __func__, formInfo.c_str()); } /** @@ -118,7 +118,7 @@ void FormDumpMgr::DumpFormHostInfo(const FormHostRecord &formHostRecord, std::st */ void FormDumpMgr::DumpFormInfo(const FormRecord &formRecordInfo, std::string &formInfo) const { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); formInfo += " ================FormRecord================="; formInfo += " FormId [" + std::to_string(formRecordInfo.formId) + "]"; formInfo += " formName [" + formRecordInfo.formName + "]"; @@ -169,7 +169,7 @@ void FormDumpMgr::DumpFormInfo(const FormRecord &formRecordInfo, std::string &fo formInfo += "]" + LINE_SEPARATOR; } - APP_LOGI("%{public}s success. Form infos:%{public}s", __func__, formInfo.c_str()); + HILOG_INFO("%{public}s success. Form infos:%{public}s", __func__, formInfo.c_str()); } } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file diff --git a/services/formmgr/src/form_event_notify_connection.cpp b/services/formmgr/src/form_event_notify_connection.cpp index 987e5efd42..f75e355e7f 100644 --- a/services/formmgr/src/form_event_notify_connection.cpp +++ b/services/formmgr/src/form_event_notify_connection.cpp @@ -15,11 +15,11 @@ */ #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "form_constants.h" #include "form_event_notify_connection.h" #include "form_supply_callback.h" #include "form_task_mgr.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "message_parcel.h" #include "want.h" @@ -44,9 +44,9 @@ FormEventNotifyConnection::FormEventNotifyConnection(const std::vector void FormEventNotifyConnection::OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (resultCode != ERR_OK) { - APP_LOGE("%{public}s, abilityName:%{public}s, resultCode:%{public}d", + HILOG_ERROR("%{public}s, abilityName:%{public}s, resultCode:%{public}d", __func__, element.GetAbilityName().c_str(), resultCode); return; } diff --git a/services/formmgr/src/form_host_callback.cpp b/services/formmgr/src/form_host_callback.cpp index e7d34548b2..8e7417f53e 100644 --- a/services/formmgr/src/form_host_callback.cpp +++ b/services/formmgr/src/form_host_callback.cpp @@ -18,9 +18,9 @@ #include #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "form_host_interface.h" #include "form_task_mgr.h" +#include "hilog_wrapper.h" #include "string_ex.h" namespace OHOS { @@ -36,7 +36,7 @@ namespace AppExecFwk { void FormHostCallback::OnAcquired(const int64_t formId, const FormRecord& record, const sptr &callerToken) { - APP_LOGD("FormHostCallback OnAcquired, formId:%{public}" PRId64 "", formId); + HILOG_DEBUG("FormHostCallback OnAcquired, formId:%{public}" PRId64 "", formId); FormTaskMgr::GetInstance().PostAcquireTaskToHost(formId, record, callerToken); } @@ -49,16 +49,16 @@ void FormHostCallback::OnAcquired(const int64_t formId, const FormRecord& record */ void FormHostCallback::OnUpdate(const int64_t formId, const FormRecord &record, const sptr &callerToken) { - APP_LOGI("%{public}s start.", __func__); + HILOG_INFO("%{public}s start.", __func__); // check formId if (formId < 0) { - APP_LOGE("%{public}s: OnUpdate invalid param, formId:%{public}" PRId64 ".", __func__, formId); + HILOG_ERROR("%{public}s: OnUpdate invalid param, formId:%{public}" PRId64 ".", __func__, formId); return; } if (callerToken == nullptr) { - APP_LOGE("%{public}s: callerToken can not be NULL", __func__); + HILOG_ERROR("%{public}s: callerToken can not be NULL", __func__); return; } @@ -76,12 +76,12 @@ void FormHostCallback::OnUninstall(std::vector &formIds, const sptr FormHostRecord::GetClientStub() const */ void FormHostRecord::OnAcquire(int64_t id, const FormRecord &record) { - APP_LOGD("FormHostRecord OnAcquire"); + HILOG_DEBUG("FormHostRecord OnAcquire"); if (clientImpl_ == nullptr) { - APP_LOGE("%{public}s: clientImpl_ can not be NULL", __func__); + HILOG_ERROR("%{public}s: clientImpl_ can not be NULL", __func__); return; } @@ -133,10 +133,10 @@ void FormHostRecord::OnAcquire(int64_t id, const FormRecord &record) */ void FormHostRecord::OnUpdate(int64_t id, const FormRecord &record) { - APP_LOGI("%{public}s start.", __func__); + HILOG_INFO("%{public}s start.", __func__); if (clientImpl_ == nullptr) { - APP_LOGE("%{public}s: clientImpl_ can not be null.", __func__); + HILOG_ERROR("%{public}s: clientImpl_ can not be null.", __func__); return; } @@ -150,10 +150,10 @@ void FormHostRecord::OnUpdate(int64_t id, const FormRecord &record) */ void FormHostRecord::OnFormUninstalled(std::vector &formIds) { - APP_LOGI("%{public}s start.", __func__); + HILOG_INFO("%{public}s start.", __func__); if (clientImpl_ == nullptr) { - APP_LOGE("%{public}s: clientImpl_ can not be null.", __func__); + HILOG_ERROR("%{public}s: clientImpl_ can not be null.", __func__); return; } clientImpl_->OnUninstall(formIds, clientStub_); @@ -246,7 +246,7 @@ FormHostRecord FormHostRecord::CreateRecord(const FormItemInfo &info, */ void FormHostRecord::ClientDeathRecipient::OnRemoteDied(const wptr &remote) { - APP_LOGD("Form remote died"); + HILOG_DEBUG("Form remote died"); FormTaskMgr::GetInstance().PostHostDiedTask(remote.promote()); } diff --git a/services/formmgr/src/form_info_mgr.cpp b/services/formmgr/src/form_info_mgr.cpp index d4a988f3c3..e9c55166f9 100644 --- a/services/formmgr/src/form_info_mgr.cpp +++ b/services/formmgr/src/form_info_mgr.cpp @@ -17,12 +17,12 @@ #include -#include "app_log_wrapper.h" #include "bundle_mgr_client.h" #include "extension_form_profile.h" #include "form_bms_helper.h" #include "form_info_storage_mgr.h" #include "form_util.h" +#include "hilog_wrapper.h" #include "ipc_skeleton.h" #include "json_serializer.h" #include "permission_verification.h" @@ -36,31 +36,31 @@ const std::string FORM_METADATA_NAME = "ohos.extension.form"; ErrCode FormInfoHelper::LoadFormConfigInfoByBundleName(const std::string &bundleName, std::vector &formInfos) { if (bundleName.empty()) { - APP_LOGE("bundleName is invalid"); + HILOG_ERROR("bundleName is invalid"); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } sptr iBundleMgr = FormBmsHelper::GetInstance().GetBundleMgr(); if (iBundleMgr == nullptr) { - APP_LOGE("GetBundleMgr, failed to get IBundleMgr."); + HILOG_ERROR("GetBundleMgr, failed to get IBundleMgr."); return ERR_APPEXECFWK_FORM_GET_BMS_FAILED; } BundleInfo bundleInfo; if (!iBundleMgr->GetBundleInfo(bundleName, GET_BUNDLE_WITH_EXTENSION_INFO, bundleInfo, FormUtil::GetCurrentAccountId())) { - APP_LOGE("failed to get bundle info."); + HILOG_ERROR("failed to get bundle info."); return ERR_APPEXECFWK_FORM_GET_INFO_FAILED; } ErrCode errCode = LoadAbilityFormConfigInfo(bundleInfo, formInfos); if (errCode != ERR_OK) { - APP_LOGE("failed to load FA form config info, error code=%{public}d.", errCode); + HILOG_ERROR("failed to load FA form config info, error code=%{public}d.", errCode); } errCode = LoadStageFormConfigInfo(bundleInfo, formInfos); if (errCode != ERR_OK) { - APP_LOGE("failed to load stage form config info, error code=%{public}d.", errCode); + HILOG_ERROR("failed to load stage form config info, error code=%{public}d.", errCode); } return ERR_OK; @@ -70,7 +70,7 @@ ErrCode FormInfoHelper::LoadStageFormConfigInfo(const BundleInfo &bundleInfo, st { std::shared_ptr client = DelayedSingleton::GetInstance(); if (client == nullptr) { - APP_LOGE("failed to get BundleMgrClient."); + HILOG_ERROR("failed to get BundleMgrClient."); return ERR_APPEXECFWK_FORM_GET_BMS_FAILED; } @@ -81,7 +81,7 @@ ErrCode FormInfoHelper::LoadStageFormConfigInfo(const BundleInfo &bundleInfo, st std::vector profileInfos {}; if (!client->GetResConfigFile(extensionInfo, FORM_METADATA_NAME, profileInfos)) { - APP_LOGE("failed to get form metadata."); + HILOG_ERROR("failed to get form metadata."); continue; } @@ -89,7 +89,7 @@ ErrCode FormInfoHelper::LoadStageFormConfigInfo(const BundleInfo &bundleInfo, st std::vector extensionFormInfos; ErrCode errCode = ExtensionFormProfile::TransformTo(profileInfo, extensionFormInfos); if (errCode != ERR_OK) { - APP_LOGW("failed to transform profile to extension form info"); + HILOG_WARN("failed to transform profile to extension form info"); continue; } for (const auto &extensionFormInfo: extensionFormInfos) { @@ -104,7 +104,7 @@ ErrCode FormInfoHelper::LoadAbilityFormConfigInfo(const BundleInfo &bundleInfo, { sptr iBundleMgr = FormBmsHelper::GetInstance().GetBundleMgr(); if (iBundleMgr == nullptr) { - APP_LOGE("failed to get IBundleMgr."); + HILOG_ERROR("failed to get IBundleMgr."); return ERR_APPEXECFWK_FORM_GET_BMS_FAILED; } @@ -132,7 +132,7 @@ ErrCode BundleFormInfo::InitFromJson(const std::string &formInfosJson) { nlohmann::json jsonObject = nlohmann::json::parse(formInfosJson, nullptr, false); if (jsonObject.is_discarded()) { - APP_LOGE("bad profile"); + HILOG_ERROR("bad profile"); return ERR_APPEXECFWK_PARSE_BAD_PROFILE; } std::unique_lock guard(formInfosMutex_); @@ -153,7 +153,7 @@ ErrCode BundleFormInfo::Update() nlohmann::json jsonObject = formInfos_; if (jsonObject.is_discarded()) { - APP_LOGE("bad form infos."); + HILOG_ERROR("bad form infos."); return ERR_APPEXECFWK_PARSE_BAD_PROFILE; } std::string formInfoStr = jsonObject.dump(Constants::DUMP_INDENT); @@ -197,7 +197,7 @@ ErrCode BundleFormInfo::GetFormsInfoByModule(const std::string &moduleName, std: FormInfoMgr::FormInfoMgr() { - APP_LOGI("FormInfoMgr is created"); + HILOG_INFO("FormInfoMgr is created"); } FormInfoMgr::~FormInfoMgr() = default; @@ -207,7 +207,7 @@ ErrCode FormInfoMgr::Start() std::vector> formInfos; ErrCode errCode = FormInfoStorageMgr::GetInstance().LoadFormInfos(formInfos); if (errCode != ERR_OK) { - APP_LOGE("LoadFormData failed."); + HILOG_ERROR("LoadFormData failed."); return errCode; } @@ -220,17 +220,17 @@ ErrCode FormInfoMgr::Start() if (errCode != ERR_OK) { continue; } - APP_LOGE("load bundle %{public}s form infos success.", bundleName.c_str()); + HILOG_ERROR("load bundle %{public}s form infos success.", bundleName.c_str()); bundleFormInfoMap_[bundleName] = bundleFormInfoPtr; } - APP_LOGI("load bundle form infos from db done."); + HILOG_INFO("load bundle form infos from db done."); return ERR_OK; } ErrCode FormInfoMgr::Update(const std::string &bundleName) { if (bundleName.empty()) { - APP_LOGE("bundleName is empty."); + HILOG_ERROR("bundleName is empty."); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } @@ -247,14 +247,14 @@ ErrCode FormInfoMgr::Update(const std::string &bundleName) std::unique_lock guard(bundleFormInfoMapMutex_); bundleFormInfoMap_[bundleName] = bundleFormInfoPtr; - APP_LOGE("update forms info success, bundleName=%{public}s.", bundleName.c_str()); + HILOG_ERROR("update forms info success, bundleName=%{public}s.", bundleName.c_str()); return ERR_OK; } ErrCode FormInfoMgr::Remove(const std::string &bundleName) { if (bundleName.empty()) { - APP_LOGE("bundleName is empty."); + HILOG_ERROR("bundleName is empty."); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } @@ -270,7 +270,7 @@ ErrCode FormInfoMgr::Remove(const std::string &bundleName) errCode = bundleFormInfoIter->second->Remove(); } bundleFormInfoMap_.erase(bundleFormInfoIter); - APP_LOGE("remove forms info success, bundleName=%{public}s.", bundleName.c_str()); + HILOG_ERROR("remove forms info success, bundleName=%{public}s.", bundleName.c_str()); return errCode; } @@ -300,7 +300,7 @@ ErrCode FormInfoMgr::GetAllFormsInfo(std::vector &formInfos) ErrCode FormInfoMgr::GetFormsInfoByBundle(const std::string &bundleName, std::vector &formInfos) { if (bundleName.empty()) { - APP_LOGE("bundleName is empty."); + HILOG_ERROR("bundleName is empty."); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } @@ -311,7 +311,7 @@ ErrCode FormInfoMgr::GetFormsInfoByBundle(const std::string &bundleName, std::ve std::shared_lock guard(bundleFormInfoMapMutex_); auto bundleFormInfoIter = bundleFormInfoMap_.find(bundleName); if (bundleFormInfoIter == bundleFormInfoMap_.end()) { - APP_LOGE("no forms found."); + HILOG_ERROR("no forms found."); return ERR_APPEXECFWK_FORM_GET_BUNDLE_FAILED; } @@ -325,7 +325,7 @@ ErrCode FormInfoMgr::GetFormsInfoByModule(const std::string &bundleName, const s std::vector &formInfos) { if (bundleName.empty()) { - APP_LOGE("bundleName is empty."); + HILOG_ERROR("bundleName is empty."); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } @@ -336,7 +336,7 @@ ErrCode FormInfoMgr::GetFormsInfoByModule(const std::string &bundleName, const s std::shared_lock guard(bundleFormInfoMapMutex_); auto bundleFormInfoIter = bundleFormInfoMap_.find(bundleName); if (bundleFormInfoIter == bundleFormInfoMap_.end()) { - APP_LOGE("no forms found for %{public}s.", bundleName.c_str()); + HILOG_ERROR("no forms found for %{public}s.", bundleName.c_str()); return ERR_APPEXECFWK_FORM_GET_BUNDLE_FAILED; } @@ -379,7 +379,7 @@ bool FormInfoMgr::IsCaller(std::string bundleName) AppExecFwk::BundleInfo bundleInfo; bool ret = bms->GetBundleInfo(bundleName, GET_BUNDLE_DEFAULT, bundleInfo, FormUtil::GetCurrentAccountId()); if (!ret) { - APP_LOGE("Failed to get bundle info."); + HILOG_ERROR("Failed to get bundle info."); return false; } auto callerToken = IPCSkeleton::GetCallingTokenID(); @@ -400,7 +400,7 @@ bool FormInfoMgr::CheckBundlePermission() if (isCallingPerm) { return true; } - APP_LOGE("Permission verification failed"); + HILOG_ERROR("Permission verification failed"); return false; } } // namespace AppExecFwk diff --git a/services/formmgr/src/form_info_storage_mgr.cpp b/services/formmgr/src/form_info_storage_mgr.cpp index b19a809a23..23c2411823 100644 --- a/services/formmgr/src/form_info_storage_mgr.cpp +++ b/services/formmgr/src/form_info_storage_mgr.cpp @@ -16,7 +16,7 @@ #include "form_info_storage_mgr.h" #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "kvstore_death_recipient_callback.h" namespace OHOS { @@ -28,17 +28,17 @@ const int32_t CHECK_INTERVAL = 100000; // 100ms KvStoreDeathRecipientCallbackFormInfoStorage::KvStoreDeathRecipientCallbackFormInfoStorage() { - APP_LOGI("create kvstore death recipient callback instance %{public}p", this); + HILOG_INFO("create kvstore death recipient callback instance %{public}p", this); } KvStoreDeathRecipientCallbackFormInfoStorage::~KvStoreDeathRecipientCallbackFormInfoStorage() { - APP_LOGI("destroy kvstore death recipient callback instance %{public}p", this); + HILOG_INFO("destroy kvstore death recipient callback instance %{public}p", this); } void KvStoreDeathRecipientCallbackFormInfoStorage::OnRemoteDied() { - APP_LOGI("OnRemoteDied, register data change listener begin"); + HILOG_INFO("OnRemoteDied, register data change listener begin"); std::thread([] { int32_t times = 0; FormInfoStorageMgr &formInfoStorageMgr = FormInfoStorageMgr::GetInstance(); @@ -47,14 +47,14 @@ void KvStoreDeathRecipientCallbackFormInfoStorage::OnRemoteDied() // init kvStore. if (formInfoStorageMgr.ResetKvStore()) { // register data change listener again. - APP_LOGI("current times is %{public}d", times); + HILOG_INFO("current times is %{public}d", times); break; } usleep(CHECK_INTERVAL); } }).detach(); - APP_LOGI("OnRemoteDied, register data change listener end"); + HILOG_INFO("OnRemoteDied, register data change listener end"); } FormInfoStorageMgr::FormInfoStorageMgr() @@ -62,10 +62,10 @@ FormInfoStorageMgr::FormInfoStorageMgr() DistributedKv::Status status = GetKvStore(); if (status == DistributedKv::Status::IPC_ERROR) { status = GetKvStore(); - APP_LOGW("distribute database ipc error and try to call again, result = %{public}d", status); + HILOG_WARN("distribute database ipc error and try to call again, result = %{public}d", status); } RegisterKvStoreDeathListener(); - APP_LOGI("FormInfoStorageMgr is created"); + HILOG_INFO("FormInfoStorageMgr is created"); } FormInfoStorageMgr::~FormInfoStorageMgr() @@ -75,11 +75,11 @@ FormInfoStorageMgr::~FormInfoStorageMgr() ErrCode FormInfoStorageMgr::LoadFormInfos(std::vector> &formInfos) { - APP_LOGI("FormInfoStorageMgr load all form infos"); + HILOG_INFO("FormInfoStorageMgr load all form infos"); { std::lock_guard lock(kvStorePtrMutex_); if (!CheckKvStore()) { - APP_LOGE("kvStore is nullptr"); + HILOG_ERROR("kvStore is nullptr"); return ERR_APPEXECFWK_FORM_COMMON_CODE; } } @@ -89,11 +89,11 @@ ErrCode FormInfoStorageMgr::LoadFormInfos(std::vector lock(kvStorePtrMutex_); if (!CheckKvStore()) { - APP_LOGE("kvStore is nullptr"); + HILOG_ERROR("kvStore is nullptr"); return ERR_APPEXECFWK_FORM_COMMON_CODE; } } @@ -129,12 +129,12 @@ ErrCode FormInfoStorageMgr::GetBundleFormInfos(const std::string &bundleName, st } if (status != DistributedKv::Status::SUCCESS) { - APP_LOGE("get entries error: %{public}d", status); + HILOG_ERROR("get entries error: %{public}d", status); return ERR_APPEXECFWK_FORM_COMMON_CODE; } if (allEntries.empty()) { - APP_LOGE("%{public}s not match any FormInfo", bundleName.c_str()); + HILOG_ERROR("%{public}s not match any FormInfo", bundleName.c_str()); return ERR_APPEXECFWK_FORM_COMMON_CODE; } @@ -145,15 +145,15 @@ ErrCode FormInfoStorageMgr::GetBundleFormInfos(const std::string &bundleName, st ErrCode FormInfoStorageMgr::SaveBundleFormInfos(const std::string &bundleName, const std::string &formInfos) { if (bundleName.empty()) { - APP_LOGE("bundleName is empty."); + HILOG_ERROR("bundleName is empty."); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } - APP_LOGI("FormInfoStorageMgr save form info, bundleName=%{public}s", bundleName.c_str()); + HILOG_INFO("FormInfoStorageMgr save form info, bundleName=%{public}s", bundleName.c_str()); { std::lock_guard lock(kvStorePtrMutex_); if (!CheckKvStore()) { - APP_LOGE("kvStore is nullptr"); + HILOG_ERROR("kvStore is nullptr"); return ERR_APPEXECFWK_FORM_COMMON_CODE; } } @@ -166,11 +166,11 @@ ErrCode FormInfoStorageMgr::SaveBundleFormInfos(const std::string &bundleName, c status = kvStorePtr_->Put(key, value); if (status == DistributedKv::Status::IPC_ERROR) { status = kvStorePtr_->Put(key, value); - APP_LOGW("distribute database ipc error and try to call again, result = %{public}d", status); + HILOG_WARN("distribute database ipc error and try to call again, result = %{public}d", status); } } if (status != DistributedKv::Status::SUCCESS) { - APP_LOGE("save formInfos to kvStore error: %{public}d", status); + HILOG_ERROR("save formInfos to kvStore error: %{public}d", status); return ERR_APPEXECFWK_FORM_COMMON_CODE; } return ERR_OK; @@ -179,15 +179,15 @@ ErrCode FormInfoStorageMgr::SaveBundleFormInfos(const std::string &bundleName, c ErrCode FormInfoStorageMgr::RemoveBundleFormInfos(const std::string &bundleName) { if (bundleName.empty()) { - APP_LOGE("bundleName is empty."); + HILOG_ERROR("bundleName is empty."); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } - APP_LOGI("FormInfoStorageMgr remove form info, bundleName=%{public}s", bundleName.c_str()); + HILOG_INFO("FormInfoStorageMgr remove form info, bundleName=%{public}s", bundleName.c_str()); { std::lock_guard lock(kvStorePtrMutex_); if (!CheckKvStore()) { - APP_LOGE("kvStore is nullptr"); + HILOG_ERROR("kvStore is nullptr"); return ERR_APPEXECFWK_FORM_COMMON_CODE; } } @@ -199,12 +199,12 @@ ErrCode FormInfoStorageMgr::RemoveBundleFormInfos(const std::string &bundleName) status = kvStorePtr_->Delete(key); if (status == DistributedKv::Status::IPC_ERROR) { status = kvStorePtr_->Delete(key); - APP_LOGW("distribute database ipc error and try to call again, result = %{public}d", status); + HILOG_WARN("distribute database ipc error and try to call again, result = %{public}d", status); } } if (status != DistributedKv::Status::SUCCESS) { - APP_LOGE("remove formInfos from kvStore error: %{public}d", status); + HILOG_ERROR("remove formInfos from kvStore error: %{public}d", status); return ERR_APPEXECFWK_FORM_COMMON_CODE; } return ERR_OK; @@ -213,15 +213,15 @@ ErrCode FormInfoStorageMgr::RemoveBundleFormInfos(const std::string &bundleName) ErrCode FormInfoStorageMgr::UpdateBundleFormInfos(const std::string &bundleName, const std::string &formInfos) { if (bundleName.empty()) { - APP_LOGE("bundleName is empty."); + HILOG_ERROR("bundleName is empty."); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } - APP_LOGI("FormInfoStorageMgr update form info, bundleName=%{public}s", bundleName.c_str()); + HILOG_INFO("FormInfoStorageMgr update form info, bundleName=%{public}s", bundleName.c_str()); { std::lock_guard lock(kvStorePtrMutex_); if (!CheckKvStore()) { - APP_LOGE("kvStore is nullptr"); + HILOG_ERROR("kvStore is nullptr"); return ERR_APPEXECFWK_FORM_COMMON_CODE; } } @@ -232,10 +232,10 @@ ErrCode FormInfoStorageMgr::UpdateBundleFormInfos(const std::string &bundleName, status = kvStorePtr_->Delete(key); if (status == DistributedKv::Status::IPC_ERROR) { status = kvStorePtr_->Delete(key); - APP_LOGW("distribute database ipc error and try to call again, result = %{public}d", status); + HILOG_WARN("distribute database ipc error and try to call again, result = %{public}d", status); } if (status != DistributedKv::Status::SUCCESS && status != DistributedKv::Status::KEY_NOT_FOUND) { - APP_LOGE("update formInfos to kvStore error: %{public}d", status); + HILOG_ERROR("update formInfos to kvStore error: %{public}d", status); return ERR_APPEXECFWK_FORM_COMMON_CODE; } @@ -243,10 +243,10 @@ ErrCode FormInfoStorageMgr::UpdateBundleFormInfos(const std::string &bundleName, status = kvStorePtr_->Put(key, value); if (status == DistributedKv::Status::IPC_ERROR) { status = kvStorePtr_->Put(key, value); - APP_LOGW("distribute database ipc error and try to call again, result = %{public}d", status); + HILOG_WARN("distribute database ipc error and try to call again, result = %{public}d", status); } if (status != DistributedKv::Status::SUCCESS) { - APP_LOGE("update formInfos to kvStore error: %{public}d", status); + HILOG_ERROR("update formInfos to kvStore error: %{public}d", status); return ERR_APPEXECFWK_FORM_COMMON_CODE; } return ERR_OK; @@ -263,9 +263,9 @@ DistributedKv::Status FormInfoStorageMgr::GetKvStore() DistributedKv::Status status = dataManager_.GetSingleKvStore(options, appId_, storeId_, kvStorePtr_); if (status != DistributedKv::Status::SUCCESS) { - APP_LOGE("return error: %{public}d", status); + HILOG_ERROR("return error: %{public}d", status); } else { - APP_LOGI("get kvStore success"); + HILOG_INFO("get kvStore success"); } return status; } @@ -281,7 +281,7 @@ bool FormInfoStorageMgr::CheckKvStore() if (status == DistributedKv::Status::SUCCESS && kvStorePtr_ != nullptr) { return true; } - APP_LOGI("CheckKvStore, Times: %{public}d", tryTimes); + HILOG_INFO("CheckKvStore, Times: %{public}d", tryTimes); usleep(SLEEP_INTERVAL); tryTimes--; } @@ -290,7 +290,7 @@ bool FormInfoStorageMgr::CheckKvStore() void FormInfoStorageMgr::RegisterKvStoreDeathListener() { - APP_LOGI("register kvStore death listener"); + HILOG_INFO("register kvStore death listener"); std::shared_ptr callback = std::make_shared(); dataManager_.RegisterKvStoreServiceDeathRecipient(callback); @@ -304,7 +304,7 @@ bool FormInfoStorageMgr::ResetKvStore() if (status == DistributedKv::Status::SUCCESS && kvStorePtr_ != nullptr) { return true; } - APP_LOGW("failed"); + HILOG_WARN("failed"); return false; } @@ -317,7 +317,7 @@ DistributedKv::Status FormInfoStorageMgr::GetEntries(std::vectorGetEntries(key, allEntries); } - APP_LOGI("get all entries status: %{public}d", status); + HILOG_INFO("get all entries status: %{public}d", status); return status; } } // namespace AppExecFwk diff --git a/services/formmgr/src/form_item_info.cpp b/services/formmgr/src/form_item_info.cpp index f841497905..f08f92db69 100644 --- a/services/formmgr/src/form_item_info.cpp +++ b/services/formmgr/src/form_item_info.cpp @@ -12,8 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "app_log_wrapper.h" #include "form_item_info.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -184,18 +184,18 @@ bool FormItemInfo::IsValidItem() const */ bool FormItemInfo::IsMatch(const FormRecord &record) const { - APP_LOGD("match data"); - APP_LOGD("FormRecord.bundleName : %{public}s", record.bundleName.c_str()); - APP_LOGD("FormRecord.moduleName : %{public}s", record.moduleName.c_str()); - APP_LOGD("FormRecord.abilityName : %{public}s", record.abilityName.c_str()); - APP_LOGD("FormRecord.formName : %{public}s", record.formName.c_str()); - APP_LOGD("FormRecord.specification : %{public}d", record.specification); + HILOG_DEBUG("match data"); + HILOG_DEBUG("FormRecord.bundleName : %{public}s", record.bundleName.c_str()); + HILOG_DEBUG("FormRecord.moduleName : %{public}s", record.moduleName.c_str()); + HILOG_DEBUG("FormRecord.abilityName : %{public}s", record.abilityName.c_str()); + HILOG_DEBUG("FormRecord.formName : %{public}s", record.formName.c_str()); + HILOG_DEBUG("FormRecord.specification : %{public}d", record.specification); - APP_LOGD("FormItemInfo.providerBundleName_ : %{public}s", providerBundleName_.c_str()); - APP_LOGD("FormItemInfo.moduleName : %{public}s", moduleName_.c_str()); - APP_LOGD("FormItemInfo.abilityName : %{public}s", abilityName_.c_str()); - APP_LOGD("FormItemInfo.formName : %{public}s", formName_.c_str()); - APP_LOGD("FormItemInfo.specification : %{public}d", specificationId_); + HILOG_DEBUG("FormItemInfo.providerBundleName_ : %{public}s", providerBundleName_.c_str()); + HILOG_DEBUG("FormItemInfo.moduleName : %{public}s", moduleName_.c_str()); + HILOG_DEBUG("FormItemInfo.abilityName : %{public}s", abilityName_.c_str()); + HILOG_DEBUG("FormItemInfo.formName : %{public}s", formName_.c_str()); + HILOG_DEBUG("FormItemInfo.specification : %{public}d", specificationId_); return (record.bundleName == providerBundleName_) && (record.moduleName == moduleName_) && (record.abilityName == abilityName_) && (record.formName == formName_) diff --git a/services/formmgr/src/form_mgr_adapter.cpp b/services/formmgr/src/form_mgr_adapter.cpp index e4fe509d27..5efc61c924 100644 --- a/services/formmgr/src/form_mgr_adapter.cpp +++ b/services/formmgr/src/form_mgr_adapter.cpp @@ -17,7 +17,6 @@ #include #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "form_acquire_connection.h" #include "form_ams_helper.h" #include "form_bms_helper.h" @@ -39,6 +38,7 @@ #include "form_supply_callback.h" #include "form_timer_mgr.h" #include "form_util.h" +#include "hilog_wrapper.h" #include "if_system_ability_manager.h" #include "ipc_skeleton.h" #include "iservice_registry.h" @@ -69,7 +69,7 @@ int FormMgrAdapter::AddForm(const int64_t formId, const Want &want, const sptr &callerToken, FormJsInfo &formInfo) { if (formId < 0 || callerToken == nullptr) { - APP_LOGE("%{public}s fail, callerToken can not be NULL", __func__); + HILOG_ERROR("%{public}s fail, callerToken can not be NULL", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } @@ -79,7 +79,7 @@ int FormMgrAdapter::AddForm(const int64_t formId, const Want &want, int checkCode = 0; if (tempFormFlag) { if (formId > 0) { - APP_LOGE("%{public}s fail, temp form id is invalid, formId:%{public}" PRId64 "", __func__, formId); + HILOG_ERROR("%{public}s fail, temp form id is invalid, formId:%{public}" PRId64 "", __func__, formId); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } checkCode = FormDataMgr::GetInstance().CheckTempEnoughForm(); @@ -91,7 +91,7 @@ int FormMgrAdapter::AddForm(const int64_t formId, const Want &want, } } if (checkCode != 0) { - APP_LOGE("%{public}s fail, too much forms in system", __func__); + HILOG_ERROR("%{public}s fail, too much forms in system", __func__); return checkCode; } @@ -100,15 +100,15 @@ int FormMgrAdapter::AddForm(const int64_t formId, const Want &want, int32_t errCode = GetFormConfigInfo(want, formItemInfo); formItemInfo.SetFormId(formId); if (errCode != ERR_OK) { - APP_LOGE("%{public}s fail, get form config info failed.", __func__); + HILOG_ERROR("%{public}s fail, get form config info failed.", __func__); return errCode; } if (!formItemInfo.IsValidItem()) { - APP_LOGE("%{public}s fail, input param itemInfo is invalid", __func__); + HILOG_ERROR("%{public}s fail, input param itemInfo is invalid", __func__); return ERR_APPEXECFWK_FORM_GET_INFO_FAILED; } if (!FormDataMgr::GetInstance().GenerateUdidHash()) { - APP_LOGE("%{public}s fail, generate udid hash failed", __func__); + HILOG_ERROR("%{public}s fail, generate udid hash failed", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } formItemInfo.SetDeviceId(want.GetElement().GetDeviceID()); @@ -129,7 +129,7 @@ int FormMgrAdapter::AddForm(const int64_t formId, const Want &want, int FormMgrAdapter::DeleteForm(const int64_t formId, const sptr &callerToken) { if (formId <= 0 || callerToken == nullptr) { - APP_LOGE("%{public}s, deleteForm invalid param", __func__); + HILOG_ERROR("%{public}s, deleteForm invalid param", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } int64_t matchedFormId = FormDataMgr::GetInstance().FindMatchedFormId(formId); @@ -149,10 +149,10 @@ int FormMgrAdapter::DeleteForm(const int64_t formId, const sptr & */ int FormMgrAdapter::ReleaseForm(const int64_t formId, const sptr &callerToken, const bool delCache) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (formId <= 0 || callerToken == nullptr) { - APP_LOGE("%{public}s, releaseForm invalid param", __func__); + HILOG_ERROR("%{public}s, releaseForm invalid param", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } int64_t matchedFormId = FormDataMgr::GetInstance().FindMatchedFormId(formId); @@ -162,7 +162,7 @@ int FormMgrAdapter::ReleaseForm(const int64_t formId, const sptr } FormRecord dbRecord; if (FormDbCache::GetInstance().GetDBRecord(matchedFormId, dbRecord) != ERR_OK) { - APP_LOGE("%{public}s, not exist such db form:%{public}" PRId64 "", __func__, formId); + HILOG_ERROR("%{public}s, not exist such db form:%{public}" PRId64 "", __func__, formId); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } int callingUid = IPCSkeleton::GetCallingUid(); @@ -170,22 +170,22 @@ int FormMgrAdapter::ReleaseForm(const int64_t formId, const sptr bool isSelfDbFormId = (userId == dbRecord.userId) && ((std::find(dbRecord.formUserUids.begin(), dbRecord.formUserUids.end(), callingUid) != dbRecord.formUserUids.end()) ? true : false); if (!isSelfDbFormId) { - APP_LOGE("%{public}s, not self form:%{public}" PRId64 "", __func__, formId); + HILOG_ERROR("%{public}s, not self form:%{public}" PRId64 "", __func__, formId); return ERR_APPEXECFWK_FORM_OPERATION_NOT_SELF; } if (delCache) { if (ErrCode result = HandleReleaseForm(matchedFormId, callerToken); result != ERR_OK) { - APP_LOGE("%{public}s, release form error.", __func__); + HILOG_ERROR("%{public}s, release form error.", __func__); return result; } } if (!FormDataMgr::GetInstance().DeleteHostRecord(callerToken, matchedFormId)) { - APP_LOGE("%{public}s, failed to remove host record", __func__); + HILOG_ERROR("%{public}s, failed to remove host record", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } if (!FormTimerMgr::GetInstance().RemoveFormTimer(matchedFormId)) { - APP_LOGE("%{public}s, remove timer error", __func__); + HILOG_ERROR("%{public}s, remove timer error", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } return ERR_OK; @@ -199,9 +199,9 @@ int FormMgrAdapter::ReleaseForm(const int64_t formId, const sptr */ ErrCode FormMgrAdapter::HandleReleaseForm(const int64_t formId, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (!FormDataMgr::GetInstance().ExistFormRecord(formId)) { - APP_LOGE("%{public}s, not exist such db or temp form:%{public}" PRId64 "", __func__, formId); + HILOG_ERROR("%{public}s, not exist such db or temp form:%{public}" PRId64 "", __func__, formId); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } @@ -209,16 +209,16 @@ ErrCode FormMgrAdapter::HandleReleaseForm(const int64_t formId, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int uid = IPCSkeleton::GetCallingUid(); FormRecord record; @@ -280,7 +281,7 @@ ErrCode FormMgrAdapter::HandleDeleteTempForm(const int64_t formId, const sptr iBundleMgr = FormBmsHelper::GetInstance().GetBundleMgr(); if (iBundleMgr == nullptr) { - APP_LOGE("%{public}s error, failed to get IBundleMgr.", __func__); + HILOG_ERROR("%{public}s error, failed to get IBundleMgr.", __func__); return ERR_APPEXECFWK_FORM_GET_BMS_FAILED; } @@ -401,7 +402,7 @@ int FormMgrAdapter::UpdateForm(const int64_t formId, int32_t userId = GetCurrentUserId(callingUid); int32_t bundleUid = iBundleMgr->GetUidByBundleName(bundleName, userId); if (bundleUid != callingUid) { - APP_LOGE("%{public}s error, permission denied, the updated form is not your own.", __func__); + HILOG_ERROR("%{public}s error, permission denied, the updated form is not your own.", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } @@ -411,18 +412,18 @@ int FormMgrAdapter::UpdateForm(const int64_t formId, // check exist and get the formRecord FormRecord formRecord; if (!FormDataMgr::GetInstance().GetFormRecord(matchedFormId, formRecord)) { - APP_LOGE("%{public}s error, not exist such form:%{public}" PRId64 ".", __func__, matchedFormId); + HILOG_ERROR("%{public}s error, not exist such form:%{public}" PRId64 ".", __func__, matchedFormId); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } if (userId != formRecord.userId) { - APP_LOGE("%{public}s error, not under current user, formId:%{public}" PRId64 ".", __func__, matchedFormId); + HILOG_ERROR("%{public}s error, not under current user, formId:%{public}" PRId64 ".", __func__, matchedFormId); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } // check bundleName match if (formRecord.bundleName.compare(bundleName) != 0) { - APP_LOGE("%{public}s error, not match bundleName:%{public}s.", __func__, bundleName.c_str()); + HILOG_ERROR("%{public}s error, not match bundleName:%{public}s.", __func__, bundleName.c_str()); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } @@ -439,32 +440,32 @@ int FormMgrAdapter::UpdateForm(const int64_t formId, */ int FormMgrAdapter::RequestForm(const int64_t formId, const sptr &callerToken, const Want &want) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (formId <= 0 || callerToken == nullptr) { - APP_LOGE("%{public}s fail, callerToken can not be NULL.", __func__); + HILOG_ERROR("%{public}s fail, callerToken can not be NULL.", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } int64_t matchedFormId = FormDataMgr::GetInstance().FindMatchedFormId(formId); if (!FormDataMgr::GetInstance().ExistFormRecord(matchedFormId)) { - APP_LOGE("%{public}s fail, not exist such formId:%{public}" PRId64 ".", __func__, matchedFormId); + HILOG_ERROR("%{public}s fail, not exist such formId:%{public}" PRId64 ".", __func__, matchedFormId); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } FormHostRecord formHostRecord; bool isHostExist = FormDataMgr::GetInstance().GetMatchedHostClient(callerToken, formHostRecord); if (!isHostExist) { - APP_LOGE("%{public}s fail, cannot find target client.", __func__); + HILOG_ERROR("%{public}s fail, cannot find target client.", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } if (!formHostRecord.Contains(matchedFormId)) { - APP_LOGE("%{public}s fail, form is not self-owned.", __func__); + HILOG_ERROR("%{public}s fail, form is not self-owned.", __func__); return ERR_APPEXECFWK_FORM_OPERATION_NOT_SELF; } - APP_LOGI("%{public}s, find target client.", __func__); + HILOG_INFO("%{public}s, find target client.", __func__); Want reqWant(want); int callingUid = IPCSkeleton::GetCallingUid(); int32_t userId = GetCurrentUserId(callingUid); @@ -482,16 +483,16 @@ int FormMgrAdapter::RequestForm(const int64_t formId, const sptr ErrCode FormMgrAdapter::NotifyWhetherVisibleForms(const std::vector &formIds, const sptr &callerToken, const int32_t formVisibleType) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (callerToken == nullptr) { - APP_LOGE("%{public}s fail, callerToken can not be NULL.", __func__); + HILOG_ERROR("%{public}s fail, callerToken can not be NULL.", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } sptr iBundleMgr = FormBmsHelper::GetInstance().GetBundleMgr(); if (iBundleMgr == nullptr) { - APP_LOGE("%{public}s fail, failed to get IBundleMgr.", __func__); + HILOG_ERROR("%{public}s fail, failed to get IBundleMgr.", __func__); return ERR_APPEXECFWK_FORM_GET_BMS_FAILED; } @@ -499,7 +500,7 @@ ErrCode FormMgrAdapter::NotifyWhetherVisibleForms(const std::vector &fo std::map> eventMaps; for (int64_t formId : formIds) { if (formId <= 0) { - APP_LOGW("%{public}s, formId %{public}" PRId64 " is less than 0", __func__, formId); + HILOG_WARN("%{public}s, formId %{public}" PRId64 " is less than 0", __func__, formId); continue; } matchedFormId = FormDataMgr::GetInstance().FindMatchedFormId(formId); @@ -522,7 +523,7 @@ ErrCode FormMgrAdapter::NotifyWhetherVisibleForms(const std::vector &fo for (auto iter = eventMaps.begin(); iter != eventMaps.end(); iter++) { if (HandleEventNotify(iter->first, iter->second, formVisibleType) != ERR_OK) { - APP_LOGW("%{public}s fail, HandleEventNotify error, key is %{public}s.", __func__, iter->first.c_str()); + HILOG_WARN("%{public}s fail, HandleEventNotify error, key is %{public}s.", __func__, iter->first.c_str()); } } @@ -537,21 +538,21 @@ ErrCode FormMgrAdapter::NotifyWhetherVisibleForms(const std::vector &fo int FormMgrAdapter::CastTempForm(const int64_t formId, const sptr &callerToken) { if (formId <= 0 || callerToken == nullptr) { - APP_LOGE("%{public}s, invalid param", __func__); + HILOG_ERROR("%{public}s, invalid param", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } int64_t matchedFormId = FormDataMgr::GetInstance().FindMatchedFormId(formId); if (!FormDataMgr::GetInstance().ExistFormRecord(matchedFormId) || !FormDataMgr::GetInstance().ExistTempForm(matchedFormId)) { - APP_LOGE("%{public}s, not exist such temp form:%{public}" PRId64 "", __func__, matchedFormId); + HILOG_ERROR("%{public}s, not exist such temp form:%{public}" PRId64 "", __func__, matchedFormId); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } FormHostRecord record; bool hasHostRec = FormDataMgr::GetInstance().GetMatchedHostClient(callerToken, record); if (!hasHostRec || !record.Contains(matchedFormId)) { - APP_LOGE("%{public}s, not self form:%{public}" PRId64 "", __func__, matchedFormId); + HILOG_ERROR("%{public}s, not self form:%{public}" PRId64 "", __func__, matchedFormId); return ERR_APPEXECFWK_FORM_OPERATION_NOT_SELF; } @@ -559,41 +560,42 @@ int FormMgrAdapter::CastTempForm(const int64_t formId, const sptr int32_t userId = GetCurrentUserId(callingUid); int checkCode = FormDataMgr::GetInstance().CheckEnoughForm(callingUid, userId); if (checkCode != 0) { - APP_LOGE("%{public}s, %{public}" PRId64 " failed,because if too mush forms", __func__, matchedFormId); + HILOG_ERROR("%{public}s, %{public}" PRId64 " failed,because if too mush forms", __func__, matchedFormId); return checkCode; } FormRecord formRecord; if (!FormDataMgr::GetInstance().GetFormRecord(matchedFormId, formRecord)) { - APP_LOGE("%{public}s fail, not exist such form:%{public}" PRId64 ".", __func__, matchedFormId); + HILOG_ERROR("%{public}s fail, not exist such form:%{public}" PRId64 ".", __func__, matchedFormId); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } int bindSupplierCheckCode = HandleCastTempForm(matchedFormId, formRecord); if (bindSupplierCheckCode != 0) { - APP_LOGE("%{public}s, cast temp form bindSupplier failed", __func__); + HILOG_ERROR("%{public}s, cast temp form bindSupplier failed", __func__); return bindSupplierCheckCode; } if (!FormDataMgr::GetInstance().DeleteTempForm(matchedFormId)) { - APP_LOGE("%{public}s fail, delete temp form error, formId:%{public}" PRId64 ".", __func__, matchedFormId); + HILOG_ERROR("%{public}s fail, delete temp form error, formId:%{public}" PRId64 ".", __func__, matchedFormId); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } if (!FormDataMgr::GetInstance().ModifyFormTempFlg(matchedFormId, false)) { - APP_LOGE("%{public}s fail, modify form temp flag error, formId:%{public}" PRId64 ".", __func__, matchedFormId); + HILOG_ERROR( + "%{public}s fail, modify form temp flag error, formId:%{public}" PRId64 ".", __func__, matchedFormId); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } if (!FormDataMgr::GetInstance().AddFormUserUid(matchedFormId, callingUid)) { - APP_LOGE("%{public}s fail, add form user uid error, formId:%{public}" PRId64 ".", __func__, matchedFormId); + HILOG_ERROR("%{public}s fail, add form user uid error, formId:%{public}" PRId64 ".", __func__, matchedFormId); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } if (!FormDataMgr::GetInstance().GetFormRecord(matchedFormId, formRecord)) { - APP_LOGE("%{public}s fail, not exist such form:%{public}" PRId64 ".", __func__, matchedFormId); + HILOG_ERROR("%{public}s fail, not exist such form:%{public}" PRId64 ".", __func__, matchedFormId); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } if (ErrCode errorCode = FormDbCache::GetInstance().UpdateDBRecord(matchedFormId, formRecord); errorCode != ERR_OK) { - APP_LOGE("%{public}s fail, update db record error, formId:%{public}" PRId64 ".", __func__, matchedFormId); + HILOG_ERROR("%{public}s fail, update db record error, formId:%{public}" PRId64 ".", __func__, matchedFormId); return errorCode; } @@ -608,7 +610,7 @@ int FormMgrAdapter::CastTempForm(const int64_t formId, const sptr */ ErrCode FormMgrAdapter::HandleCastTempForm(const int64_t formId, const FormRecord &record) { - APP_LOGD("%{public}s, cast temp form to normal form, notify supplier, package:%{public}s, class:%{public}s", + HILOG_DEBUG("%{public}s, cast temp form to normal form, notify supplier, package:%{public}s, class:%{public}s", __func__, record.bundleName.c_str(), record.abilityName.c_str()); sptr castTempConnection = new FormCastTempConnection(formId, record.bundleName, record.abilityName); @@ -618,7 +620,7 @@ ErrCode FormMgrAdapter::HandleCastTempForm(const int64_t formId, const FormRecor want.SetElementName(record.bundleName, record.abilityName); ErrCode errorCode = FormAmsHelper::GetInstance().ConnectServiceAbility(want, castTempConnection); if (errorCode != ERR_OK) { - APP_LOGE("%{public}s fail, ConnectServiceAbility failed.", __func__); + HILOG_ERROR("%{public}s fail, ConnectServiceAbility failed.", __func__); return ERR_APPEXECFWK_FORM_BIND_PROVIDER_FAILED; } return ERR_OK; @@ -651,7 +653,7 @@ int FormMgrAdapter::DumpStorageFormInfos(std::string &formInfos) const */ int FormMgrAdapter::DumpFormInfoByBundleName(const std::string &bundleName, std::string &formInfos) const { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::vector formRecordInfos; if (FormDataMgr::GetInstance().GetFormRecord(bundleName, formRecordInfos)) { FormDumpMgr::GetInstance().DumpFormInfos(formRecordInfos, formInfos); @@ -668,7 +670,7 @@ int FormMgrAdapter::DumpFormInfoByBundleName(const std::string &bundleName, std: */ int FormMgrAdapter::DumpFormInfoByFormId(const std::int64_t formId, std::string &formInfo) const { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int reply = ERR_APPEXECFWK_FORM_NOT_EXIST_ID; FormRecord formRecord; @@ -693,14 +695,14 @@ int FormMgrAdapter::DumpFormInfoByFormId(const std::int64_t formId, std::string */ int FormMgrAdapter::DumpFormTimerByFormId(const std::int64_t formId, std::string &isTimingService) const { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); FormTimer formTimer; UpdateAtItem updateAtItem; DynamicRefreshItem dynamicItem; bool result_inter = FormTimerMgr::GetInstance().GetIntervalTimer(formId, formTimer); bool result_update = FormTimerMgr::GetInstance().GetUpdateAtTimer(formId, updateAtItem); bool result_dynamic = FormTimerMgr::GetInstance().GetDynamicItem(formId, dynamicItem); - APP_LOGI("%{public}s result_inter:%{public}d,result_update:%{public}d,result_dynamic:%{public}d", + HILOG_INFO("%{public}s result_inter:%{public}d,result_update:%{public}d,result_dynamic:%{public}d", __func__, result_inter, result_update, result_dynamic); if (result_inter || result_update || result_dynamic) { isTimingService = "true"; @@ -717,35 +719,35 @@ int FormMgrAdapter::DumpFormTimerByFormId(const std::int64_t formId, std::string */ ErrCode FormMgrAdapter::GetFormConfigInfo(const Want &want, FormItemInfo &formConfigInfo) { - APP_LOGD("GetFormConfigInfo start."); + HILOG_DEBUG("GetFormConfigInfo start."); BundleInfo bundleInfo; std::string packageName; ErrCode errCode = GetBundleInfo(want, bundleInfo, packageName); if (errCode != ERR_OK) { - APP_LOGE("addForm find bundle info failed"); + HILOG_ERROR("addForm find bundle info failed"); return errCode; } FormInfo formInfo; errCode = GetFormInfo(want, formInfo); if (errCode != ERR_OK) { - APP_LOGE("addForm can not find target form info"); + HILOG_ERROR("addForm can not find target form info"); return errCode; } if (!formInfo.IsValid()) { - APP_LOGE("The form info is invalid"); + HILOG_ERROR("The form info is invalid"); return ERR_APPEXECFWK_FORM_GET_INFO_FAILED; } errCode = GetFormItemInfo(want, bundleInfo, formInfo, formConfigInfo); if (errCode != ERR_OK) { - APP_LOGE("get form item info failed."); + HILOG_ERROR("get form item info failed."); return errCode; } formConfigInfo.SetPackageName(packageName); - APP_LOGD("GetFormConfigInfo end."); + HILOG_DEBUG("GetFormConfigInfo end."); return ERR_OK; } /** @@ -763,7 +765,7 @@ ErrCode FormMgrAdapter::AllotFormById(const FormItemInfo &info, FormRecord record; bool hasRecord = FormDataMgr::GetInstance().GetFormRecord(formId, record); if (hasRecord && record.formTempFlg) { - APP_LOGE("%{public}s, addForm can not acquire temp form when select form id", __func__); + HILOG_ERROR("%{public}s, addForm can not acquire temp form when select form id", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } @@ -773,7 +775,7 @@ ErrCode FormMgrAdapter::AllotFormById(const FormItemInfo &info, if (hasRecord && (record.userId == currentUserId || FormDataMgr::GetInstance().IsCallingUidValid(record.formUserUids))) { if (!info.IsMatch(record)) { - APP_LOGE("%{public}s, formId and item info not match:%{public}" PRId64 "", __func__, formId); + HILOG_ERROR("%{public}s, formId and item info not match:%{public}" PRId64 "", __func__, formId); return ERR_APPEXECFWK_FORM_CFG_NOT_MATCH_ID; } return AddExistFormRecord(info, callerToken, record, formId, wantParams, formInfo); @@ -787,7 +789,7 @@ ErrCode FormMgrAdapter::AllotFormById(const FormItemInfo &info, return AddNewFormRecord(info, formId, callerToken, wantParams, formInfo); } - APP_LOGI("%{public}s, addForm no such form %{public}" PRId64 "", __func__, formId); + HILOG_INFO("%{public}s, addForm no such form %{public}" PRId64 "", __func__, formId); // delete form data in provider FormRecord delRecord; @@ -814,12 +816,12 @@ ErrCode FormMgrAdapter::AddExistFormRecord(const FormItemInfo &info, const sptr< const FormRecord &record, const int64_t formId, const WantParams &wantParams, FormJsInfo &formInfo) { - APP_LOGI("%{public}s call, formId:%{public}" PRId64 "", __func__, formId); + HILOG_INFO("%{public}s call, formId:%{public}" PRId64 "", __func__, formId); // allot form host record int callingUid = IPCSkeleton::GetCallingUid(); bool isCreated = FormDataMgr::GetInstance().AllotFormHostRecord(info, callerToken, formId, callingUid); if (!isCreated) { - APP_LOGE("%{public}s fail, AllotFormHostRecord failed when no matched formRecord", __func__); + HILOG_ERROR("%{public}s fail, AllotFormHostRecord failed when no matched formRecord", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } @@ -831,7 +833,7 @@ ErrCode FormMgrAdapter::AddExistFormRecord(const FormItemInfo &info, const sptr< // acquire formInfo from provider ErrCode errorCode = AcquireProviderFormInfoAsync(formId, info, wantParams); if (errorCode != ERR_OK) { - APP_LOGE("%{public}s fail, AcquireProviderFormInfoAsync failed", __func__); + HILOG_ERROR("%{public}s fail, AcquireProviderFormInfoAsync failed", __func__); return errorCode; } } @@ -874,10 +876,10 @@ ErrCode FormMgrAdapter::AllotFormByInfo(const FormItemInfo &info, // generate formId int64_t newFormId = FormDataMgr::GetInstance().GenerateFormId(); if (newFormId < 0) { - APP_LOGE("%{public}s fail, generateFormId no invalid formId", __func__); + HILOG_ERROR("%{public}s fail, generateFormId no invalid formId", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } - APP_LOGD("newFormId:%{public}" PRId64 "", newFormId); + HILOG_DEBUG("newFormId:%{public}" PRId64 "", newFormId); return AddNewFormRecord(info, newFormId, callerToken, wantParams, formInfo); } @@ -894,13 +896,13 @@ ErrCode FormMgrAdapter::AllotFormByInfo(const FormItemInfo &info, ErrCode FormMgrAdapter::AddNewFormRecord(const FormItemInfo &info, const int64_t formId, const sptr &callerToken, const WantParams &wantParams, FormJsInfo &formInfo) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); FormItemInfo newInfo(info); newInfo.SetFormId(formId); // allot form host record int callingUid = IPCSkeleton::GetCallingUid(); if (!FormDataMgr::GetInstance().AllotFormHostRecord(newInfo, callerToken, formId, callingUid)) { - APP_LOGE("%{public}s fail, AllotFormHostRecord failed when no matched formRecord", __func__); + HILOG_ERROR("%{public}s fail, AllotFormHostRecord failed when no matched formRecord", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } @@ -911,7 +913,7 @@ ErrCode FormMgrAdapter::AddNewFormRecord(const FormItemInfo &info, const int64_t // acquire formInfo from provider if (ErrCode errorCode = AcquireProviderFormInfoAsync(formId, newInfo, wantParams); errorCode != ERR_OK) { - APP_LOGE("%{public}s fail, AcquireProviderFormInfoAsync failed", __func__); + HILOG_ERROR("%{public}s fail, AcquireProviderFormInfoAsync failed", __func__); return errorCode; } @@ -936,7 +938,7 @@ ErrCode FormMgrAdapter::AddNewFormRecord(const FormItemInfo &info, const int64_t */ ErrCode FormMgrAdapter::AddFormTimer(const FormRecord &formRecord) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); if (formRecord.isEnableUpdate && !formRecord.formTempFlg) { bool timerRet = false; if (formRecord.updateDuration > 0) { @@ -947,11 +949,11 @@ ErrCode FormMgrAdapter::AddFormTimer(const FormRecord &formRecord) formRecord.updateAtMin, formRecord.userId); } if (!timerRet) { - APP_LOGE("%{public}s fail, add form timer failed", __func__); + HILOG_ERROR("%{public}s fail, add form timer failed", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return ERR_OK; } @@ -966,7 +968,7 @@ ErrCode FormMgrAdapter::AddFormTimer(const FormRecord &formRecord) ErrCode FormMgrAdapter::HandleEventNotify(const std::string &providerKey, const std::vector &formIdsByProvider, const int32_t formVisibleType) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); size_t position = providerKey.find(Constants::NAME_DELIMITER); std::string bundleName = providerKey.substr(0, position); std::string abilityName = providerKey.substr(position + Constants::NAME_DELIMITER.size()); @@ -979,7 +981,7 @@ ErrCode FormMgrAdapter::HandleEventNotify(const std::string &providerKey, const ErrCode errorCode = FormAmsHelper::GetInstance().ConnectServiceAbility(connectWant, formEventNotifyConnection); if (errorCode != ERR_OK) { - APP_LOGE("%{public}s fail, ConnectServiceAbility failed.", __func__); + HILOG_ERROR("%{public}s fail, ConnectServiceAbility failed.", __func__); return ERR_APPEXECFWK_FORM_BIND_PROVIDER_FAILED; } @@ -997,7 +999,7 @@ ErrCode FormMgrAdapter::AcquireProviderFormInfoAsync(const int64_t formId, const FormItemInfo &info, const WantParams &wantParams) { if (formId <= 0) { - APP_LOGE("%{public}s fail, formId should be greater than 0", __func__); + HILOG_ERROR("%{public}s fail, formId should be greater than 0", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } @@ -1008,7 +1010,7 @@ ErrCode FormMgrAdapter::AcquireProviderFormInfoAsync(const int64_t formId, want.AddFlags(Want::FLAG_ABILITY_FORM_ENABLED); ErrCode errorCode = FormAmsHelper::GetInstance().ConnectServiceAbility(want, formAcquireConnection); if (errorCode != ERR_OK) { - APP_LOGE("%{public}s fail, ConnectServiceAbility failed.", __func__); + HILOG_ERROR("%{public}s fail, ConnectServiceAbility failed.", __func__); return ERR_APPEXECFWK_FORM_BIND_PROVIDER_FAILED; } return ERR_OK; @@ -1023,43 +1025,43 @@ ErrCode FormMgrAdapter::AcquireProviderFormInfoAsync(const int64_t formId, */ ErrCode FormMgrAdapter::GetBundleInfo(const AAFwk::Want &want, BundleInfo &bundleInfo, std::string &packageName) { - APP_LOGD("GetBundleMgr start."); + HILOG_DEBUG("GetBundleMgr start."); std::string bundleName = want.GetElement().GetBundleName(); std::string abilityName = want.GetElement().GetAbilityName(); std::string deviceId = want.GetElement().GetDeviceID(); std::string moduleName = want.GetStringParam(Constants::PARAM_MODULE_NAME_KEY); if (bundleName.empty() || abilityName.empty() || moduleName.empty()) { - APP_LOGE("GetBundleInfo bundleName or abilityName or moduleName is invalid"); + HILOG_ERROR("GetBundleInfo bundleName or abilityName or moduleName is invalid"); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } sptr iBundleMgr = FormBmsHelper::GetInstance().GetBundleMgr(); if (iBundleMgr == nullptr) { - APP_LOGE("GetBundleMgr, failed to get IBundleMgr."); + HILOG_ERROR("GetBundleMgr, failed to get IBundleMgr."); return ERR_APPEXECFWK_FORM_GET_BMS_FAILED; } if (!iBundleMgr->GetBundleInfo(bundleName, AppExecFwk::BundleFlag::GET_BUNDLE_WITH_ABILITIES, bundleInfo, FormUtil::GetCurrentAccountId())) { - APP_LOGE("GetBundleInfo, failed to get bundle info."); + HILOG_ERROR("GetBundleInfo, failed to get bundle info."); return ERR_APPEXECFWK_FORM_GET_INFO_FAILED; } bool moduleExist = false; for (const auto &moduleInfo : bundleInfo.moduleNames) { - APP_LOGD("bundleInfo.moduleNames, module name:%{public}s", moduleInfo.c_str()); + HILOG_DEBUG("bundleInfo.moduleNames, module name:%{public}s", moduleInfo.c_str()); if (moduleInfo.compare(moduleName) == 0) { moduleExist = true; break; } } if (!moduleExist) { - APP_LOGE("GetBundleInfo no such module, name:%{public}s", moduleName.c_str()); + HILOG_ERROR("GetBundleInfo no such module, name:%{public}s", moduleName.c_str()); return ERR_APPEXECFWK_FORM_NO_SUCH_MODULE; } packageName = bundleName + moduleName; - APP_LOGD("GetBundleMgr end."); + HILOG_DEBUG("GetBundleMgr end."); return ERR_OK; } /** @@ -1071,19 +1073,19 @@ ErrCode FormMgrAdapter::GetBundleInfo(const AAFwk::Want &want, BundleInfo &bundl */ ErrCode FormMgrAdapter::GetFormInfo(const AAFwk::Want &want, FormInfo &formInfo) { - APP_LOGD("GetFormInfo start."); + HILOG_DEBUG("GetFormInfo start."); std::string bundleName = want.GetElement().GetBundleName(); std::string abilityName = want.GetElement().GetAbilityName(); std::string moduleName = want.GetStringParam(Constants::PARAM_MODULE_NAME_KEY); if (bundleName.empty() || abilityName.empty() || moduleName.empty()) { - APP_LOGE("addForm bundleName or abilityName or moduleName is invalid"); + HILOG_ERROR("addForm bundleName or abilityName or moduleName is invalid"); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } std::vector formInfos {}; ErrCode errCode = FormInfoMgr::GetInstance().GetFormsInfoByModule(bundleName, moduleName, formInfos); if (errCode != ERR_OK) { - APP_LOGE("GetFormsInfoByModule, failed to get form config info."); + HILOG_ERROR("GetFormsInfoByModule, failed to get form config info."); return ERR_APPEXECFWK_FORM_GET_INFO_FAILED; } @@ -1093,7 +1095,7 @@ ErrCode FormMgrAdapter::GetFormInfo(const AAFwk::Want &want, FormInfo &formInfo) if (form.defaultFlag) { formInfo = form; formInfo.moduleName = moduleName; - APP_LOGD("GetFormInfo end."); + HILOG_DEBUG("GetFormInfo end."); return ERR_OK; } } @@ -1102,12 +1104,12 @@ ErrCode FormMgrAdapter::GetFormInfo(const AAFwk::Want &want, FormInfo &formInfo) if (form.name == formName) { formInfo = form; formInfo.moduleName = moduleName; - APP_LOGD("GetFormInfo end."); + HILOG_DEBUG("GetFormInfo end."); return ERR_OK; } } } - APP_LOGE("failed to get form info failed."); + HILOG_ERROR("failed to get form info failed."); return ERR_APPEXECFWK_FORM_GET_INFO_FAILED; } /** @@ -1121,10 +1123,10 @@ ErrCode FormMgrAdapter::GetFormInfo(const AAFwk::Want &want, FormInfo &formInfo) ErrCode FormMgrAdapter::GetFormItemInfo(const AAFwk::Want &want, const BundleInfo &bundleInfo, const FormInfo &formInfo, FormItemInfo &formItemInfo) { - APP_LOGD("GetFormItemInfo start."); + HILOG_DEBUG("GetFormItemInfo start."); int32_t dimensionId = want.GetIntParam(Constants::PARAM_FORM_DIMENSION_KEY, formInfo.defaultDimension); if (!IsDimensionValid(formInfo, dimensionId)) { - APP_LOGE("addForm, dimension is not valid"); + HILOG_ERROR("addForm, dimension is not valid"); return ERR_APPEXECFWK_FORM_NO_SUCH_DIMENSION; } @@ -1134,7 +1136,7 @@ ErrCode FormMgrAdapter::GetFormItemInfo(const AAFwk::Want &want, const BundleInf formItemInfo.SetSpecificationId(dimensionId); formItemInfo.SetTemporaryFlag(want.GetBoolParam(Constants::PARAM_FORM_TEMPORARY_KEY, false)); - APP_LOGD("GetFormItemInfo end."); + HILOG_DEBUG("GetFormItemInfo end."); return ERR_OK; } /** @@ -1146,7 +1148,7 @@ ErrCode FormMgrAdapter::GetFormItemInfo(const AAFwk::Want &want, const BundleInf bool FormMgrAdapter::IsDimensionValid(const FormInfo &formInfo, int dimensionId) const { if (formInfo.supportDimensions.empty()) { - APP_LOGE("Js form, no support dimension."); + HILOG_ERROR("Js form, no support dimension."); return false; } @@ -1157,7 +1159,7 @@ bool FormMgrAdapter::IsDimensionValid(const FormInfo &formInfo, int dimensionId) } } - APP_LOGE("No matched dimension found."); + HILOG_ERROR("No matched dimension found."); return false; } /** @@ -1176,12 +1178,12 @@ ErrCode FormMgrAdapter::CreateFormItemInfo(const BundleInfo &bundleInfo, sptr iBundleMgr = FormBmsHelper::GetInstance().GetBundleMgr(); if (iBundleMgr == nullptr) { - APP_LOGE("GetFormInfo, failed to get IBundleMgr."); + HILOG_ERROR("GetFormInfo, failed to get IBundleMgr."); return ERR_APPEXECFWK_FORM_GET_BMS_FAILED; } std::string hostBundleName {}; if (!iBundleMgr->GetBundleNameForUid(IPCSkeleton::GetCallingUid(), hostBundleName)) { - APP_LOGE("GetFormsInfoByModule, failed to get form config info."); + HILOG_ERROR("GetFormsInfoByModule, failed to get form config info."); return ERR_APPEXECFWK_FORM_GET_INFO_FAILED; } itemInfo.SetHostBundleName(hostBundleName); @@ -1205,9 +1207,9 @@ ErrCode FormMgrAdapter::CreateFormItemInfo(const BundleInfo &bundleInfo, } } - APP_LOGI("%{public}s moduleInfos size: %{public}zu", __func__, bundleInfo.applicationInfo.moduleInfos.size()); + HILOG_INFO("%{public}s moduleInfos size: %{public}zu", __func__, bundleInfo.applicationInfo.moduleInfos.size()); for (const auto &item : bundleInfo.applicationInfo.moduleInfos) { - APP_LOGI("%{public}s moduleInfos, moduleName: %{public}s, moduleSourceDir: %{public}s", __func__, + HILOG_INFO("%{public}s moduleInfos, moduleName: %{public}s, moduleSourceDir: %{public}s", __func__, item.moduleName.c_str(), item.moduleSourceDir.c_str()); if (formInfo.moduleName == item.moduleName) { itemInfo.AddHapSourceDirs(item.moduleSourceDir); @@ -1227,9 +1229,10 @@ ErrCode FormMgrAdapter::CreateFormItemInfo(const BundleInfo &bundleInfo, */ int FormMgrAdapter::SetNextRefreshTime(const int64_t formId, const int64_t nextTime) { - APP_LOGI("%{public}s begin here, formId:%{public}" PRId64 ",nextTime:%{public}" PRId64 "", __func__, formId, nextTime); + HILOG_INFO( + "%{public}s begin here, formId:%{public}" PRId64 ",nextTime:%{public}" PRId64 "", __func__, formId, nextTime); if (formId <= 0) { - APP_LOGE("%{public}s form formId or bundleName is invalid", __func__); + HILOG_ERROR("%{public}s form formId or bundleName is invalid", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } @@ -1241,36 +1244,36 @@ int FormMgrAdapter::SetNextRefreshTime(const int64_t formId, const int64_t nextT // get IBundleMgr sptr iBundleMgr = FormBmsHelper::GetInstance().GetBundleMgr(); if (iBundleMgr == nullptr) { - APP_LOGE("%{public}s error, failed to get IBundleMgr.", __func__); + HILOG_ERROR("%{public}s error, failed to get IBundleMgr.", __func__); return ERR_APPEXECFWK_FORM_GET_BMS_FAILED; } int callingUid = IPCSkeleton::GetCallingUid(); int32_t userId = GetCurrentUserId(callingUid); - APP_LOGI("%{public}s, userId:%{public}d, callingUid:%{public}d.", __func__, userId, callingUid); + HILOG_INFO("%{public}s, userId:%{public}d, callingUid:%{public}d.", __func__, userId, callingUid); int32_t bundleUid = iBundleMgr->GetUidByBundleName(bundleName, userId); if (bundleUid != callingUid) { - APP_LOGE("%{public}s error, permission denied, the form is not your own.", __func__); + HILOG_ERROR("%{public}s error, permission denied, the form is not your own.", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } FormRecord formRecord; int64_t matchedFormId = FormDataMgr::GetInstance().FindMatchedFormId(formId); if (!FormDataMgr::GetInstance().GetFormRecord(matchedFormId, formRecord)) { - APP_LOGE("%{public}s, not found in formrecord.", __func__); + HILOG_ERROR("%{public}s, not found in formrecord.", __func__); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } bool isSelfFormId = (userId == formRecord.userId); if (!isSelfFormId) { - APP_LOGE("%{public}s, not self form:%{public}" PRId64 "", __func__, formId); + HILOG_ERROR("%{public}s, not self form:%{public}" PRId64 "", __func__, formId); return ERR_APPEXECFWK_FORM_OPERATION_NOT_SELF; } // check bundleName if (bundleName != formRecord.bundleName) { - APP_LOGE("%{public}s, not match bundleName:%{public}s", __func__, bundleName.c_str()); + HILOG_ERROR("%{public}s, not match bundleName:%{public}s", __func__, bundleName.c_str()); return ERR_APPEXECFWK_FORM_OPERATION_NOT_SELF; } @@ -1286,19 +1289,19 @@ bool FormMgrAdapter::GetBundleName(std::string &bundleName) { sptr iBundleMgr = FormBmsHelper::GetInstance().GetBundleMgr(); if (iBundleMgr == nullptr) { - APP_LOGE("%{public}s, failed to get IBundleMgr.", __func__); + HILOG_ERROR("%{public}s, failed to get IBundleMgr.", __func__); return false; } int uid = IPCSkeleton::GetCallingUid(); if (!iBundleMgr->CheckIsSystemAppByUid(uid)) { - APP_LOGE("%{public}s fail, form is not system app. uid:%{public}d", __func__, uid); + HILOG_ERROR("%{public}s fail, form is not system app. uid:%{public}d", __func__, uid); return false; } bool result = iBundleMgr->GetBundleNameForUid(uid, bundleName); if (!result || bundleName.empty()) { - APP_LOGE("%{public}s failed, cannot get bundle name by uid:%{public}d", __func__, uid); + HILOG_ERROR("%{public}s failed, cannot get bundle name by uid:%{public}d", __func__, uid); return false; } return true; @@ -1313,16 +1316,16 @@ bool FormMgrAdapter::GetBundleName(std::string &bundleName) */ int FormMgrAdapter::SetNextRefreshtTimeLocked(const int64_t formId, const int64_t nextTime, const int32_t userId) { - APP_LOGE("SetNextRefreshtTimeLocked."); + HILOG_ERROR("SetNextRefreshtTimeLocked."); int32_t timerRefreshedCount = FormTimerMgr::GetInstance().GetRefreshCount(formId); if (timerRefreshedCount >= Constants::LIMIT_COUNT) { - APP_LOGE("%{public}s, already refresh times:%{public}d", __func__, timerRefreshedCount); + HILOG_ERROR("%{public}s, already refresh times:%{public}d", __func__, timerRefreshedCount); FormTimerMgr::GetInstance().MarkRemind(formId); return ERR_APPEXECFWK_FORM_MAX_REFRESH; } if (!FormTimerMgr::GetInstance().SetNextRefreshTime(formId, nextTime * Constants::SEC_PER_MIN, userId)) { - APP_LOGE("%{public}s failed", __func__); + HILOG_ERROR("%{public}s failed", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } @@ -1351,7 +1354,7 @@ bool FormMgrAdapter::IsUpdateValid(const int64_t formId, const std::string &bund */ int FormMgrAdapter::EnableUpdateForm(const std::vector formIDs, const sptr &callerToken) { - APP_LOGI("enableUpdateForm"); + HILOG_INFO("enableUpdateForm"); return HandleUpdateFormFlag(formIDs, callerToken, true); } @@ -1363,7 +1366,7 @@ int FormMgrAdapter::EnableUpdateForm(const std::vector formIDs, const s */ int FormMgrAdapter::DisableUpdateForm(const std::vector formIDs, const sptr &callerToken) { - APP_LOGI("disableUpdateForm"); + HILOG_INFO("disableUpdateForm"); return HandleUpdateFormFlag(formIDs, callerToken, false); } @@ -1376,19 +1379,19 @@ int FormMgrAdapter::DisableUpdateForm(const std::vector formIDs, const */ int FormMgrAdapter::MessageEvent(const int64_t formId, const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (formId <= 0) { - APP_LOGE("%{public}s form formId or bundleName is invalid", __func__); + HILOG_ERROR("%{public}s form formId or bundleName is invalid", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } if (callerToken == nullptr) { - APP_LOGE("%{public}s failed, callerToken can not be NULL", __func__); + HILOG_ERROR("%{public}s failed, callerToken can not be NULL", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } if (!want.HasParameter(Constants::PARAM_MESSAGE_KEY)) { - APP_LOGE("%{public}s failed, message info is not exist", __func__); + HILOG_ERROR("%{public}s failed, message info is not exist", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } @@ -1396,39 +1399,39 @@ int FormMgrAdapter::MessageEvent(const int64_t formId, const Want &want, const s FormRecord record; bool bGetRecord = FormDataMgr::GetInstance().GetFormRecord(matchedFormId, record); if (!bGetRecord) { - APP_LOGE("%{public}s fail, not exist such form:%{public}" PRId64 "", __func__, matchedFormId); + HILOG_ERROR("%{public}s fail, not exist such form:%{public}" PRId64 "", __func__, matchedFormId); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } FormHostRecord formHostRecord; bool isHostExist = FormDataMgr::GetInstance().GetMatchedHostClient(callerToken, formHostRecord); if (!isHostExist) { - APP_LOGE("%{public}s failed, cannot find target client.", __func__); + HILOG_ERROR("%{public}s failed, cannot find target client.", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } if (!formHostRecord.Contains(matchedFormId)) { - APP_LOGE("%{public}s failed, form is not self-owned.", __func__); + HILOG_ERROR("%{public}s failed, form is not self-owned.", __func__); return ERR_APPEXECFWK_FORM_OPERATION_NOT_SELF; } - APP_LOGI("%{public}s, find target client.", __func__); + HILOG_INFO("%{public}s, find target client.", __func__); return FormProviderMgr::GetInstance().MessageEvent(matchedFormId, record, want); } int FormMgrAdapter::HandleUpdateFormFlag(std::vector formIds, const sptr &callerToken, bool flag) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (formIds.empty() || callerToken == nullptr) { - APP_LOGE("%{public}s, invalid param", __func__); + HILOG_ERROR("%{public}s, invalid param", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } std::vector refreshForms; int errCode = FormDataMgr::GetInstance().UpdateHostFormFlag(formIds, callerToken, flag, refreshForms); if (errCode == ERR_OK && refreshForms.size() > 0) { for (const int64_t id : refreshForms) { - APP_LOGI("%{public}s, formRecord need refresh: %{public}" PRId64 "", __func__, id); + HILOG_INFO("%{public}s, formRecord need refresh: %{public}" PRId64 "", __func__, id); Want want; int callingUid = IPCSkeleton::GetCallingUid(); int32_t userId = GetCurrentUserId(callingUid); @@ -1463,20 +1466,20 @@ bool FormMgrAdapter::IsFormCached(const FormRecord record) void FormMgrAdapter::AcquireProviderFormInfo(const int64_t formId, const Want &want, const sptr &remoteObject) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); long connectId = want.GetLongParam(Constants::FORM_CONNECT_ID, 0); sptr formProviderProxy = iface_cast(remoteObject); if (formProviderProxy == nullptr) { FormSupplyCallback::GetInstance()->RemoveConnection(connectId); - APP_LOGE("%{public}s fail, Failed to get formProviderProxy", __func__); + HILOG_ERROR("%{public}s fail, Failed to get formProviderProxy", __func__); return; } int error = formProviderProxy->AcquireProviderFormInfo(formId, want, FormSupplyCallback::GetInstance()); if (error != ERR_OK) { FormSupplyCallback::GetInstance()->RemoveConnection(connectId); - APP_LOGE("%{public}s fail, Failed to get acquire provider form info", __func__); + HILOG_ERROR("%{public}s fail, Failed to get acquire provider form info", __func__); } } @@ -1490,19 +1493,19 @@ void FormMgrAdapter::AcquireProviderFormInfo(const int64_t formId, const Want &w */ void FormMgrAdapter::NotifyFormDelete(const int64_t formId, const Want &want, const sptr &remoteObject) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); long connectId = want.GetLongParam(Constants::FORM_CONNECT_ID, 0); sptr formProviderProxy = iface_cast(remoteObject); if (formProviderProxy == nullptr) { FormSupplyCallback::GetInstance()->RemoveConnection(connectId); - APP_LOGE("%{public}s fail, Failed to get formProviderProxy", __func__); + HILOG_ERROR("%{public}s fail, Failed to get formProviderProxy", __func__); return; } int error = formProviderProxy->NotifyFormDelete(formId, want, FormSupplyCallback::GetInstance()); if (error != ERR_OK) { FormSupplyCallback::GetInstance()->RemoveConnection(connectId); - APP_LOGE("%{public}s fail, Failed to get acquire provider form info", __func__); + HILOG_ERROR("%{public}s fail, Failed to get acquire provider form info", __func__); } } @@ -1513,12 +1516,12 @@ void FormMgrAdapter::NotifyFormDelete(const int64_t formId, const Want &want, co */ int FormMgrAdapter::BatchAddFormRecords(const Want &want) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); ElementName elementName = want.GetElement(); std::string bundleName = elementName.GetBundleName(); std::string abilityName = elementName.GetAbilityName(); int formCount = want.GetIntParam(Constants::PARAM_FORM_ADD_COUNT, 0); - APP_LOGI("%{public}s, batch add form, bundleName: %{public}s, abilityName: %{public}s, count: %{public}d.", + HILOG_INFO("%{public}s, batch add form, bundleName: %{public}s, abilityName: %{public}s, count: %{public}d.", __func__, bundleName.c_str(), abilityName.c_str(), @@ -1529,22 +1532,22 @@ int FormMgrAdapter::BatchAddFormRecords(const Want &want) FormItemInfo formItemInfo; int32_t errCode = GetFormConfigInfo(want, formItemInfo); if (errCode != ERR_OK) { - APP_LOGE("%{public}s fail, get form config info failed.", __func__); + HILOG_ERROR("%{public}s fail, get form config info failed.", __func__); return errCode; } if (!formItemInfo.IsValidItem()) { - APP_LOGE("%{public}s fail, input param itemInfo is invalid", __func__); + HILOG_ERROR("%{public}s fail, input param itemInfo is invalid", __func__); return ERR_APPEXECFWK_FORM_GET_INFO_FAILED; } if (!FormDataMgr::GetInstance().GenerateUdidHash()) { - APP_LOGE("%{public}s fail, generate udid hash failed", __func__); + HILOG_ERROR("%{public}s fail, generate udid hash failed", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } // generate formId int64_t newFormId = FormDataMgr::GetInstance().GenerateFormId(); if (newFormId < 0) { - APP_LOGE("%{public}s fail, generateFormId no invalid formId", __func__); + HILOG_ERROR("%{public}s fail, generateFormId no invalid formId", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } @@ -1554,11 +1557,11 @@ int FormMgrAdapter::BatchAddFormRecords(const Want &want) int32_t currentUserId = GetCurrentUserId(callingUid); // allot form record FormRecord formRecord = FormDataMgr::GetInstance().AllotFormRecord(formItemInfo, callingUid, currentUserId); - APP_LOGI("%{public}s, batch add form, formId:" "%{public}" PRId64 ".", __func__, formRecord.formId); + HILOG_INFO("%{public}s, batch add form, formId:" "%{public}" PRId64 ".", __func__, formRecord.formId); - APP_LOGI("%{public}s, count: %{public}d", __func__, count + 1); + HILOG_INFO("%{public}s, count: %{public}d", __func__, count + 1); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return ERR_OK; } /** @@ -1567,9 +1570,9 @@ int FormMgrAdapter::BatchAddFormRecords(const Want &want) */ int FormMgrAdapter::ClearFormRecords() { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); FormDataMgr::GetInstance().ClearFormRecords(); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return ERR_OK; } /** @@ -1584,7 +1587,7 @@ bool FormMgrAdapter::CreateHandleEventMap(const int64_t matchedFormId, const For std::map> &eventMaps) { if (!formRecord.formVisibleNotify) { - APP_LOGW("%{public}s fail, the config item 'formVisibleNotify' is false, formId:%{public}" PRId64 ".", + HILOG_WARN("%{public}s fail, the config item 'formVisibleNotify' is false, formId:%{public}" PRId64 ".", __func__, matchedFormId); return false; } @@ -1612,20 +1615,20 @@ bool FormMgrAdapter::UpdateProviderInfoToHost(const int64_t matchedFormId, const const int32_t formVisibleType, FormRecord &formRecord) { if (!FormDataMgr::GetInstance().GetFormRecord(matchedFormId, formRecord)) { - APP_LOGW("%{public}s fail, not exist such form, formId:%{public}" PRId64 ".", __func__, matchedFormId); + HILOG_WARN("%{public}s fail, not exist such form, formId:%{public}" PRId64 ".", __func__, matchedFormId); return false; } FormHostRecord formHostRecord; bool hasFormHostRecord = FormDataMgr::GetInstance().GetMatchedHostClient(callerToken, formHostRecord); if (!(hasFormHostRecord && formHostRecord.Contains(matchedFormId))) { - APP_LOGW("%{public}s fail, form is not belong to self, formId:%{public}" PRId64 ".", __func__, matchedFormId); + HILOG_WARN("%{public}s fail, form is not belong to self, formId:%{public}" PRId64 ".", __func__, matchedFormId); return false; } formRecord.formVisibleNotifyState = formVisibleType; if (!FormDataMgr::GetInstance().UpdateFormRecord(matchedFormId, formRecord)) { - APP_LOGW("%{public}s fail, set formVisibleNotifyState error, formId:%{public}" PRId64 ".", + HILOG_WARN("%{public}s fail, set formVisibleNotifyState error, formId:%{public}" PRId64 ".", __func__, matchedFormId); return false; } @@ -1653,14 +1656,14 @@ bool FormMgrAdapter::CheckIsSystemAppByBundleName(const sptr &iBundl BundleInfo bundleInfo; if (iBundleMgr->GetBundleInfo(bundleName, BundleFlag::GET_BUNDLE_DEFAULT, bundleInfo, FormUtil::GetCurrentAccountId())) { - APP_LOGD("%{public}s, get bundle uid success", __func__); + HILOG_DEBUG("%{public}s, get bundle uid success", __func__); if (!iBundleMgr->CheckIsSystemAppByUid(bundleInfo.uid)) { - APP_LOGW("%{public}s fail, form provider is not system app, bundleName: %{public}s", + HILOG_WARN("%{public}s fail, form provider is not system app, bundleName: %{public}s", __func__, bundleName.c_str()); return false; } } else { - APP_LOGW("%{public}s fail, can not get bundleInfo's uid", __func__); + HILOG_WARN("%{public}s fail, can not get bundleInfo's uid", __func__); return false; } @@ -1674,7 +1677,7 @@ bool FormMgrAdapter::CheckIsSystemAppByBundleName(const sptr &iBundl */ int FormMgrAdapter::DistributedDataAddForm(const Want &want) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); FormDBInfo formDBInfo; ElementName elementName = want.GetElement(); diff --git a/services/formmgr/src/form_mgr_service.cpp b/services/formmgr/src/form_mgr_service.cpp index a943be78f8..67468747a8 100644 --- a/services/formmgr/src/form_mgr_service.cpp +++ b/services/formmgr/src/form_mgr_service.cpp @@ -20,7 +20,6 @@ #include #include -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" #include "common_event_manager.h" #include "common_event_support.h" @@ -33,6 +32,7 @@ #include "form_mgr_adapter.h" #include "form_task_mgr.h" #include "form_timer_mgr.h" +#include "hilog_wrapper.h" #include "ipc_skeleton.h" #include "iservice_registry.h" #include "permission/permission.h" @@ -74,7 +74,7 @@ bool FormMgrService::IsReady() const return false; } if (!handler_) { - APP_LOGE("%{public}s fail, handler is null", __func__); + HILOG_ERROR("%{public}s fail, handler is null", __func__); return false; } @@ -94,7 +94,7 @@ int FormMgrService::AddForm(const int64_t formId, const Want &want, { ErrCode ret = CheckFormPermission(); if (ret != ERR_OK) { - APP_LOGE("%{public}s fail, add form permission denied", __func__); + HILOG_ERROR("%{public}s fail, add form permission denied", __func__); return ret; } return FormMgrAdapter::GetInstance().AddForm(formId, want, callerToken, formInfo); @@ -110,7 +110,7 @@ int FormMgrService::DeleteForm(const int64_t formId, const sptr & { ErrCode ret = CheckFormPermission(); if (ret != ERR_OK) { - APP_LOGE("%{public}s fail, delete form permission denied", __func__); + HILOG_ERROR("%{public}s fail, delete form permission denied", __func__); return ret; } @@ -128,7 +128,7 @@ int FormMgrService::ReleaseForm(const int64_t formId, const sptr { ErrCode ret = CheckFormPermission(); if (ret != ERR_OK) { - APP_LOGE("%{public}s fail, release form permission denied", __func__); + HILOG_ERROR("%{public}s fail, release form permission denied", __func__); return ret; } @@ -157,11 +157,11 @@ int FormMgrService::UpdateForm(const int64_t formId, */ int FormMgrService::RequestForm(const int64_t formId, const sptr &callerToken, const Want &want) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); ErrCode ret = CheckFormPermission(); if (ret != ERR_OK) { - APP_LOGE("%{public}s fail, request form permission denied", __func__); + HILOG_ERROR("%{public}s fail, request form permission denied", __func__); return ret; } @@ -177,7 +177,7 @@ int FormMgrService::RequestForm(const int64_t formId, const sptr */ int FormMgrService::SetNextRefreshTime(const int64_t formId, const int64_t nextTime) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); return FormMgrAdapter::GetInstance().SetNextRefreshTime(formId, nextTime); } @@ -195,7 +195,7 @@ int FormMgrService::NotifyWhetherVisibleForms(const std::vector &formId { ErrCode ret = CheckFormPermission(); if (ret != ERR_OK) { - APP_LOGE("%{public}s fail, event notify visible permission denied", __func__); + HILOG_ERROR("%{public}s fail, event notify visible permission denied", __func__); return ret; } @@ -212,7 +212,7 @@ int FormMgrService::CastTempForm(const int64_t formId, const sptr { ErrCode ret = CheckFormPermission(); if (ret != ERR_OK) { - APP_LOGE("%{public}s fail, cast temp form permission denied", __func__); + HILOG_ERROR("%{public}s fail, cast temp form permission denied", __func__); return ret; } @@ -229,11 +229,11 @@ int FormMgrService::CastTempForm(const int64_t formId, const sptr int FormMgrService::LifecycleUpdate(const std::vector &formIds, const sptr &callerToken, const int32_t updateType) { - APP_LOGI("lifecycleUpdate."); + HILOG_INFO("lifecycleUpdate."); ErrCode ret = CheckFormPermission(); if (ret != ERR_OK) { - APP_LOGE("%{public}s fail, delete form permission denied", __func__); + HILOG_ERROR("%{public}s fail, delete form permission denied", __func__); return ret; } @@ -291,10 +291,10 @@ int FormMgrService::DumpFormTimerByFormId(const std::int64_t formId, std::string */ int FormMgrService::MessageEvent(const int64_t formId, const Want &want, const sptr &callerToken) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); ErrCode ret = CheckFormPermission(); if (ret != ERR_OK) { - APP_LOGE("%{public}s fail, request form permission denied", __func__); + HILOG_ERROR("%{public}s fail, request form permission denied", __func__); return ret; } return FormMgrAdapter::GetInstance().MessageEvent(formId, want, callerToken); @@ -323,27 +323,27 @@ int FormMgrService::ClearFormRecords() void FormMgrService::OnStart() { if (state_ == ServiceRunningState::STATE_RUNNING) { - APP_LOGW("%{public}s fail, Failed to start service since it's already running", __func__); + HILOG_WARN("%{public}s fail, Failed to start service since it's already running", __func__); return; } - APP_LOGI("Form Mgr Service start..."); + HILOG_INFO("Form Mgr Service start..."); ErrCode errCode = Init(); if (errCode != ERR_OK) { - APP_LOGE("%{public}s fail, Failed to init, errCode: %{public}08x", __func__, errCode); + HILOG_ERROR("%{public}s fail, Failed to init, errCode: %{public}08x", __func__, errCode); return; } state_ = ServiceRunningState::STATE_RUNNING; - APP_LOGI("Form Mgr Service start success."); + HILOG_INFO("Form Mgr Service start success."); } /** * @brief Stop envent for the form manager service. */ void FormMgrService::OnStop() { - APP_LOGI("stop service"); + HILOG_INFO("stop service"); state_ = ServiceRunningState::STATE_NOT_START; @@ -362,12 +362,12 @@ ErrCode FormMgrService::Init() { runner_ = EventRunner::Create(NAME_FORM_MGR_SERVICE); if (!runner_) { - APP_LOGE("%{public}s fail, Failed to init due to create runner error", __func__); + HILOG_ERROR("%{public}s fail, Failed to init due to create runner error", __func__); return ERR_INVALID_OPERATION; } handler_ = std::make_shared(runner_); if (!handler_) { - APP_LOGE("%{public}s fail, Failed to init due to create handler error", __func__); + HILOG_ERROR("%{public}s fail, Failed to init due to create handler error", __func__); return ERR_INVALID_OPERATION; } FormTaskMgr::GetInstance().SetEventHandler(handler_); @@ -376,7 +376,7 @@ ErrCode FormMgrService::Init() * so it can't affect the TDD test program */ bool ret = Publish(DelayedSingleton::GetInstance().get()); if (!ret) { - APP_LOGE("%{public}s fail, FormMgrService::Init Publish failed!", __func__); + HILOG_ERROR("%{public}s fail, FormMgrService::Init Publish failed!", __func__); return ERR_INVALID_OPERATION; } @@ -396,7 +396,7 @@ ErrCode FormMgrService::Init() FormDbCache::GetInstance().Start(); FormInfoMgr::GetInstance().Start(); - APP_LOGI("init success"); + HILOG_INFO("init success"); return ERR_OK; } @@ -410,7 +410,7 @@ ErrCode FormMgrService::CheckFormPermission() // get IBundleMgr sptr iBundleMgr = FormBmsHelper::GetInstance().GetBundleMgr(); if (iBundleMgr == nullptr) { - APP_LOGE("%{public}s error, failed to get IBundleMgr.", __func__); + HILOG_ERROR("%{public}s error, failed to get IBundleMgr.", __func__); return ERR_APPEXECFWK_FORM_GET_BMS_FAILED; } @@ -425,7 +425,7 @@ ErrCode FormMgrService::CheckFormPermission() if (!isCallingPerm) { return ERR_APPEXECFWK_FORM_PERMISSION_DENY; } - APP_LOGI("Permission verification ok!"); + HILOG_ERROR("Permission verification ok!"); return ERR_OK; } @@ -436,7 +436,7 @@ ErrCode FormMgrService::CheckFormPermission() */ int FormMgrService::DistributedDataAddForm(const Want &want) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); return FormMgrAdapter::GetInstance().DistributedDataAddForm(want); } @@ -447,7 +447,7 @@ int FormMgrService::DistributedDataAddForm(const Want &want) */ int FormMgrService::DistributedDataDeleteForm(const std::string &formId) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); return FormMgrAdapter::GetInstance().DistributedDataDeleteForm(formId); } @@ -458,7 +458,7 @@ int FormMgrService::DistributedDataDeleteForm(const std::string &formId) */ int FormMgrService::GetAllFormsInfo(std::vector &formInfos) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); return FormMgrAdapter::GetInstance().GetAllFormsInfo(formInfos); } @@ -470,7 +470,7 @@ int FormMgrService::GetAllFormsInfo(std::vector &formInfos) */ int FormMgrService::GetFormsInfoByApp(std::string &bundleName, std::vector &formInfos) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); return FormMgrAdapter::GetInstance().GetFormsInfoByApp(bundleName, formInfos); } @@ -484,7 +484,7 @@ int FormMgrService::GetFormsInfoByApp(std::string &bundleName, std::vector &formInfos) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); return FormMgrAdapter::GetInstance().GetFormsInfoByModule(bundleName, moduleName, formInfos); } } // namespace AppExecFwk diff --git a/services/formmgr/src/form_msg_event_connection.cpp b/services/formmgr/src/form_msg_event_connection.cpp index d05cea7f99..a614087ae4 100644 --- a/services/formmgr/src/form_msg_event_connection.cpp +++ b/services/formmgr/src/form_msg_event_connection.cpp @@ -19,10 +19,10 @@ #include #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "form_constants.h" #include "form_supply_callback.h" #include "form_task_mgr.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "message_parcel.h" #include "want.h" @@ -47,9 +47,9 @@ FormMsgEventConnection::FormMsgEventConnection(const int64_t formId, const Want& void FormMsgEventConnection::OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (resultCode != ERR_OK) { - APP_LOGE("%{public}s, abilityName:%{public}s, formId:%{public}" PRId64 ", resultCode:%{public}d", + HILOG_ERROR("%{public}s, abilityName:%{public}s, formId:%{public}" PRId64 ", resultCode:%{public}d", __func__, element.GetAbilityName().c_str(), formId_, resultCode); return; } @@ -61,7 +61,7 @@ void FormMsgEventConnection::OnAbilityConnectDone( eventWant.SetParam(Constants::FORM_CONNECT_ID, this->GetConnectId()); FormTaskMgr::GetInstance().PostFormEventTask(formId_, message, eventWant, remoteObject); } else { - APP_LOGE("%{public}s error, message info is not exist", __func__); + HILOG_ERROR("%{public}s error, message info is not exist", __func__); } } } // namespace AppExecFwk diff --git a/services/formmgr/src/form_provider_mgr.cpp b/services/formmgr/src/form_provider_mgr.cpp index e0e786ff7b..56314c6df1 100644 --- a/services/formmgr/src/form_provider_mgr.cpp +++ b/services/formmgr/src/form_provider_mgr.cpp @@ -16,7 +16,6 @@ #include #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "form_ams_helper.h" #include "form_batch_delete_connection.h" #include "form_cache_mgr.h" @@ -28,6 +27,7 @@ #include "form_record.h" #include "form_refresh_connection.h" #include "form_timer_mgr.h" +#include "hilog_wrapper.h" #include "power_mgr_client.h" namespace OHOS { @@ -42,24 +42,24 @@ FormProviderMgr::~FormProviderMgr(){} */ ErrCode FormProviderMgr::AcquireForm(const int64_t formId, const FormProviderInfo &formProviderInfo) { - APP_LOGD("%{public}s start, formId:%{public}" PRId64 "", __func__, formId); + HILOG_DEBUG("%{public}s start, formId:%{public}" PRId64 "", __func__, formId); if (formId <= 0) { - APP_LOGE("%{public}s fail, formId should be greater than 0", __func__); + HILOG_ERROR("%{public}s fail, formId should be greater than 0", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } FormRecord formRecord; bool isGetFormRecord = FormDataMgr::GetInstance().GetFormRecord(formId, formRecord); if (!isGetFormRecord) { - APP_LOGE("%{public}s fail, not exist such form, formId:%{public}" PRId64 "", __func__, formId); + HILOG_ERROR("%{public}s fail, not exist such form, formId:%{public}" PRId64 "", __func__, formId); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } FormHostRecord clientHost; bool isGetFormHostRecord = FormDataMgr::GetInstance().GetFormHostRecord(formId, clientHost); if (!isGetFormHostRecord) { - APP_LOGE("%{public}s fail, clientHost is null", __func__); + HILOG_ERROR("%{public}s fail, clientHost is null", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } @@ -86,9 +86,9 @@ ErrCode FormProviderMgr::AcquireForm(const int64_t formId, const FormProviderInf // we do not cache when data size is over 1k std::string jsonData = formProviderInfo.GetFormDataString(); // get json data - APP_LOGD("%{public}s , jsonData is %{public}s.", __func__, jsonData.c_str()); + HILOG_DEBUG("%{public}s , jsonData is %{public}s.", __func__, jsonData.c_str()); if (jsonData.size() <= Constants::MAX_FORM_DATA_SIZE) { - APP_LOGW("%{public}s, acquire js card, cache the card", __func__); + HILOG_WARN("%{public}s, acquire js card, cache the card", __func__); FormCacheMgr::GetInstance().AddData(formId, formProviderInfo.GetFormDataString()); } return ERR_OK; @@ -103,20 +103,20 @@ ErrCode FormProviderMgr::AcquireForm(const int64_t formId, const FormProviderInf */ ErrCode FormProviderMgr::RefreshForm(const int64_t formId, const Want &want) { - APP_LOGI("%{public}s called, formId:%{public}" PRId64 ".", __func__, formId); + HILOG_INFO("%{public}s called, formId:%{public}" PRId64 ".", __func__, formId); FormRecord record; bool bGetRecord = FormDataMgr::GetInstance().GetFormRecord(formId, record); if (!bGetRecord) { - APP_LOGE("%{public}s fail, not exist such form:%{public}" PRId64 "", __func__, formId); + HILOG_ERROR("%{public}s fail, not exist such form:%{public}" PRId64 "", __func__, formId); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } // get current userId int32_t currentUserId = want.GetIntParam(Constants::PARAM_FORM_USER_ID, DEFAULT_USER_ID); - APP_LOGI("%{public}s, current user, userId:%{public}d", __func__, currentUserId); + HILOG_INFO("%{public}s, current user, userId:%{public}d", __func__, currentUserId); if (currentUserId != record.userId) { FormDataMgr::GetInstance().SetNeedRefresh(formId, true); - APP_LOGE("%{public}s, not current user, just set refresh flag, userId:%{public}d", __func__, record.userId); + HILOG_ERROR("%{public}s, not current user, just set refresh flag, userId:%{public}d", __func__, record.userId); return ERR_APPEXECFWK_FORM_OPERATION_NOT_SELF; } @@ -131,14 +131,14 @@ ErrCode FormProviderMgr::RefreshForm(const int64_t formId, const Want &want) bool screenOnFlag = PowerMgr::PowerMgrClient::GetInstance().IsScreenOn(); if (!screenOnFlag) { FormDataMgr::GetInstance().SetNeedRefresh(formId, true); - APP_LOGE("%{public}s fail, screen off, set refresh flag, do not refresh now", __func__); + HILOG_ERROR("%{public}s fail, screen off, set refresh flag, do not refresh now", __func__); return ERR_OK; } bool needRefresh = FormDataMgr::GetInstance().IsEnableRefresh(formId); if (!needRefresh) { FormDataMgr::GetInstance().SetNeedRefresh(formId, true); - APP_LOGE("%{public}s fail, no one needReresh, set refresh flag, do not refresh now", __func__); + HILOG_ERROR("%{public}s fail, no one needReresh, set refresh flag, do not refresh now", __func__); return ERR_OK; } @@ -161,7 +161,7 @@ ErrCode FormProviderMgr::RefreshForm(const int64_t formId, const Want &want) ErrCode FormProviderMgr::ConnectAmsForRefresh(const int64_t formId, const FormRecord &record, const Want &want, const bool isTimerRefresh) { - APP_LOGD("%{public}s called, bundleName:%{public}s, abilityName:%{public}s.", + HILOG_DEBUG("%{public}s called, bundleName:%{public}s, abilityName:%{public}s.", __func__, record.bundleName.c_str(), record.abilityName.c_str()); sptr formRefreshConnection = new FormRefreshConnection(formId, want, @@ -172,14 +172,14 @@ ErrCode FormProviderMgr::ConnectAmsForRefresh(const int64_t formId, if (isTimerRefresh) { if (!FormTimerMgr::GetInstance().IsLimiterEnableRefresh(formId)) { - APP_LOGE("%{public}s, timer refresh, already limit.", __func__); + HILOG_ERROR("%{public}s, timer refresh, already limit.", __func__); return ERR_APPEXECFWK_FORM_PROVIDER_DEL_FAIL; } } ErrCode errorCode = FormAmsHelper::GetInstance().ConnectServiceAbility(connectWant, formRefreshConnection); if (errorCode != ERR_OK) { - APP_LOGE("%{public}s, ConnectServiceAbility failed.", __func__); + HILOG_ERROR("%{public}s, ConnectServiceAbility failed.", __func__); return ERR_APPEXECFWK_FORM_BIND_PROVIDER_FAILED; } @@ -199,16 +199,16 @@ ErrCode FormProviderMgr::ConnectAmsForRefresh(const int64_t formId, ErrCode FormProviderMgr::NotifyProviderFormDelete(const int64_t formId, const FormRecord &formRecord) { if (formRecord.abilityName.empty()) { - APP_LOGE("%{public}s, formRecord.abilityName is empty.", __func__); + HILOG_ERROR("%{public}s, formRecord.abilityName is empty.", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } if (formRecord.bundleName.empty()) { - APP_LOGE("%{public}s, formRecord.bundleName is empty.", __func__); + HILOG_ERROR("%{public}s, formRecord.bundleName is empty.", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } - APP_LOGD("%{public}s, connectAbility,bundleName:%{public}s, abilityName:%{public}s", + HILOG_DEBUG("%{public}s, connectAbility,bundleName:%{public}s, abilityName:%{public}s", __func__, formRecord.bundleName.c_str(), formRecord.abilityName.c_str()); sptr formDeleteConnection = new FormDeleteConnection(formId, formRecord.bundleName, formRecord.abilityName); @@ -218,7 +218,7 @@ ErrCode FormProviderMgr::NotifyProviderFormDelete(const int64_t formId, const Fo ErrCode errorCode = FormAmsHelper::GetInstance().ConnectServiceAbility(want, formDeleteConnection); if (errorCode != ERR_OK) { - APP_LOGE("%{public}s, ConnectServiceAbility failed.", __func__); + HILOG_ERROR("%{public}s, ConnectServiceAbility failed.", __func__); return ERR_APPEXECFWK_FORM_BIND_PROVIDER_FAILED; } return ERR_OK; @@ -235,16 +235,16 @@ ErrCode FormProviderMgr::NotifyProviderFormsBatchDelete(const std::string &bundl const std::string &abilityName, const std::set &formIds) { if (abilityName.empty()) { - APP_LOGE("%{public}s error, abilityName is empty.", __func__); + HILOG_ERROR("%{public}s error, abilityName is empty.", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } if (bundleName.empty()) { - APP_LOGE("%{public}s error, bundleName is empty.", __func__); + HILOG_ERROR("%{public}s error, bundleName is empty.", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } - APP_LOGD("%{public}s, bundleName:%{public}s, abilityName:%{public}s", + HILOG_DEBUG("%{public}s, bundleName:%{public}s, abilityName:%{public}s", __func__, bundleName.c_str(), abilityName.c_str()); sptr batchDeleteConnection = new FormBatchDeleteConnection(formIds, bundleName, abilityName); Want want; @@ -253,7 +253,7 @@ ErrCode FormProviderMgr::NotifyProviderFormsBatchDelete(const std::string &bundl ErrCode errorCode = FormAmsHelper::GetInstance().ConnectServiceAbility(want, batchDeleteConnection); if (errorCode != ERR_OK) { - APP_LOGE("%{public}s, ConnectServiceAbility failed.", __func__); + HILOG_ERROR("%{public}s, ConnectServiceAbility failed.", __func__); return ERR_APPEXECFWK_FORM_BIND_PROVIDER_FAILED; } return ERR_OK; @@ -270,7 +270,7 @@ ErrCode FormProviderMgr::UpdateForm(const int64_t formId, const FormProviderInfo // check exist and get the formRecord FormRecord formRecord; if (!FormDataMgr::GetInstance().GetFormRecord(formId, formRecord)) { - APP_LOGE("%{public}s error, not exist such form:%{public}" PRId64 ".", __func__, formId); + HILOG_ERROR("%{public}s error, not exist such form:%{public}" PRId64 ".", __func__, formId); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } return UpdateForm(formId, formRecord, formProviderInfo.GetFormData()); @@ -286,7 +286,7 @@ ErrCode FormProviderMgr::UpdateForm(const int64_t formId, const FormProviderInfo ErrCode FormProviderMgr::UpdateForm(const int64_t formId, FormRecord &formRecord, const FormProviderData &formProviderData) { - APP_LOGI("%{public}s start, imageDateState is %{public}d", __func__, formProviderData.GetImageDataState()); + HILOG_INFO("%{public}s start, imageDateState is %{public}d", __func__, formProviderData.GetImageDataState()); if (formRecord.versionUpgrade) { formRecord.formProviderInfo.SetFormData(formProviderData); formRecord.formProviderInfo.SetUpgradeFlg(true); @@ -319,9 +319,9 @@ ErrCode FormProviderMgr::UpdateForm(const int64_t formId, FormDataMgr::GetInstance().UpdateFormProviderInfo(formId, formRecord.formProviderInfo); // check if cache data size is less than 1k or not std::string jsonData = formRecord.formProviderInfo.GetFormDataString(); // get json data - APP_LOGD("%{public}s screenOn:%{public}d jsonData:%{public}s.", __func__, screenOnFlag, jsonData.c_str()); + HILOG_DEBUG("%{public}s screenOn:%{public}d jsonData:%{public}s.", __func__, screenOnFlag, jsonData.c_str()); if (jsonData.size() <= Constants::MAX_FORM_DATA_SIZE) { - APP_LOGI("%{public}s, updateJsForm, data is less than 1k, cache data.", __func__); + HILOG_INFO("%{public}s, updateJsForm, data is less than 1k, cache data.", __func__); FormCacheMgr::GetInstance().AddData(formId, jsonData); } else { FormCacheMgr::GetInstance().DeleteData(formId); @@ -339,11 +339,11 @@ ErrCode FormProviderMgr::UpdateForm(const int64_t formId, */ int FormProviderMgr::MessageEvent(const int64_t formId, const FormRecord &record, const Want &want) { - APP_LOGI("%{public}s called, formId:%{public}" PRId64 ".", __func__, formId); + HILOG_INFO("%{public}s called, formId:%{public}" PRId64 ".", __func__, formId); bool screenOnFlag = PowerMgr::PowerMgrClient::GetInstance().IsScreenOn(); if (!screenOnFlag) { - APP_LOGW("%{public}s fail, screen off now", __func__); + HILOG_WARN("%{public}s fail, screen off now", __func__); return ERR_APPEXECFWK_FORM_COMMON_CODE; } @@ -355,7 +355,7 @@ int FormProviderMgr::MessageEvent(const int64_t formId, const FormRecord &record ErrCode errorCode = FormAmsHelper::GetInstance().ConnectServiceAbility(connectWant, formMsgEventConnection); if (errorCode != ERR_OK) { - APP_LOGE("%{public}s, ConnectServiceAbility failed.", __func__); + HILOG_ERROR("%{public}s, ConnectServiceAbility failed.", __func__); return ERR_APPEXECFWK_FORM_BIND_PROVIDER_FAILED; } @@ -371,7 +371,7 @@ void FormProviderMgr::IncreaseTimerRefreshCount(const int64_t formId) { FormRecord record; if (!FormDataMgr::GetInstance().GetFormRecord(formId, record)) { - APP_LOGE("%{public}s failed, not exist such form:%{public}" PRId64 ".", __func__, formId); + HILOG_ERROR("%{public}s failed, not exist such form:%{public}" PRId64 ".", __func__, formId); return; } diff --git a/services/formmgr/src/form_refresh_connection.cpp b/services/formmgr/src/form_refresh_connection.cpp index 916ba902fb..d5fe1804b8 100644 --- a/services/formmgr/src/form_refresh_connection.cpp +++ b/services/formmgr/src/form_refresh_connection.cpp @@ -19,10 +19,10 @@ #include #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "form_constants.h" #include "form_supply_callback.h" #include "form_task_mgr.h" +#include "hilog_wrapper.h" #include "ipc_types.h" #include "message_parcel.h" #include "want.h" @@ -47,9 +47,9 @@ FormRefreshConnection::FormRefreshConnection(const int64_t formId, const Want& w void FormRefreshConnection::OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (resultCode != ERR_OK) { - APP_LOGE("%{public}s, abilityName:%{public}s, formId:%{public}" PRId64 ", resultCode:%{public}d", + HILOG_ERROR("%{public}s, abilityName:%{public}s, formId:%{public}" PRId64 ", resultCode:%{public}d", __func__, element.GetAbilityName().c_str(), formId_, resultCode); return; } diff --git a/services/formmgr/src/form_refresh_limiter.cpp b/services/formmgr/src/form_refresh_limiter.cpp index 0cca52ee9e..bc817a3b89 100644 --- a/services/formmgr/src/form_refresh_limiter.cpp +++ b/services/formmgr/src/form_refresh_limiter.cpp @@ -15,8 +15,8 @@ #include -#include "app_log_wrapper.h" #include "form_constants.h" +#include "hilog_wrapper.h" #include "form_refresh_limiter.h" namespace OHOS { @@ -28,17 +28,17 @@ namespace AppExecFwk { */ bool FormRefreshLimiter::AddItem(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); std::lock_guard lock(limiterMutex_); auto info = limiterMap_.find(formId); if (info == limiterMap_.end()) { LimitInfo limitInfo; std::pair::iterator, bool> retVal = limiterMap_.emplace(formId, limitInfo); - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return retVal.second; } else { - APP_LOGI("%{public}s end, already exist", __func__); + HILOG_INFO("%{public}s end, already exist", __func__); return true; } } @@ -48,27 +48,27 @@ bool FormRefreshLimiter::AddItem(const int64_t formId) */ void FormRefreshLimiter::DeleteItem(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); std::lock_guard lock(limiterMutex_); auto info = limiterMap_.find(formId); if (info != limiterMap_.end()) { limiterMap_.erase(formId); } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** * @brief Reset limit info. */ void FormRefreshLimiter::ResetLimit() { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); std::lock_guard lock(limiterMutex_); for (auto &infoPair : limiterMap_) { infoPair.second.refreshCount = 0; infoPair.second.isReported = false; infoPair.second.remindFlag = false; } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** * @brief Refresh enable or not. @@ -77,7 +77,7 @@ void FormRefreshLimiter::ResetLimit() */ bool FormRefreshLimiter::IsEnableRefresh(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); bool isEnable = false; std::lock_guard lock(limiterMutex_); auto info = limiterMap_.find(formId); @@ -88,10 +88,10 @@ bool FormRefreshLimiter::IsEnableRefresh(const int64_t formId) if (info->second.refreshCount == Constants::LIMIT_COUNT && !info->second.isReported) { info->second.isReported = true; - APP_LOGI("report refresh to 50 count,formId:%{public}" PRId64 "", formId); + HILOG_INFO("report refresh to 50 count,formId:%{public}" PRId64 "", formId); } } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return isEnable; } /** @@ -101,7 +101,7 @@ bool FormRefreshLimiter::IsEnableRefresh(const int64_t formId) */ int FormRefreshLimiter::GetRefreshCount(const int64_t formId) const { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); // -1 means not added or already removed. std::lock_guard lock(limiterMutex_); auto info = limiterMap_.find(formId); @@ -109,7 +109,7 @@ int FormRefreshLimiter::GetRefreshCount(const int64_t formId) const return info->second.refreshCount; } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return -1; } /** @@ -118,18 +118,18 @@ int FormRefreshLimiter::GetRefreshCount(const int64_t formId) const */ void FormRefreshLimiter::Increase(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); std::lock_guard lock(limiterMutex_); auto info = limiterMap_.find(formId); if (info != limiterMap_.end()) { info->second.refreshCount++; - APP_LOGI("increase,formId:%{public}" PRId64 ", count:%{public}d", formId, info->second.refreshCount); + HILOG_INFO("increase,formId:%{public}" PRId64 ", count:%{public}d", formId, info->second.refreshCount); if (info->second.refreshCount == Constants::LIMIT_COUNT && !info->second.isReported) { info->second.isReported = true; - APP_LOGI("report refresh to 50 count,formId:%{public}" PRId64 "", formId); + HILOG_INFO("report refresh to 50 count,formId:%{public}" PRId64 "", formId); } } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** * @brief Mark remind flag. @@ -137,7 +137,7 @@ void FormRefreshLimiter::Increase(const int64_t formId) */ void FormRefreshLimiter::MarkRemind(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); std::lock_guard lock(limiterMutex_); auto info = limiterMap_.find(formId); if (info != limiterMap_.end()) { @@ -145,7 +145,7 @@ void FormRefreshLimiter::MarkRemind(const int64_t formId) info->second.remindFlag = true; } } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** * @brief Get remind list. @@ -153,7 +153,7 @@ void FormRefreshLimiter::MarkRemind(const int64_t formId) */ std::vector FormRefreshLimiter::GetRemindList() const { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); std::vector result; std::lock_guard lock(limiterMutex_); for (auto &infoPair : limiterMap_) { @@ -161,7 +161,7 @@ std::vector FormRefreshLimiter::GetRemindList() const result.emplace_back(infoPair.first); } } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return result; } /** @@ -170,7 +170,7 @@ std::vector FormRefreshLimiter::GetRemindList() const */ std::vector FormRefreshLimiter::GetRemindListAndResetLimit() { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); std::vector result; std::lock_guard lock(limiterMutex_); for (auto &infoPair : limiterMap_) { @@ -182,7 +182,7 @@ std::vector FormRefreshLimiter::GetRemindListAndResetLimit() infoPair.second.isReported = false; infoPair.second.remindFlag = false; } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return result; } /** diff --git a/services/formmgr/src/form_storage_mgr.cpp b/services/formmgr/src/form_storage_mgr.cpp index 9b5441bc05..5a3de8caf7 100644 --- a/services/formmgr/src/form_storage_mgr.cpp +++ b/services/formmgr/src/form_storage_mgr.cpp @@ -24,8 +24,8 @@ #include #include -#include "app_log_wrapper.h" #include "form_storage_mgr.h" +#include "hilog_wrapper.h" #include "kvstore_death_recipient_callback.h" #include "securec.h" #include "string_ex.h" @@ -40,14 +40,14 @@ const int32_t SLEEP_INTERVAL = 100 * 1000; // 100ms FormStorageMgr::FormStorageMgr() { - APP_LOGI("instance:%{private}p is created", this); + HILOG_INFO("instance:%{private}p is created", this); TryTwice([this] { return GetKvStore(); }); RegisterKvStoreDeathListener(); } FormStorageMgr::~FormStorageMgr() { - APP_LOGI("instance:%{private}p is destroyed", this); + HILOG_INFO("instance:%{private}p is destroyed", this); dataManager_.CloseKvStore(appId_, kvStorePtr_); } @@ -60,7 +60,7 @@ void FormStorageMgr::SaveEntries( nlohmann::json jsonObject = nlohmann::json::parse(item.value.ToString(), nullptr, false); if (jsonObject.is_discarded()) { - APP_LOGE("error key: %{private}s", item.key.ToString().c_str()); + HILOG_ERROR("error key: %{private}s", item.key.ToString().c_str()); // it's an bad json, delete it { std::lock_guard lock(kvStorePtrMutex_); @@ -69,7 +69,7 @@ void FormStorageMgr::SaveEntries( continue; } if (innerFormInfo.FromJson(jsonObject) != true) { - APP_LOGE("error key: %{private}s", item.key.ToString().c_str()); + HILOG_ERROR("error key: %{private}s", item.key.ToString().c_str()); // it's an error value, delete it { std::lock_guard lock(kvStorePtrMutex_); @@ -79,13 +79,13 @@ void FormStorageMgr::SaveEntries( } if (std::find(innerFormInfos.begin(), innerFormInfos.end(), innerFormInfo) == innerFormInfos.end()) { - APP_LOGD("emplace FormInfos: %{public}s", formId.c_str()); + HILOG_DEBUG("emplace FormInfos: %{public}s", formId.c_str()); std::map allDevicesInfos; allDevicesInfos.emplace(formId, innerFormInfo); innerFormInfos.emplace_back(innerFormInfo); } } - APP_LOGD("SaveEntries end"); + HILOG_DEBUG("SaveEntries end"); } /** @@ -95,12 +95,12 @@ void FormStorageMgr::SaveEntries( */ ErrCode FormStorageMgr::LoadFormData(std::vector &innerFormInfos) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); bool ret = ERR_OK; { std::lock_guard lock(kvStorePtrMutex_); if (!CheckKvStore()) { - APP_LOGE("kvStore is nullptr"); + HILOG_ERROR("kvStore is nullptr"); return ERR_APPEXECFWK_FORM_COMMON_CODE; } } @@ -112,13 +112,13 @@ ErrCode FormStorageMgr::LoadFormData(std::vector &innerFormInfos) }); if (status != DistributedKv::Status::SUCCESS) { - APP_LOGE("get entries error: %{public}d", status); + HILOG_ERROR("get entries error: %{public}d", status); ret = ERR_APPEXECFWK_FORM_COMMON_CODE; } else { SaveEntries(allEntries, innerFormInfos); } - APP_LOGI("%{public}s, readdir over", __func__); + HILOG_INFO("%{public}s, readdir over", __func__); return ret; } @@ -130,12 +130,12 @@ ErrCode FormStorageMgr::LoadFormData(std::vector &innerFormInfos) ErrCode FormStorageMgr::GetStorageFormInfoById(const std::string &formId, InnerFormInfo &innerFormInfo) { ErrCode ret = ERR_OK; - APP_LOGD("%{public}s called, formId[%{public}s]", __func__, formId.c_str()); + HILOG_DEBUG("%{public}s called, formId[%{public}s]", __func__, formId.c_str()); { std::lock_guard lock(kvStorePtrMutex_); if (!CheckKvStore()) { - APP_LOGE("kvStore is nullptr"); + HILOG_ERROR("kvStore is nullptr"); return ERR_APPEXECFWK_FORM_COMMON_CODE; } } @@ -149,20 +149,20 @@ ErrCode FormStorageMgr::GetStorageFormInfoById(const std::string &formId, InnerF } if (status != DistributedKv::Status::SUCCESS) { - APP_LOGE("get entries error: %{public}d", status); + HILOG_ERROR("get entries error: %{public}d", status); ret = ERR_APPEXECFWK_FORM_COMMON_CODE; } else { if (allEntries.empty()) { - APP_LOGE("%{public}s not match any FormInfo", formId.c_str()); + HILOG_ERROR("%{public}s not match any FormInfo", formId.c_str()); ret = ERR_APPEXECFWK_FORM_COMMON_CODE; } else { nlohmann::json jsonObject = nlohmann::json::parse(allEntries.front().value.ToString(), nullptr, false); if (jsonObject.is_discarded()) { - APP_LOGE("error key: %{private}s", allEntries.front().key.ToString().c_str()); + HILOG_ERROR("error key: %{private}s", allEntries.front().key.ToString().c_str()); ret = ERR_APPEXECFWK_FORM_COMMON_CODE; } if (innerFormInfo.FromJson(jsonObject) != true) { - APP_LOGE("error key: %{private}s", allEntries.front().key.ToString().c_str()); + HILOG_ERROR("error key: %{private}s", allEntries.front().key.ToString().c_str()); ret = ERR_APPEXECFWK_FORM_COMMON_CODE; } } @@ -178,14 +178,14 @@ ErrCode FormStorageMgr::GetStorageFormInfoById(const std::string &formId, InnerF */ ErrCode FormStorageMgr::SaveStorageFormInfo(const InnerFormInfo &innerFormInfo) { - APP_LOGI("%{public}s called, formId[%{public}" PRId64 "]", __func__, innerFormInfo.GetFormId()); + HILOG_INFO("%{public}s called, formId[%{public}" PRId64 "]", __func__, innerFormInfo.GetFormId()); ErrCode ret = ERR_OK; std::string formId = std::to_string(innerFormInfo.GetFormId()); { std::lock_guard lock(kvStorePtrMutex_); if (!CheckKvStore()) { - APP_LOGE("kvStore is nullptr"); + HILOG_ERROR("kvStore is nullptr"); return ERR_APPEXECFWK_FORM_COMMON_CODE; } } @@ -198,11 +198,11 @@ ErrCode FormStorageMgr::SaveStorageFormInfo(const InnerFormInfo &innerFormInfo) status = kvStorePtr_->Put(key, value); if (status == DistributedKv::Status::IPC_ERROR) { status = kvStorePtr_->Put(key, value); - APP_LOGW("distribute database ipc error and try to call again, result = %{public}d", status); + HILOG_WARN("distribute database ipc error and try to call again, result = %{public}d", status); } } if (status != DistributedKv::Status::SUCCESS) { - APP_LOGE("put innerFormInfo to kvStore error: %{public}d", status); + HILOG_ERROR("put innerFormInfo to kvStore error: %{public}d", status); ret = ERR_APPEXECFWK_FORM_COMMON_CODE; } return ret; @@ -215,7 +215,7 @@ ErrCode FormStorageMgr::SaveStorageFormInfo(const InnerFormInfo &innerFormInfo) */ ErrCode FormStorageMgr::ModifyStorageFormInfo(const InnerFormInfo &innerFormInfo) { - APP_LOGI("%{public}s called, formId[%{public}" PRId64 "]", __func__, innerFormInfo.GetFormId()); + HILOG_INFO("%{public}s called, formId[%{public}" PRId64 "]", __func__, innerFormInfo.GetFormId()); ErrCode ret = ERR_OK; std::string formId = std::to_string(innerFormInfo.GetFormId()); @@ -234,12 +234,12 @@ ErrCode FormStorageMgr::ModifyStorageFormInfo(const InnerFormInfo &innerFormInfo */ ErrCode FormStorageMgr::DeleteStorageFormInfo(const std::string &formId) { - APP_LOGI("%{public}s called, formId[%{public}s]", __func__, formId.c_str()); + HILOG_INFO("%{public}s called, formId[%{public}s]", __func__, formId.c_str()); { std::lock_guard lock(kvStorePtrMutex_); if (!CheckKvStore()) { - APP_LOGE("kvStore is nullptr"); + HILOG_ERROR("kvStore is nullptr"); return ERR_APPEXECFWK_FORM_COMMON_CODE; } } @@ -251,15 +251,15 @@ ErrCode FormStorageMgr::DeleteStorageFormInfo(const std::string &formId) status = kvStorePtr_->Delete(key); if (status == DistributedKv::Status::IPC_ERROR) { status = kvStorePtr_->Delete(key); - APP_LOGW("distribute database ipc error and try to call again, result = %{public}d", status); + HILOG_WARN("distribute database ipc error and try to call again, result = %{public}d", status); } } if (status != DistributedKv::Status::SUCCESS) { - APP_LOGE("delete key error: %{public}d", status); + HILOG_ERROR("delete key error: %{public}d", status); return ERR_APPEXECFWK_FORM_COMMON_CODE; } else { - APP_LOGE("delete value to kvStore success"); + HILOG_ERROR("delete value to kvStore success"); } return ERR_OK; @@ -267,7 +267,7 @@ ErrCode FormStorageMgr::DeleteStorageFormInfo(const std::string &formId) void FormStorageMgr::RegisterKvStoreDeathListener() { - APP_LOGI("register kvStore death listener"); + HILOG_INFO("register kvStore death listener"); std::shared_ptr callback = std::make_shared(); dataManager_.RegisterKvStoreServiceDeathRecipient(callback); @@ -284,7 +284,7 @@ bool FormStorageMgr::CheckKvStore() if (status == DistributedKv::Status::SUCCESS && kvStorePtr_ != nullptr) { return true; } - APP_LOGD("CheckKvStore, Times: %{public}d", tryTimes); + HILOG_DEBUG("CheckKvStore, Times: %{public}d", tryTimes); usleep(SLEEP_INTERVAL); tryTimes--; } @@ -302,9 +302,9 @@ DistributedKv::Status FormStorageMgr::GetKvStore() DistributedKv::Status status = dataManager_.GetSingleKvStore(options, appId_, storeId_, kvStorePtr_); if (status != DistributedKv::Status::SUCCESS) { - APP_LOGE("return error: %{public}d", status); + HILOG_ERROR("return error: %{public}d", status); } else { - APP_LOGI("get kvStore success"); + HILOG_INFO("get kvStore success"); } return status; } @@ -318,7 +318,7 @@ DistributedKv::Status FormStorageMgr::GetEntries(std::vectorGetEntries(key, allEntries); } - APP_LOGI("get all entries status: %{public}d", status); + HILOG_INFO("get all entries status: %{public}d", status); return status; } @@ -327,7 +327,7 @@ void FormStorageMgr::TryTwice(const std::function &func DistributedKv::Status status = func(); if (status == DistributedKv::Status::IPC_ERROR) { status = func(); - APP_LOGW("distribute database ipc error and try to call again, result = %{public}d", status); + HILOG_WARN("distribute database ipc error and try to call again, result = %{public}d", status); } } @@ -339,7 +339,7 @@ bool FormStorageMgr::ResetKvStore() if (status == DistributedKv::Status::SUCCESS && kvStorePtr_ != nullptr) { return true; } - APP_LOGW("failed"); + HILOG_WARN("failed"); return false; } } // namespace AppExecFwk diff --git a/services/formmgr/src/form_supply_callback.cpp b/services/formmgr/src/form_supply_callback.cpp index a57025167c..e5aeac0362 100644 --- a/services/formmgr/src/form_supply_callback.cpp +++ b/services/formmgr/src/form_supply_callback.cpp @@ -16,12 +16,12 @@ #include #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "form_ams_helper.h" #include "form_constants.h" #include "form_provider_mgr.h" #include "form_supply_callback.h" #include "form_util.h" +#include "hilog_wrapper.h" #include "string_ex.h" namespace OHOS { @@ -48,23 +48,23 @@ sptr FormSupplyCallback::GetInstance() */ int FormSupplyCallback::OnAcquire(const FormProviderInfo &formProviderInfo, const Want &want) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); long connectId = want.GetLongParam(Constants::FORM_CONNECT_ID, 0); int errCode = want.GetIntParam(Constants::PROVIDER_FLAG, ERR_OK); if (errCode != ERR_OK) { RemoveConnection(connectId); - APP_LOGE("%{public}s error, errCode: %{public}d", __func__, errCode); + HILOG_ERROR("%{public}s error, errCode: %{public}d", __func__, errCode); return errCode; } std::string strFormId = want.GetStringParam(Constants::PARAM_FORM_IDENTITY_KEY); if (strFormId.empty()) { - APP_LOGE("%{public}s error, formId is empty.", __func__); + HILOG_ERROR("%{public}s error, formId is empty.", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } int64_t formId = std::stoll(strFormId); int type = want.GetIntParam(Constants::ACQUIRE_TYPE, 0); - APP_LOGD("%{public}s come: %{public}" PRId64 ", %{public}ld, %{public}d", __func__, + HILOG_DEBUG("%{public}s come: %{public}" PRId64 ", %{public}ld, %{public}d", __func__, formId, connectId, type); RemoveConnection(connectId); @@ -74,9 +74,9 @@ int FormSupplyCallback::OnAcquire(const FormProviderInfo &formProviderInfo, cons case Constants::ACQUIRE_TYPE_RECREATE_FORM: return FormProviderMgr::GetInstance().UpdateForm(formId, formProviderInfo); default: - APP_LOGW("%{public}s warning, onAcquired type: %{public}d", __func__, type); + HILOG_WARN("%{public}s warning, onAcquired type: %{public}d", __func__, type); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return ERR_APPEXECFWK_FORM_INVALID_PARAM; } @@ -87,12 +87,12 @@ int FormSupplyCallback::OnAcquire(const FormProviderInfo &formProviderInfo, cons */ int FormSupplyCallback::OnEventHandle(const Want &want) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); long connectId = want.GetLongParam(Constants::FORM_CONNECT_ID, 0); std::string supplyInfo = want.GetStringParam(Constants::FORM_SUPPLY_INFO); - APP_LOGD("%{public}s come: %{public}ld, %{public}s", __func__, connectId, supplyInfo.c_str()); + HILOG_DEBUG("%{public}s come: %{public}ld, %{public}s", __func__, connectId, supplyInfo.c_str()); RemoveConnection(connectId); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); return ERR_OK; } /** @@ -101,7 +101,7 @@ int FormSupplyCallback::OnEventHandle(const Want &want) */ void FormSupplyCallback::AddConnection(sptr connection) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::lock_guard lock_l(conMutex_); long connectKey = FormUtil::GetCurrentMillisecond(); while (connections_.find(connectKey) != connections_.end()) { @@ -109,7 +109,7 @@ void FormSupplyCallback::AddConnection(sptr connection) } connection->SetConnectId(connectKey); connections_.emplace(connectKey, connection); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -118,7 +118,7 @@ void FormSupplyCallback::AddConnection(sptr connection) */ void FormSupplyCallback::RemoveConnection(long connectId) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); std::lock_guard lock_l(conMutex_); auto conIterator = connections_.find(connectId); if (conIterator != connections_.end()) { @@ -126,15 +126,15 @@ void FormSupplyCallback::RemoveConnection(long connectId) if (connection != nullptr) { if (CanDisConnect(connection)) { FormAmsHelper::GetInstance().DisConnectServiceAbility(connection); - APP_LOGI("%{public}s end, disconnect service ability", __func__); + HILOG_INFO("%{public}s end, disconnect service ability", __func__); } else { FormAmsHelper::GetInstance().DisConnectServiceAbilityDelay(connection); - APP_LOGI("%{public}s end, disconnect service ability delay", __func__); + HILOG_INFO("%{public}s end, disconnect service ability delay", __func__); } } connections_.erase(connectId); } - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** * @brief check if disconnect ability or not. @@ -142,19 +142,19 @@ void FormSupplyCallback::RemoveConnection(long connectId) */ bool FormSupplyCallback::CanDisConnect(sptr &connection) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); int count = 0; for(auto &conn : connections_) { if (connection->GetProviderKey() == conn.second->GetProviderKey()) { - APP_LOGI("%{public}s, key: %{public}s", __func__, conn.second->GetProviderKey().c_str()); + HILOG_INFO("%{public}s, key: %{public}s", __func__, conn.second->GetProviderKey().c_str()); count++; if (count > 1) { - APP_LOGI("%{public}s end, true.", __func__); + HILOG_INFO("%{public}s end, true.", __func__); return true; } } } - APP_LOGI("%{public}s end, false.", __func__); + HILOG_INFO("%{public}s end, false.", __func__); return false; } } // namespace AppExecFwk diff --git a/services/formmgr/src/form_sys_event_receiver.cpp b/services/formmgr/src/form_sys_event_receiver.cpp index 797782fad7..4c772ac000 100644 --- a/services/formmgr/src/form_sys_event_receiver.cpp +++ b/services/formmgr/src/form_sys_event_receiver.cpp @@ -15,7 +15,6 @@ #include -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" #include "bundle_info.h" #include "common_event_manager.h" @@ -31,6 +30,7 @@ #include "form_sys_event_receiver.h" #include "form_timer_mgr.h" #include "form_util.h" +#include "hilog_wrapper.h" #include "want.h" namespace OHOS { @@ -54,24 +54,24 @@ void FormSysEventReceiver::OnReceiveEvent(const EventFwk::CommonEventData &event std::string action = want.GetAction(); std::string bundleName = want.GetElement().GetBundleName(); if (action.empty() || bundleName.empty()) { - APP_LOGE("%{public}s failed, invalid param, action: %{public}s, bundleName: %{public}s", + HILOG_ERROR("%{public}s failed, invalid param, action: %{public}s, bundleName: %{public}s", __func__, action.c_str(), bundleName.c_str()); return; } - APP_LOGI("%{public}s, action:%{public}s.", __func__, action.c_str()); + HILOG_INFO("%{public}s, action:%{public}s.", __func__, action.c_str()); if (action == EventFwk::CommonEventSupport::COMMON_EVENT_PACKAGE_ADDED || action == EventFwk::CommonEventSupport::COMMON_EVENT_PACKAGE_CHANGED) { // install or update - APP_LOGI("%{public}s, bundle changed, bundleName: %{public}s", __func__, bundleName.c_str()); + HILOG_INFO("%{public}s, bundle changed, bundleName: %{public}s", __func__, bundleName.c_str()); int userId = want.GetIntParam(KEY_USER_ID, 0); HandleProviderUpdated(bundleName, userId); HandleBundleFormInfoChanged(bundleName); } else if (action == EventFwk::CommonEventSupport::COMMON_EVENT_PACKAGE_REMOVED) { - APP_LOGI("%{public}s, bundle removed, bundleName: %{public}s", __func__, bundleName.c_str()); + HILOG_INFO("%{public}s, bundle removed, bundleName: %{public}s", __func__, bundleName.c_str()); HandleProviderRemoved(bundleName); HandleBundleFormInfoRemoved(bundleName); } else if (action == EventFwk::CommonEventSupport::COMMON_EVENT_ABILITY_UPDATED) { - APP_LOGI("%{public}s, bundle updated, bundleName: %{public}s", __func__, bundleName.c_str()); + HILOG_INFO("%{public}s, bundle updated, bundleName: %{public}s", __func__, bundleName.c_str()); int userId = want.GetIntParam(KEY_USER_ID, 0); HandleProviderUpdated(bundleName, userId); } else if (action == EventFwk::CommonEventSupport::COMMON_EVENT_PACKAGE_DATA_CLEARED) { @@ -80,12 +80,12 @@ void FormSysEventReceiver::OnReceiveEvent(const EventFwk::CommonEventData &event } else if (action == EventFwk::CommonEventSupport::COMMON_EVENT_UID_REMOVED) { int32_t userId = want.GetIntParam(KEY_USER_ID, -1); if (userId == -1) { - APP_LOGE("%{public}s, failed to get userId, bundleName: %{public}s", __func__, bundleName.c_str()); + HILOG_ERROR("%{public}s, failed to get userId, bundleName: %{public}s", __func__, bundleName.c_str()); return; } HandleUserIdRemoved(userId); } else { - APP_LOGW("%{public}s warnning, invalid action.", __func__); + HILOG_WARN("%{public}s warnning, invalid action.", __func__); } } /** @@ -96,10 +96,10 @@ void FormSysEventReceiver::OnReceiveEvent(const EventFwk::CommonEventData &event */ void FormSysEventReceiver::HandleProviderUpdated(const std::string &bundleName, const int userId) { - APP_LOGI("%{public}s, bundleName:%{public}s, userId:%{public}d.", __func__, bundleName.c_str(), userId); + HILOG_INFO("%{public}s, bundleName:%{public}s, userId:%{public}d.", __func__, bundleName.c_str(), userId); std::vector formInfos; if (!FormDataMgr::GetInstance().GetFormRecord(bundleName, formInfos)) { - APP_LOGI("%{public}s, no form info.", __func__); + HILOG_INFO("%{public}s, no form info.", __func__); return; } @@ -111,21 +111,21 @@ void FormSysEventReceiver::HandleProviderUpdated(const std::string &bundleName, std::vector targetForms; if (!iBundleMgr->GetFormsInfoByApp(bundleName, targetForms)) { - APP_LOGE("%{public}s error, failed to get forms info.", __func__); + HILOG_ERROR("%{public}s error, failed to get forms info.", __func__); return; } std::vector removedForms; std::vector updatedForms; for (FormRecord& formRecord : formInfos) { - APP_LOGI("%{public}s, provider update, formName:%{public}s", __func__, formRecord.formName.c_str()); + HILOG_INFO("%{public}s, provider update, formName:%{public}s", __func__, formRecord.formName.c_str()); int64_t formId = formRecord.formId; if (ProviderFormUpdated(formId, formRecord, targetForms)) { updatedForms.emplace_back(formId); continue; } - APP_LOGI("%{public}s, no such form anymore, delete it:%{public}s", __func__, formRecord.formName.c_str()); + HILOG_INFO("%{public}s, no such form anymore, delete it:%{public}s", __func__, formRecord.formName.c_str()); (!formRecord.formTempFlg) ? FormDbCache::GetInstance().DeleteFormInfo(formId) : FormDataMgr::GetInstance().DeleteTempForm(formId); removedForms.emplace_back(formId); @@ -133,16 +133,16 @@ void FormSysEventReceiver::HandleProviderUpdated(const std::string &bundleName, } if (!removedForms.empty()) { - APP_LOGI("%{public}s, clean removed forms", __func__); + HILOG_INFO("%{public}s, clean removed forms", __func__); FormDataMgr::GetInstance().CleanHostRemovedForms(removedForms); } - APP_LOGI("%{public}s, remove form timer", __func__); + HILOG_INFO("%{public}s, remove form timer", __func__); for (const int64_t id : removedForms) { FormTimerMgr::GetInstance().RemoveFormTimer(id); } - APP_LOGI("%{public}s, refresh form", __func__); + HILOG_INFO("%{public}s, refresh form", __func__); Want want; want.SetParam(Constants::PARAM_FORM_USER_ID, userId); for (const int64_t id : updatedForms) { @@ -152,7 +152,7 @@ void FormSysEventReceiver::HandleProviderUpdated(const std::string &bundleName, void FormSysEventReceiver::HandleProviderRemoved(const std::string &bundleName) { - APP_LOGI("GET into HandleProviderRemoved with bundleName : %{public}s", bundleName.c_str()); + HILOG_INFO("GET into HandleProviderRemoved with bundleName : %{public}s", bundleName.c_str()); // clean removed form in DB std::set removedForms; { @@ -184,16 +184,16 @@ void FormSysEventReceiver::HandleProviderRemoved(const std::string &bundleName) bool FormSysEventReceiver::ProviderFormUpdated(const int64_t formId, const FormRecord &formRecord, const std::vector &targetForms) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); if (targetForms.empty()) { - APP_LOGE("%{public}s error, targetForms is empty", __func__); + HILOG_ERROR("%{public}s error, targetForms is empty", __func__); return false; } FormInfo updatedForm; bool bGetForm = FormDataMgr::GetInstance().GetUpdatedForm(formRecord, targetForms, updatedForm); if (bGetForm) { - APP_LOGI("%{public}s, form is still exist,form:%{public}s", __func__, formRecord.formName.c_str()); + HILOG_INFO("%{public}s, form is still exist,form:%{public}s", __func__, formRecord.formName.c_str()); // update resource FormDataMgr::GetInstance().SetNeedRefresh(formId, true); FormCacheMgr::GetInstance().DeleteData(formId); @@ -206,7 +206,7 @@ bool FormSysEventReceiver::ProviderFormUpdated(const int64_t formId, FormDataMgr::GetInstance().SetVersionUpgrade(formId, true); return true; } - APP_LOGI("%{public}s, no updated form.", __func__); + HILOG_INFO("%{public}s, no updated form.", __func__); return false; } @@ -222,7 +222,7 @@ void FormSysEventReceiver::HandleBundleFormInfoRemoved(const std::string &bundle void FormSysEventReceiver::HandleBundleDataCleared(const std::string &bundleName, const int uid) { - APP_LOGD("%{public}s, bundleName:%{public}s, uid:%{public}d", __func__, bundleName.c_str(), uid); + HILOG_DEBUG("%{public}s, bundleName:%{public}s, uid:%{public}d", __func__, bundleName.c_str(), uid); // as provider data is cleared std::set reCreateForms; FormDataMgr::GetInstance().GetReCreateFormRecordsByBundleName(bundleName, reCreateForms); @@ -237,7 +237,7 @@ void FormSysEventReceiver::HandleBundleDataCleared(const std::string &bundleName } void FormSysEventReceiver::HandleFormHostDataCleared(const int uid) { - APP_LOGD("%{public}s, uid:%{public}d", __func__, uid); + HILOG_DEBUG("%{public}s, uid:%{public}d", __func__, uid); std::map removedFormsMap; // clear formDBRecord ClearFormDBRecordData(uid, removedFormsMap); @@ -266,7 +266,7 @@ void FormSysEventReceiver::ClearFormDBRecordData(const int uid, std::map 0) { BatchDeleteNoHostDBForms(uid, noHostFormDbMap, foundFormsMap); } @@ -280,7 +280,7 @@ void FormSysEventReceiver::ClearTempFormRecordData(const int uid, std::map foundFormsMap; std::map> noHostTempFormsMap; FormDataMgr::GetInstance().GetNoHostTempForms(uid, noHostTempFormsMap, foundFormsMap); - APP_LOGD("%{public}s, noHostTempFormsMap size:%{public}zu", __func__, noHostTempFormsMap.size()); + HILOG_DEBUG("%{public}s, noHostTempFormsMap size:%{public}zu", __func__, noHostTempFormsMap.size()); if (noHostTempFormsMap.size() > 0) { BatchDeleteNoHostTempForms(uid, noHostTempFormsMap, foundFormsMap); } @@ -299,7 +299,7 @@ void FormSysEventReceiver::BatchDeleteNoHostDBForms(const int uid, std::map
0) { // interval timer - APP_LOGI("%{public}s,interval timer updateDuration:%{public}d", __func__, updateDuration); + HILOG_INFO("%{public}s,interval timer updateDuration:%{public}d", __func__, updateDuration); if (updateDuration <= Constants::MIN_CONFIG_DURATION) { cfg.updateDuration = Constants::MIN_PERIOD; } else if (updateDuration >= Constants::MAX_CONFIG_DURATION) { @@ -414,14 +414,14 @@ void FormSysEventReceiver::GetTimerCfg(const bool updateEnabled, } else { // updateAtTimer if (configUpdateAt.empty()) { - APP_LOGI("%{public}s, configUpdateAt is empty", __func__); + HILOG_INFO("%{public}s, configUpdateAt is empty", __func__); return; } - APP_LOGI("%{public}s,update at timer updateAt:%{public}s", __func__, configUpdateAt.c_str()); + HILOG_INFO("%{public}s,update at timer updateAt:%{public}s", __func__, configUpdateAt.c_str()); std::vector temp = FormUtil::StringSplit(configUpdateAt, Constants::TIME_DELIMETER); if (temp.size() != Constants::UPDATE_AT_CONFIG_COUNT) { - APP_LOGE("%{public}s, invalid config", __func__); + HILOG_ERROR("%{public}s, invalid config", __func__); return; } int hour = -1; @@ -430,7 +430,7 @@ void FormSysEventReceiver::GetTimerCfg(const bool updateEnabled, min = std::stoi(temp[1]); if (hour < Constants::MIN_TIME || hour > Constants::MAX_HOUR || min < Constants::MIN_TIME || min > Constants::MAX_MININUTE) { - APP_LOGE("%{public}s, time is invalid", __func__); + HILOG_ERROR("%{public}s, time is invalid", __func__); return; } @@ -461,10 +461,10 @@ void FormSysEventReceiver::HandleTimerUpdate(const int64_t formId, FormDataMgr::GetInstance().SetUpdateInfo(formId, true, timerCfg.updateDuration, timerCfg.updateAtHour, timerCfg.updateAtMin); if (timerCfg.updateDuration > 0) { - APP_LOGI("%{public}s, add interval timer:%{public}" PRId64 "", __func__, timerCfg.updateDuration); + HILOG_INFO("%{public}s, add interval timer:%{public}" PRId64 "", __func__, timerCfg.updateDuration); FormTimerMgr::GetInstance().AddFormTimer(formId, timerCfg.updateDuration, record.userId); } else { - APP_LOGI("%{public}s, add at timer:%{public}d, %{public}d", __func__, + HILOG_INFO("%{public}s, add at timer:%{public}d, %{public}d", __func__, timerCfg.updateAtHour, timerCfg.updateAtMin); FormTimerMgr::GetInstance().AddFormTimer(formId, timerCfg.updateAtHour, timerCfg.updateAtMin, record.userId); diff --git a/services/formmgr/src/form_task_mgr.cpp b/services/formmgr/src/form_task_mgr.cpp index 66cb99ee90..4899c6715b 100644 --- a/services/formmgr/src/form_task_mgr.cpp +++ b/services/formmgr/src/form_task_mgr.cpp @@ -15,7 +15,6 @@ #include -#include "app_log_wrapper.h" #include "form_constants.h" #include "form_data_mgr.h" #include "form_host_interface.h" @@ -25,6 +24,7 @@ #include "form_supply_callback.h" #include "form_task_mgr.h" #include "form_util.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -40,7 +40,7 @@ FormTaskMgr::~FormTaskMgr() {} void FormTaskMgr::PostAcquireTask(const int64_t formId, const Want &want, const sptr &remoteObject) { if (eventHandler_ == nullptr) { - APP_LOGE("%{public}s fail, eventhandler invalidate", __func__); + HILOG_ERROR("%{public}s fail, eventhandler invalidate", __func__); return; } std::function acquireProviderFormInfoFunc = std::bind(&FormTaskMgr::AcquireProviderFormInfo, @@ -56,7 +56,7 @@ void FormTaskMgr::PostAcquireTask(const int64_t formId, const Want &want, const void FormTaskMgr::PostDeleteTask(const int64_t formId, const Want &want, const sptr &remoteObject) { if (eventHandler_ == nullptr) { - APP_LOGE("%{public}s fail, eventhandler invalidate", __func__); + HILOG_ERROR("%{public}s fail, eventhandler invalidate", __func__); return; } std::function notifyFormDeleteFunc = std::bind(&FormTaskMgr::NotifyFormDelete, @@ -75,7 +75,7 @@ void FormTaskMgr::PostDeleteTask(const int64_t formId, const Want &want, const s void FormTaskMgr::PostRefreshTask(const int64_t formId, const Want &want, const sptr &remoteObject) { if (eventHandler_ == nullptr) { - APP_LOGE("%{public}s fail, eventhandler invalidate.", __func__); + HILOG_ERROR("%{public}s fail, eventhandler invalidate.", __func__); return; } std::function notifyFormUpdateFunc = std::bind(&FormTaskMgr::NotifyFormUpdate, @@ -94,7 +94,7 @@ void FormTaskMgr::PostRefreshTask(const int64_t formId, const Want &want, const void FormTaskMgr::PostCastTempTask(const int64_t formId, const Want &want, const sptr &remoteObject) { if (eventHandler_ == nullptr) { - APP_LOGE("%{public}s fail, eventhandler invalidate", __func__); + HILOG_ERROR("%{public}s fail, eventhandler invalidate", __func__); return; } std::function notifyCastTempFunc = std::bind(&FormTaskMgr::NotifyCastTemp, @@ -114,7 +114,7 @@ void FormTaskMgr::PostAcquireTaskToHost(const int64_t formId, const FormRecord & const sptr &remoteObject) { if (eventHandler_ == nullptr) { - APP_LOGE("%{public}s fail, eventhandler invalidate", __func__); + HILOG_ERROR("%{public}s fail, eventhandler invalidate", __func__); return; } std::function acquireTaskToHostFunc = std::bind(&FormTaskMgr::AcquireTaskToHost, @@ -133,14 +133,14 @@ void FormTaskMgr::PostAcquireTaskToHost(const int64_t formId, const FormRecord & void FormTaskMgr::PostUpdateTaskToHost(const int64_t formId, const FormRecord &record, const sptr &remoteObject) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); if (eventHandler_ == nullptr) { - APP_LOGE("%{public}s fail, eventhandler invalidate.", __func__); + HILOG_ERROR("%{public}s fail, eventhandler invalidate.", __func__); return; } - APP_LOGD("%{public}s, post the task of updateTaskToHostFunc.", __func__); + HILOG_DEBUG("%{public}s, post the task of updateTaskToHostFunc.", __func__); std::function updateTaskToHostFunc = std::bind(&FormTaskMgr::UpdateTaskToHost, this, formId, record, remoteObject); eventHandler_->PostTask(updateTaskToHostFunc, FORM_TASK_DELAY_TIME); @@ -160,7 +160,7 @@ void FormTaskMgr::PostUpdateTaskToHost(const int64_t formId, const FormRecord &r void FormTaskMgr::PostHostDiedTask(const sptr &remoteHost) { if (eventHandler_ == nullptr) { - APP_LOGE("%{public}s fail, eventhandler invalidate", __func__); + HILOG_ERROR("%{public}s fail, eventhandler invalidate", __func__); return; } std::function postTaskFunc = std::bind(&FormTaskMgr::HostDied, @@ -181,7 +181,7 @@ void FormTaskMgr::PostEventNotifyTask(const std::vector &formEvent, con const Want &want, const sptr &remoteObject) { if (eventHandler_ == nullptr) { - APP_LOGE("%{public}s fail, eventhandler invalidate.", __func__); + HILOG_ERROR("%{public}s fail, eventhandler invalidate.", __func__); return; } std::function eventNotifyFunc = std::bind(&FormTaskMgr::EventNotify, @@ -198,7 +198,7 @@ void FormTaskMgr::PostProviderBatchDeleteTask(std::set &formIds, const const sptr &remoteObject) { if (eventHandler_ == nullptr) { - APP_LOGE("%{public}s fail, eventhandler invalidate.", __func__); + HILOG_ERROR("%{public}s fail, eventhandler invalidate.", __func__); return; } std::function batchDeleteFunc = std::bind(&FormTaskMgr::ProviderBatchDelete, @@ -216,7 +216,7 @@ void FormTaskMgr::PostFormEventTask(const int64_t formId, const std::string &mes const Want &want, const sptr &remoteObject) { if (eventHandler_ == nullptr) { - APP_LOGE("%{public}s fail, eventhandler invalidate.", __func__); + HILOG_ERROR("%{public}s fail, eventhandler invalidate.", __func__); return; } std::function formEventFunc = std::bind(&FormTaskMgr::FireFormEvent, @@ -231,15 +231,15 @@ void FormTaskMgr::PostFormEventTask(const int64_t formId, const std::string &mes */ void FormTaskMgr::PostUninstallTaskToHost(const std::vector &formIds, const sptr &remoteObject) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); if (eventHandler_ == nullptr) { - APP_LOGE("%{public}s fail, eventhandler invalidate.", __func__); + HILOG_ERROR("%{public}s fail, eventhandler invalidate.", __func__); return; } std::function uninstallFunc = std::bind(&FormTaskMgr::FormUninstall, this, formIds, remoteObject); eventHandler_->PostTask(uninstallFunc, FORM_TASK_DELAY_TIME); - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** @@ -277,19 +277,19 @@ void FormTaskMgr::NotifyFormDelete(const int64_t formId, const Want &want, const */ void FormTaskMgr::NotifyFormUpdate(const int64_t formId, const Want &want, const sptr &remoteObject) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); long connectId = want.GetLongParam(Constants::FORM_CONNECT_ID, 0); sptr formProviderProxy = iface_cast(remoteObject); if (formProviderProxy == nullptr) { FormSupplyCallback::GetInstance()->RemoveConnection(connectId); - APP_LOGE("%{public}s fail, failed to get formProviderProxy", __func__); + HILOG_ERROR("%{public}s fail, failed to get formProviderProxy", __func__); return; } int error = formProviderProxy->NotifyFormUpdate(formId, want, FormSupplyCallback::GetInstance()); if (error != ERR_OK) { FormSupplyCallback::GetInstance()->RemoveConnection(connectId); - APP_LOGE("%{public}s fail, Failed to notify form update.", __func__); + HILOG_ERROR("%{public}s fail, Failed to notify form update.", __func__); } } @@ -305,20 +305,20 @@ void FormTaskMgr::NotifyFormUpdate(const int64_t formId, const Want &want, const void FormTaskMgr::EventNotify(const std::vector &formEvents, const int32_t formVisibleType, const Want &want, const sptr &remoteObject) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); long connectId = want.GetLongParam(Constants::FORM_CONNECT_ID, 0); sptr formProviderProxy = iface_cast(remoteObject); if (formProviderProxy == nullptr) { FormSupplyCallback::GetInstance()->RemoveConnection(connectId); - APP_LOGE("%{public}s fail, failed to get formProviderProxy", __func__); + HILOG_ERROR("%{public}s fail, failed to get formProviderProxy", __func__); return; } int error = formProviderProxy->EventNotify(formEvents, formVisibleType, want, FormSupplyCallback::GetInstance()); if (error != ERR_OK) { FormSupplyCallback::GetInstance()->RemoveConnection(connectId); - APP_LOGE("%{public}s fail, Failed to send event notify.", __func__); + HILOG_ERROR("%{public}s fail, Failed to send event notify.", __func__); } } @@ -332,20 +332,20 @@ void FormTaskMgr::EventNotify(const std::vector &formEvents, const int3 */ void FormTaskMgr::NotifyCastTemp(const int64_t formId, const Want &want, const sptr &remoteObject) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); long connectId = want.GetLongParam(Constants::FORM_CONNECT_ID, 0); sptr formProviderProxy = iface_cast(remoteObject); if (formProviderProxy == nullptr) { FormSupplyCallback::GetInstance()->RemoveConnection(connectId); - APP_LOGE("%{public}s fail, failed to get formProviderProxy", __func__); + HILOG_ERROR("%{public}s fail, failed to get formProviderProxy", __func__); return; } int error = formProviderProxy->NotifyFormCastTempForm(formId, want, FormSupplyCallback::GetInstance()); if (error != ERR_OK) { FormSupplyCallback::GetInstance()->RemoveConnection(connectId); - APP_LOGE("%{public}s fail, Failed to get acquire provider form info", __func__); + HILOG_ERROR("%{public}s fail, Failed to get acquire provider form info", __func__); } } @@ -360,15 +360,15 @@ void FormTaskMgr::NotifyCastTemp(const int64_t formId, const Want &want, const s void FormTaskMgr::AcquireTaskToHost(const int64_t formId, const FormRecord &record, const sptr &remoteObject) { - APP_LOGI("FormTaskMgr AcquireTaskToHost, formId:%{public}" PRId64 "", formId); + HILOG_INFO("FormTaskMgr AcquireTaskToHost, formId:%{public}" PRId64 "", formId); sptr remoteFormHost = iface_cast(remoteObject); if (remoteFormHost == nullptr) { - APP_LOGE("%{public}s fail, Failed to get form host proxy", __func__); + HILOG_ERROR("%{public}s fail, Failed to get form host proxy", __func__); return; } - APP_LOGD("FormTaskMgr remoteFormHost OnAcquired"); + HILOG_DEBUG("FormTaskMgr remoteFormHost OnAcquired"); remoteFormHost->OnAcquired(CreateFormJsInfo(formId, record)); } @@ -383,18 +383,18 @@ void FormTaskMgr::AcquireTaskToHost(const int64_t formId, const FormRecord &reco void FormTaskMgr::UpdateTaskToHost(const int64_t formId, const FormRecord &record, const sptr &remoteObject) { - APP_LOGI("%{public}s start.", __func__); + HILOG_INFO("%{public}s start.", __func__); sptr remoteFormHost = iface_cast(remoteObject); if (remoteFormHost == nullptr) { - APP_LOGE("%{public}s fail, Failed to get form host proxy.", __func__); + HILOG_ERROR("%{public}s fail, Failed to get form host proxy.", __func__); return; } - APP_LOGD("%{public}s, FormTaskMgr remoteFormHost OnUpdate.", __func__); + HILOG_DEBUG("%{public}s, FormTaskMgr remoteFormHost OnUpdate.", __func__); remoteFormHost->OnUpdate(CreateFormJsInfo(formId, record)); - APP_LOGI("%{public}s end.", __func__); + HILOG_INFO("%{public}s end.", __func__); } /** @@ -403,9 +403,9 @@ void FormTaskMgr::UpdateTaskToHost(const int64_t formId, const FormRecord &recor */ void FormTaskMgr::HostDied(const sptr &remoteHost) { - APP_LOGI("%{public}s, remote client died event", __func__); + HILOG_INFO("%{public}s, remote client died event", __func__); if (remoteHost == nullptr) { - APP_LOGI("%{public}s, remote client died, invalid param", __func__); + HILOG_INFO("%{public}s, remote client died, invalid param", __func__); return; } FormDataMgr::GetInstance().HandleHostDied(remoteHost); @@ -419,12 +419,12 @@ void FormTaskMgr::HostDied(const sptr &remoteHost) void FormTaskMgr::ProviderBatchDelete(std::set &formIds, const Want &want, const sptr &remoteObject) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); long connectId = want.GetLongParam(Constants::FORM_CONNECT_ID, 0); sptr formProviderProxy = iface_cast(remoteObject); if (formProviderProxy == nullptr) { FormSupplyCallback::GetInstance()->RemoveConnection(connectId); - APP_LOGE("%{public}s fail, Failed to get formProviderProxy", __func__); + HILOG_ERROR("%{public}s fail, Failed to get formProviderProxy", __func__); return; } std::vector vFormIds; @@ -432,7 +432,7 @@ void FormTaskMgr::ProviderBatchDelete(std::set &formIds, const Want &wa int error = formProviderProxy->NotifyFormsDelete(vFormIds, want, FormSupplyCallback::GetInstance()); if (error != ERR_OK) { FormSupplyCallback::GetInstance()->RemoveConnection(connectId); - APP_LOGE("%{public}s failed", __func__); + HILOG_ERROR("%{public}s failed", __func__); } } /** @@ -445,21 +445,21 @@ void FormTaskMgr::ProviderBatchDelete(std::set &formIds, const Want &wa void FormTaskMgr::FireFormEvent(const int64_t formId, const std::string &message, const Want &want, const sptr &remoteObject) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); long connectId = want.GetLongParam(Constants::FORM_CONNECT_ID, 0); sptr formProviderProxy = iface_cast(remoteObject); if (formProviderProxy == nullptr) { FormSupplyCallback::GetInstance()->RemoveConnection(connectId); - APP_LOGE("%{public}s, Failed to get formProviderProxy", __func__); + HILOG_ERROR("%{public}s, Failed to get formProviderProxy", __func__); return; } int error = formProviderProxy->FireFormEvent(formId, message, want, FormSupplyCallback::GetInstance()); if (error != ERR_OK) { FormSupplyCallback::GetInstance()->RemoveConnection(connectId); - APP_LOGE("%{public}s, Failed to fire message event to form provider", __func__); + HILOG_ERROR("%{public}s, Failed to fire message event to form provider", __func__); } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** @@ -470,16 +470,16 @@ void FormTaskMgr::FireFormEvent(const int64_t formId, const std::string &message void FormTaskMgr::FormUninstall(const std::vector &formIds, const sptr &remoteObject) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); sptr remoteFormHost = iface_cast(remoteObject); if (remoteFormHost == nullptr) { - APP_LOGE("%{public}s fail, Failed to get form host proxy.", __func__); + HILOG_ERROR("%{public}s fail, Failed to get form host proxy.", __func__); return; } remoteFormHost->OnUninstall(formIds); - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** @@ -490,7 +490,7 @@ void FormTaskMgr::FormUninstall(const std::vector &formIds, */ FormJsInfo FormTaskMgr::CreateFormJsInfo(const int64_t formId, const FormRecord &record) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); FormJsInfo form; form.formId = formId; form.bundleName = record.bundleName; @@ -502,7 +502,7 @@ FormJsInfo FormTaskMgr::CreateFormJsInfo(const int64_t formId, const FormRecord form.formProviderData = record.formProviderInfo.GetFormData(); form.formSrc = record.formSrc; form.formWindow = record.formWindow; - APP_LOGI("%{public}s end, jsPath: %{public}s, data: %{public}s", __func__, + HILOG_INFO("%{public}s end, jsPath: %{public}s, data: %{public}s", __func__, form.jsFormCodePath.c_str(), form.formData.c_str()); return form; } diff --git a/services/formmgr/src/form_timer_mgr.cpp b/services/formmgr/src/form_timer_mgr.cpp index a8510dc81b..b751267e6a 100644 --- a/services/formmgr/src/form_timer_mgr.cpp +++ b/services/formmgr/src/form_timer_mgr.cpp @@ -18,7 +18,6 @@ #include #include "ability_context.h" -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" #include "common_event_manager.h" #include "common_event_support.h" @@ -28,6 +27,7 @@ #include "form_refresh_limiter.h" #include "form_timer_option.h" #include "form_util.h" +#include "hilog_wrapper.h" #include "os_account_manager.h" #include "want.h" @@ -52,13 +52,13 @@ FormTimerMgr::~FormTimerMgr() */ bool FormTimerMgr::AddFormTimer(const FormTimer &task) { - APP_LOGI("%{public}s, formId: %{public}" PRId64 ", userId:%{public}d", __func__, task.formId, task.userId); + HILOG_INFO("%{public}s, formId: %{public}" PRId64 ", userId:%{public}d", __func__, task.formId, task.userId); if (task.isUpdateAt) { if (task.hour >= Constants::MIN_TIME && task.hour <= Constants::MAX_HOUR && task.min >= Constants::MIN_TIME && task.min <= Constants::MAX_MININUTE) { return AddUpdateAtTimer(task); } else { - APP_LOGE("%{public}s failed, update at time is invalid", __func__); + HILOG_ERROR("%{public}s failed, update at time is invalid", __func__); return false; } } else { @@ -66,7 +66,7 @@ bool FormTimerMgr::AddFormTimer(const FormTimer &task) (task.period % Constants::MIN_PERIOD) == 0) { return AddIntervalTimer(task); } else { - APP_LOGE("%{public}s failed, interval time is invalid", __func__); + HILOG_ERROR("%{public}s failed, interval time is invalid", __func__); return false; } } @@ -104,17 +104,17 @@ bool FormTimerMgr::AddFormTimer(const int64_t formId, const long updateAtHour, */ bool FormTimerMgr::RemoveFormTimer(const int64_t formId) { - APP_LOGI("%{public}s, task: %{public}" PRId64 "", __func__, formId); + HILOG_INFO("%{public}s, task: %{public}" PRId64 "", __func__, formId); if (!DeleteIntervalTimer(formId)) { if (!DeleteUpdateAtTimer(formId)) { - APP_LOGE("%{public}s, failed to DeleteUpdateAtTimer", __func__); + HILOG_ERROR("%{public}s, failed to DeleteUpdateAtTimer", __func__); return false; } } if (!DeleteDynamicItem(formId)) { - APP_LOGE("%{public}s, failed to DeleteDynamicItem", __func__); + HILOG_ERROR("%{public}s, failed to DeleteDynamicItem", __func__); return false; } refreshLimiter_.DeleteItem(formId); @@ -131,7 +131,7 @@ bool FormTimerMgr::RemoveFormTimer(const int64_t formId) bool FormTimerMgr::UpdateFormTimer(const int64_t formId, const UpdateType &type, const FormTimerCfg &timerCfg) { if (!timerCfg.enableUpdate) { - APP_LOGW("%{public}s, enableUpdate is false", __func__); + HILOG_WARN("%{public}s, enableUpdate is false", __func__); return false; } @@ -149,7 +149,7 @@ bool FormTimerMgr::UpdateFormTimer(const int64_t formId, const UpdateType &type, return AtTimerToIntervalTimer(formId, timerCfg); } default: { - APP_LOGE("%{public}s failed, invalid UpdateType", __func__); + HILOG_ERROR("%{public}s failed, invalid UpdateType", __func__); return false; } } @@ -164,7 +164,7 @@ bool FormTimerMgr::UpdateIntervalValue(const int64_t formId, const FormTimerCfg { if (timerCfg.updateDuration < Constants::MIN_PERIOD || timerCfg.updateDuration > Constants::MAX_PERIOD || (timerCfg.updateDuration % Constants::MIN_PERIOD) != 0) { - APP_LOGE("%{public}s failed, invalid param", __func__); + HILOG_ERROR("%{public}s failed, invalid param", __func__); return false; } @@ -174,7 +174,7 @@ bool FormTimerMgr::UpdateIntervalValue(const int64_t formId, const FormTimerCfg intervalTask->second.period = timerCfg.updateDuration; return true; } else { - APP_LOGE("%{public}s failed, the interval timer is not exist", __func__); + HILOG_ERROR("%{public}s failed, the interval timer is not exist", __func__); return false; } } @@ -188,7 +188,7 @@ bool FormTimerMgr::UpdateAtTimerValue(const int64_t formId, const FormTimerCfg & { if (timerCfg.updateAtHour < Constants::MIN_TIME || timerCfg.updateAtHour > Constants::MAX_HOUR || timerCfg.updateAtMin < Constants::MIN_TIME || timerCfg.updateAtMin > Constants::MAX_MININUTE) { - APP_LOGE("%{public}s failed, time is invalid", __func__); + HILOG_ERROR("%{public}s failed, time is invalid", __func__); return false; } { @@ -204,7 +204,7 @@ bool FormTimerMgr::UpdateAtTimerValue(const int64_t formId, const FormTimerCfg & } if (changedItem.refreshTask.formId == 0) { - APP_LOGE("%{public}s failed, the update at timer is not exist", __func__); + HILOG_ERROR("%{public}s failed, the update at timer is not exist", __func__); return false; } changedItem.refreshTask.hour = timerCfg.updateAtHour; @@ -214,7 +214,7 @@ bool FormTimerMgr::UpdateAtTimerValue(const int64_t formId, const FormTimerCfg & } if (!UpdateAtTimerAlarm()) { - APP_LOGE("%{public}s, failed to update attimer alarm.", __func__); + HILOG_ERROR("%{public}s, failed to update attimer alarm.", __func__); return false; } return true; @@ -229,7 +229,7 @@ bool FormTimerMgr::IntervalToAtTimer(const int64_t formId, const FormTimerCfg &t { if (timerCfg.updateAtHour < Constants::MIN_TIME || timerCfg.updateAtHour > Constants::MAX_HOUR || timerCfg.updateAtMin < Constants::MIN_TIME || timerCfg.updateAtMin > Constants::MAX_MININUTE) { - APP_LOGE("%{public}s failed, time is invalid", __func__); + HILOG_ERROR("%{public}s failed, time is invalid", __func__); return false; } @@ -244,12 +244,12 @@ bool FormTimerMgr::IntervalToAtTimer(const int64_t formId, const FormTimerCfg &t timerTask.hour = timerCfg.updateAtHour; timerTask.min = timerCfg.updateAtMin; if (!AddUpdateAtTimer(timerTask)) { - APP_LOGE("%{public}s, failed to add update at timer", __func__); + HILOG_ERROR("%{public}s, failed to add update at timer", __func__); return false; } return true; } else { - APP_LOGE("%{public}s failed, the interval timer is not exist", __func__); + HILOG_ERROR("%{public}s failed, the interval timer is not exist", __func__); return false; } } @@ -263,7 +263,7 @@ bool FormTimerMgr::AtTimerToIntervalTimer(const int64_t formId, const FormTimerC { if (timerCfg.updateDuration < Constants::MIN_PERIOD || timerCfg.updateDuration > Constants::MAX_PERIOD || (timerCfg.updateDuration % Constants::MIN_PERIOD) != 0) { - APP_LOGE("%{public}s failed, time is invalid", __func__); + HILOG_ERROR("%{public}s failed, time is invalid", __func__); return false; } @@ -281,19 +281,19 @@ bool FormTimerMgr::AtTimerToIntervalTimer(const int64_t formId, const FormTimerC } if (!UpdateAtTimerAlarm()) { - APP_LOGE("%{public}s, failed to update attimer alarm.", __func__); + HILOG_ERROR("%{public}s, failed to update attimer alarm.", __func__); return false; } if (targetItem.refreshTask.formId == 0) { - APP_LOGE("%{public}s failed, the update at timer is not exist", __func__); + HILOG_ERROR("%{public}s failed, the update at timer is not exist", __func__); return false; } targetItem.refreshTask.isUpdateAt = false; targetItem.refreshTask.period = timerCfg.updateDuration; targetItem.refreshTask.refreshTime = LONG_MAX; if (!AddIntervalTimer(targetItem.refreshTask)) { - APP_LOGE("%{public}s, failed to add interval timer", __func__); + HILOG_ERROR("%{public}s, failed to add interval timer", __func__); return false; } return true; @@ -325,13 +325,13 @@ void FormTimerMgr::IncreaseRefreshCount(const int64_t formId) bool FormTimerMgr::SetNextRefreshTime(const int64_t formId, const long nextGapTime, const int32_t userId) { if (nextGapTime < Constants::MIN_NEXT_TIME) { - APP_LOGE("%{public}s failed, nextGapTime is invalid, nextGapTime:%{public}ld", __func__, nextGapTime); + HILOG_ERROR("%{public}s failed, nextGapTime is invalid, nextGapTime:%{public}ld", __func__, nextGapTime); return false; } auto timeSinceEpoch = std::chrono::steady_clock::now().time_since_epoch(); int64_t timeInSec = std::chrono::duration_cast(timeSinceEpoch).count(); int64_t refreshTime = timeInSec + nextGapTime * Constants::MS_PER_SECOND; - APP_LOGI("%{public}s, timeInSec:%{public}" PRId64 ", refreshTime:%{public}" PRId64, __func__, timeInSec, + HILOG_INFO("%{public}s, timeInSec:%{public}" PRId64 ", refreshTime:%{public}" PRId64, __func__, timeInSec, refreshTime); std::lock_guard lock(refreshMutex_); bool isExist = false; @@ -351,7 +351,7 @@ bool FormTimerMgr::SetNextRefreshTime(const int64_t formId, const long nextGapTi } std::sort(dynamicRefreshTasks_.begin(), dynamicRefreshTasks_.end(), CompareDynamicRefreshItem); if (!UpdateDynamicAlarm()) { - APP_LOGE("%{public}s, failed to UpdateDynamicAlarm", __func__); + HILOG_ERROR("%{public}s, failed to UpdateDynamicAlarm", __func__); return false; } refreshLimiter_.AddItem(formId); @@ -366,7 +366,7 @@ void FormTimerMgr::SetEnableFlag(int64_t formId, bool flag) auto iter = intervalTimerTasks_.find(formId); if (iter != intervalTimerTasks_.end()) { iter->second.isEnable = flag; - APP_LOGI("%{public}s, formId:%{public}" PRId64 ", isEnable:%{public}d", __func__, formId, flag ? 1 : 0); + HILOG_INFO("%{public}s, formId:%{public}" PRId64 ", isEnable:%{public}d", __func__, formId, flag ? 1 : 0); return; } } @@ -396,12 +396,13 @@ void FormTimerMgr::MarkRemind(const int64_t formId) */ bool FormTimerMgr::AddUpdateAtTimer(const FormTimer &task) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); { std::lock_guard lock(updateAtMutex_); for (auto &updateAtTimer : updateAtTimerTasks_) { if (updateAtTimer.refreshTask.formId == task.formId) { - APP_LOGW("%{public}s, already exist formTimer, formId:%{public}" PRId64 " task", __func__, task.formId); + HILOG_WARN( + "%{public}s, already exist formTimer, formId:%{public}" PRId64 " task", __func__, task.formId); return true; } } @@ -414,7 +415,7 @@ bool FormTimerMgr::AddUpdateAtTimer(const FormTimer &task) } if (!UpdateAtTimerAlarm()) { - APP_LOGE("%{public}s, failed to update attimer alarm.", __func__); + HILOG_ERROR("%{public}s, failed to update attimer alarm.", __func__); return false; } @@ -427,18 +428,18 @@ bool FormTimerMgr::AddUpdateAtTimer(const FormTimer &task) */ bool FormTimerMgr::AddIntervalTimer(const FormTimer &task) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); { std::lock_guard lock(intervalMutex_); EnsureInitIntervalTimer(); if (intervalTimerTasks_.find(task.formId) != intervalTimerTasks_.end()) { - APP_LOGW("%{public}s, already exist formTimer, formId:%{public}" PRId64 " task", __func__, task.formId); + HILOG_WARN("%{public}s, already exist formTimer, formId:%{public}" PRId64 " task", __func__, task.formId); return true; } intervalTimerTasks_.emplace(task.formId, task); } if (!UpdateLimiterAlarm()) { - APP_LOGE("%{public}s, failed to UpdateLimiterAlarm", __func__); + HILOG_ERROR("%{public}s, failed to UpdateLimiterAlarm", __func__); return false; } return refreshLimiter_.AddItem(task.formId); @@ -480,12 +481,12 @@ void FormTimerMgr::AddUpdateAtItem(const UpdateAtItem &atItem) */ bool FormTimerMgr::HandleSystemTimeChanged() { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); if (!updateAtTimerTasks_.empty()) { return UpdateAtTimerAlarm(); } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return true; } /** @@ -494,18 +495,18 @@ bool FormTimerMgr::HandleSystemTimeChanged() */ bool FormTimerMgr::HandleResetLimiter() { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); std::vector remindTasks; bool bGetTasks = GetRemindTasks(remindTasks); if (bGetTasks) { - APP_LOGI("%{public}s failed, remind when reset limiter", __func__); + HILOG_INFO("%{public}s failed, remind when reset limiter", __func__); for (auto &task : remindTasks) { ExecTimerTask(task); } } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return true; } /** @@ -515,7 +516,7 @@ bool FormTimerMgr::HandleResetLimiter() */ bool FormTimerMgr::OnUpdateAtTrigger(long updateTime) { - APP_LOGI("%{public}s start, updateTime:%{public}ld", __func__, updateTime); + HILOG_INFO("%{public}s start, updateTime:%{public}ld", __func__, updateTime); std::vector updateList; { std::lock_guard lock(updateAtMutex_); @@ -528,18 +529,18 @@ bool FormTimerMgr::OnUpdateAtTrigger(long updateTime) } if (!UpdateAtTimerAlarm()) { - APP_LOGE("%{public}s, failed to update attimer alarm.", __func__); + HILOG_ERROR("%{public}s, failed to update attimer alarm.", __func__); return false; } if (!updateList.empty()) { - APP_LOGI("%{public}s, update at timer triggered, trigged time: %{public}ld", __func__, updateTime); + HILOG_INFO("%{public}s, update at timer triggered, trigged time: %{public}ld", __func__, updateTime); for (auto &item : updateList) { ExecTimerTask(item.refreshTask); } } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return true; } /** @@ -549,7 +550,7 @@ bool FormTimerMgr::OnUpdateAtTrigger(long updateTime) */ bool FormTimerMgr::OnDynamicTimeTrigger(long updateTime) { - APP_LOGI("%{public}s start, updateTime:%{public}ld", __func__, updateTime); + HILOG_INFO("%{public}s start, updateTime:%{public}ld", __func__, updateTime); std::vector updateList; { std::lock_guard lock(dynamicMutex_); @@ -575,18 +576,18 @@ bool FormTimerMgr::OnDynamicTimeTrigger(long updateTime) } if (!UpdateDynamicAlarm()) { - APP_LOGE("%{public}s, failed to update dynamic alarm.", __func__); + HILOG_ERROR("%{public}s, failed to update dynamic alarm.", __func__); return false; } if (!updateList.empty()) { - APP_LOGI("%{public}s triggered, trigged time: %{public}ld", __func__, updateTime); + HILOG_INFO("%{public}s triggered, trigged time: %{public}ld", __func__, updateTime); for (auto &task : updateList) { ExecTimerTask(task); } } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return true; } /** @@ -596,7 +597,7 @@ bool FormTimerMgr::OnDynamicTimeTrigger(long updateTime) */ bool FormTimerMgr::GetRemindTasks(std::vector &remindTasks) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); std::vector remindList = refreshLimiter_.GetRemindListAndResetLimit(); for (int64_t id : remindList) { FormTimer formTimer(id, false); @@ -604,15 +605,15 @@ bool FormTimerMgr::GetRemindTasks(std::vector &remindTasks) } if (!UpdateLimiterAlarm()) { - APP_LOGE("%{public}s, failed to UpdateLimiterAlarm", __func__); + HILOG_ERROR("%{public}s, failed to UpdateLimiterAlarm", __func__); return false; } if (remindTasks.size() > 0) { - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return true; } else { - APP_LOGI("%{public}s end, remindTasks is empty", __func__); + HILOG_INFO("%{public}s end, remindTasks is empty", __func__); return false; } } @@ -628,7 +629,7 @@ void FormTimerMgr::SetIntervalEnableFlag(int64_t formId, bool flag) auto refreshTask = intervalTimerTasks_.find(formId); if (refreshTask != intervalTimerTasks_.end()) { refreshTask->second.isEnable = flag; - APP_LOGI("%{public}s, formId:%{public}" PRId64 ", isEnable:%{public}d", __func__, formId, flag ? 1 : 0); + HILOG_INFO("%{public}s, formId:%{public}" PRId64 ", isEnable:%{public}d", __func__, formId, flag ? 1 : 0); return; } } @@ -639,15 +640,15 @@ void FormTimerMgr::SetIntervalEnableFlag(int64_t formId, bool flag) */ bool FormTimerMgr::GetIntervalTimer(const int64_t formId, FormTimer &formTimer) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); std::lock_guard lock(intervalMutex_); auto intervalTask = intervalTimerTasks_.find(formId); if (intervalTask == intervalTimerTasks_.end()) { - APP_LOGI("%{public}s, interval timer not find", __func__); + HILOG_INFO("%{public}s, interval timer not find", __func__); return false; } formTimer = intervalTask->second; - APP_LOGI("%{public}s, get interval timer successfully", __func__); + HILOG_INFO("%{public}s, get interval timer successfully", __func__); return true; } /** @@ -657,7 +658,7 @@ bool FormTimerMgr::GetIntervalTimer(const int64_t formId, FormTimer &formTimer) */ bool FormTimerMgr::GetUpdateAtTimer(const int64_t formId, UpdateAtItem &updateAtItem) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); { std::lock_guard lock(updateAtMutex_); std::list::iterator itItem; @@ -665,12 +666,12 @@ bool FormTimerMgr::GetUpdateAtTimer(const int64_t formId, UpdateAtItem &updateAt if (itItem->refreshTask.formId == formId) { updateAtItem.refreshTask = itItem->refreshTask; updateAtItem.updateAtTime = itItem->updateAtTime; - APP_LOGI("%{public}s, get update at timer successfully", __func__); + HILOG_INFO("%{public}s, get update at timer successfully", __func__); return true; } } } - APP_LOGI("%{public}s, update at timer not find", __func__); + HILOG_INFO("%{public}s, update at timer not find", __func__); return false; } /** @@ -680,7 +681,7 @@ bool FormTimerMgr::GetUpdateAtTimer(const int64_t formId, UpdateAtItem &updateAt */ bool FormTimerMgr::GetDynamicItem(const int64_t formId, DynamicRefreshItem &dynamicItem) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); std::lock_guard lock(dynamicMutex_); std::vector::iterator itItem; for (itItem = dynamicRefreshTasks_.begin(); itItem != dynamicRefreshTasks_.end();) { @@ -688,11 +689,11 @@ bool FormTimerMgr::GetDynamicItem(const int64_t formId, DynamicRefreshItem &dyna dynamicItem.formId = itItem->formId; dynamicItem.settedTime = itItem->settedTime; dynamicItem.userId = itItem->userId; - APP_LOGI("%{public}s, get dynamic item successfully", __func__); + HILOG_INFO("%{public}s, get dynamic item successfully", __func__); return true; } } - APP_LOGI("%{public}s, dynamic item not find", __func__); + HILOG_INFO("%{public}s, dynamic item not find", __func__); return false; } /** @@ -702,7 +703,7 @@ bool FormTimerMgr::GetDynamicItem(const int64_t formId, DynamicRefreshItem &dyna */ bool FormTimerMgr::DeleteIntervalTimer(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); bool isExist = false; std::lock_guard lock(intervalMutex_); auto intervalTask = intervalTimerTasks_.find(formId); @@ -714,7 +715,7 @@ bool FormTimerMgr::DeleteIntervalTimer(const int64_t formId) if (intervalTimerTasks_.empty()) { ClearIntervalTimer(); } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return isExist; } /** @@ -724,7 +725,7 @@ bool FormTimerMgr::DeleteIntervalTimer(const int64_t formId) */ bool FormTimerMgr::DeleteUpdateAtTimer(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); { std::lock_guard lock(updateAtMutex_); std::list::iterator itItem; @@ -737,11 +738,11 @@ bool FormTimerMgr::DeleteUpdateAtTimer(const int64_t formId) } if (!UpdateAtTimerAlarm()) { - APP_LOGE("%{public}s, failed to update attimer alarm.", __func__); + HILOG_ERROR("%{public}s, failed to update attimer alarm.", __func__); return false; } return true; - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** * @brief Delete dynamic refresh item. @@ -749,7 +750,7 @@ bool FormTimerMgr::DeleteUpdateAtTimer(const int64_t formId) */ bool FormTimerMgr::DeleteDynamicItem(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); std::lock_guard lock(dynamicMutex_); std::vector::iterator itItem; for (itItem = dynamicRefreshTasks_.begin(); itItem != dynamicRefreshTasks_.end();) { @@ -764,18 +765,18 @@ bool FormTimerMgr::DeleteDynamicItem(const int64_t formId) std::sort(dynamicRefreshTasks_.begin(), dynamicRefreshTasks_.end(), CompareDynamicRefreshItem); if (!UpdateDynamicAlarm()) { - APP_LOGE("%{public}s, failed to UpdateDynamicAlarm", __func__); + HILOG_ERROR("%{public}s, failed to UpdateDynamicAlarm", __func__); return false; } return true; - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** * @brief interval timer task timeout. */ void FormTimerMgr::OnIntervalTimeOut() { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); std::lock_guard lock(intervalMutex_); std::vector updateList; int64_t currentTime = FormUtil::GetCurrentNanosecond() / Constants::TIME_1000000; @@ -794,7 +795,7 @@ void FormTimerMgr::OnIntervalTimeOut() ExecTimerTask(task); } } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** @@ -803,12 +804,12 @@ void FormTimerMgr::OnIntervalTimeOut() */ bool FormTimerMgr::UpdateAtTimerAlarm() { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct tm tmAtTime = {0}; auto tt = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()); struct tm* ptm = localtime_r(&tt, &tmAtTime); if (ptm == nullptr) { - APP_LOGE("%{public}s failed, localtime error", __func__); + HILOG_ERROR("%{public}s failed, localtime error", __func__); return false; } @@ -818,12 +819,12 @@ bool FormTimerMgr::UpdateAtTimerAlarm() bool bFinded = FindNextAtTimerItem(nowAtTime, findedItem); if (!bFinded) { if (!updateAtTimerTasks_.empty()) { - APP_LOGW("%{public}s, updateAtTimerTasks_ is not empty", __func__); + HILOG_WARN("%{public}s, updateAtTimerTasks_ is not empty", __func__); return true; } ClearUpdateAtTimerResource(); atTimerWakeUpTime_ = LONG_MAX; - APP_LOGI("%{public}s, no update at task in system now.", __func__); + HILOG_INFO("%{public}s, no update at task in system now.", __func__); return true; } @@ -838,7 +839,7 @@ bool FormTimerMgr::UpdateAtTimerAlarm() } if (nextWakeUpTime == atTimerWakeUpTime_) { - APP_LOGW("%{public}s end, wakeUpTime not change, no need update alarm.", __func__); + HILOG_WARN("%{public}s end, wakeUpTime not change, no need update alarm.", __func__); return true; } @@ -848,7 +849,7 @@ bool FormTimerMgr::UpdateAtTimerAlarm() timerOption->SetInterval(0); std::shared_ptr wantAgent = GetUpdateAtWantAgent(findedItem.updateAtTime); if (wantAgent == nullptr) { - APP_LOGE("%{public}s, failed to create wantAgent.", __func__); + HILOG_ERROR("%{public}s, failed to create wantAgent.", __func__); return false; } timerOption->SetWantAgent(wantAgent); @@ -863,11 +864,11 @@ bool FormTimerMgr::UpdateAtTimerAlarm() bool bRet = MiscServices::TimeServiceClient::GetInstance()->StartTimer(updateAtTimerId_, static_cast(selectTime)); if (!bRet) { - APP_LOGE("%{public}s failed, init update at timer task error", __func__); + HILOG_ERROR("%{public}s failed, init update at timer task error", __func__); return false; } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return true; } @@ -897,19 +898,19 @@ std::shared_ptr FormTimerMgr::GetUpdateAtWantAgent(long updateAtTime) */ void FormTimerMgr::ClearUpdateAtTimerResource() { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); if (updateAtTimerId_ != 0L) { - APP_LOGI("%{public}s clear update at timer start", __func__); + HILOG_INFO("%{public}s clear update at timer start", __func__); MiscServices::TimeServiceClient::GetInstance()->StopTimer(updateAtTimerId_); MiscServices::TimeServiceClient::GetInstance()->DestroyTimer(updateAtTimerId_); - APP_LOGI("%{public}s clear update at timer end", __func__); + HILOG_INFO("%{public}s clear update at timer end", __func__); updateAtTimerId_ = 0L; } if (currentUpdateAtWantAgent != nullptr) { WantAgentHelper::Cancel(currentUpdateAtWantAgent); currentUpdateAtWantAgent = nullptr; } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** @@ -918,12 +919,12 @@ void FormTimerMgr::ClearUpdateAtTimerResource() */ bool FormTimerMgr::UpdateLimiterAlarm() { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); if (limiterTimerId_ != 0L) { - APP_LOGI("%{public}s clear dynamic timer start", __func__); + HILOG_INFO("%{public}s clear dynamic timer start", __func__); MiscServices::TimeServiceClient::GetInstance()->StopTimer(limiterTimerId_); MiscServices::TimeServiceClient::GetInstance()->DestroyTimer(limiterTimerId_); - APP_LOGI("%{public}s clear dynamic timer end", __func__); + HILOG_INFO("%{public}s clear dynamic timer end", __func__); limiterTimerId_ = 0L; } @@ -932,7 +933,7 @@ bool FormTimerMgr::UpdateLimiterAlarm() auto tt = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()); struct tm* ptm = localtime_r(&tt, &tmAtTime); if (ptm == nullptr) { - APP_LOGE("%{public}s failed, localtime error", __func__); + HILOG_ERROR("%{public}s failed, localtime error", __func__); return false; } tmAtTime.tm_sec = Constants::MAX_SECOND; // max value can be 61 @@ -946,7 +947,7 @@ bool FormTimerMgr::UpdateLimiterAlarm() timerOption->SetInterval(0); std::shared_ptr wantAgent = GetLimiterWantAgent(); if (!wantAgent) { - APP_LOGE("%{public}s, failed to create wantAgent.", __func__); + HILOG_ERROR("%{public}s, failed to create wantAgent.", __func__); return false; } timerOption->SetWantAgent(wantAgent); @@ -960,10 +961,10 @@ bool FormTimerMgr::UpdateLimiterAlarm() bool bRet = MiscServices::TimeServiceClient::GetInstance()->StartTimer(limiterTimerId_, static_cast(limiterWakeUpTime)); if (!bRet) { - APP_LOGE("%{public}s failed, init limiter timer task error", __func__); + HILOG_ERROR("%{public}s failed, init limiter timer task error", __func__); return false; } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return true; } /** @@ -971,19 +972,19 @@ bool FormTimerMgr::UpdateLimiterAlarm() */ void FormTimerMgr::ClearLimiterTimerResource() { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); if (limiterTimerId_ != 0L) { - APP_LOGI("%{public}s clear limiter timer start", __func__); + HILOG_INFO("%{public}s clear limiter timer start", __func__); MiscServices::TimeServiceClient::GetInstance()->StopTimer(limiterTimerId_); MiscServices::TimeServiceClient::GetInstance()->DestroyTimer(limiterTimerId_); - APP_LOGI("%{public}s clear limiter timer end", __func__); + HILOG_INFO("%{public}s clear limiter timer end", __func__); limiterTimerId_ = 0L; } if (currentLimiterWantAgent != nullptr) { WantAgentHelper::Cancel(currentLimiterWantAgent); currentLimiterWantAgent = nullptr; } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** @@ -1011,7 +1012,7 @@ std::shared_ptr FormTimerMgr::GetLimiterWantAgent() */ bool FormTimerMgr::UpdateDynamicAlarm() { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); if (dynamicRefreshTasks_.empty()) { ClearDynamicResource(); dynamicWakeUpTime_ = LONG_MAX; @@ -1026,7 +1027,7 @@ bool FormTimerMgr::UpdateDynamicAlarm() } if (!needUpdate) { - APP_LOGE("%{public}s failed, no need to UpdateDynamicAlarm.", __func__); + HILOG_ERROR("%{public}s failed, no need to UpdateDynamicAlarm.", __func__); return true; } @@ -1036,7 +1037,7 @@ bool FormTimerMgr::UpdateDynamicAlarm() timerOption->SetInterval(0); std::shared_ptr wantAgent = GetDynamicWantAgent(dynamicWakeUpTime_, firstTask.userId); if (!wantAgent) { - APP_LOGE("%{public}s, failed to create wantAgent.", __func__); + HILOG_ERROR("%{public}s, failed to create wantAgent.", __func__); return false; } timerOption->SetWantAgent(wantAgent); @@ -1050,10 +1051,10 @@ bool FormTimerMgr::UpdateDynamicAlarm() bool bRet = MiscServices::TimeServiceClient::GetInstance()->StartTimer(dynamicAlarmTimerId_, static_cast(dynamicWakeUpTime_)); if (!bRet) { - APP_LOGE("%{public}s failed, init dynamic timer task error", __func__); + HILOG_ERROR("%{public}s failed, init dynamic timer task error", __func__); } - APP_LOGI("%{public}s end, dynamicWakeUpTime_ : %{pubilc}ld.", __func__, dynamicWakeUpTime_); + HILOG_INFO("%{public}s end, dynamicWakeUpTime_ : %{pubilc}ld.", __func__, dynamicWakeUpTime_); return true; } @@ -1082,12 +1083,12 @@ std::shared_ptr FormTimerMgr::GetDynamicWantAgent(long nextTime, int3 */ void FormTimerMgr::ClearDynamicResource() { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); if (dynamicAlarmTimerId_ != 0L) { - APP_LOGI("%{public}s clear dynamic timer start", __func__); + HILOG_INFO("%{public}s clear dynamic timer start", __func__); MiscServices::TimeServiceClient::GetInstance()->StopTimer(dynamicAlarmTimerId_); MiscServices::TimeServiceClient::GetInstance()->DestroyTimer(dynamicAlarmTimerId_); - APP_LOGI("%{public}s clear dynamic timer end", __func__); + HILOG_INFO("%{public}s clear dynamic timer end", __func__); dynamicAlarmTimerId_ = 0L; } @@ -1095,7 +1096,7 @@ void FormTimerMgr::ClearDynamicResource() WantAgentHelper::Cancel(currentDynamicWantAgent); currentDynamicWantAgent = nullptr; } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** * @brief Fint next at timer item. @@ -1105,9 +1106,9 @@ void FormTimerMgr::ClearDynamicResource() */ bool FormTimerMgr::FindNextAtTimerItem(const int nowTime, UpdateAtItem &updateAtItem) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); if (updateAtTimerTasks_.empty()) { - APP_LOGW("%{public}s, updateAtTimerTasks_ is empty", __func__); + HILOG_WARN("%{public}s, updateAtTimerTasks_ is empty", __func__); return false; } @@ -1123,7 +1124,7 @@ bool FormTimerMgr::FindNextAtTimerItem(const int nowTime, UpdateAtItem &updateAt if (itItem == updateAtTimerTasks_.end()) { updateAtItem = updateAtTimerTasks_.front(); } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return true; } @@ -1132,7 +1133,7 @@ bool FormTimerMgr::FindNextAtTimerItem(const int nowTime, UpdateAtItem &updateAt */ void FormTimerMgr::EnsureInitIntervalTimer() { - APP_LOGI("%{public}s, init base timer task", __func__); + HILOG_INFO("%{public}s, init base timer task", __func__); if (intervalTimer_ != nullptr) { return; } @@ -1142,19 +1143,19 @@ void FormTimerMgr::EnsureInitIntervalTimer() intervalTimer_->Register(timeCallback, Constants::MIN_PERIOD); intervalTimer_->Setup(); - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** * @brief Clear interval timer resource. */ void FormTimerMgr::ClearIntervalTimer() { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); if (intervalTimer_ != nullptr) { intervalTimer_->Shutdown(); intervalTimer_.reset(); } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** * @brief Creat thread pool for timer task. @@ -1162,12 +1163,12 @@ void FormTimerMgr::ClearIntervalTimer() void FormTimerMgr::CreatTaskThreadExecutor() { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); if (taskExecutor_ == nullptr) { taskExecutor_ = std::make_unique("timer task thread"); taskExecutor_->Start(Constants::WORK_POOL_SIZE); } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); return; } @@ -1177,25 +1178,25 @@ void FormTimerMgr::CreatTaskThreadExecutor() */ void FormTimerMgr::ExecTimerTask(const FormTimer &timerTask) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); CreatTaskThreadExecutor(); if (taskExecutor_ != nullptr) { - APP_LOGI("%{public}s run", __func__); + HILOG_INFO("%{public}s run", __func__); AAFwk::Want want; if (timerTask.isCountTimer) { want.SetParam(Constants::KEY_IS_TIMER, true); } // multi user if (IsActiveUser(timerTask.userId)) { - APP_LOGI("timerTask.userId is current user"); + HILOG_INFO("timerTask.userId is current user"); want.SetParam(Constants::PARAM_FORM_USER_ID, timerTask.userId); } - APP_LOGI("%{public}s, userId:%{public}d", __func__, timerTask.userId); + HILOG_INFO("%{public}s, userId:%{public}d", __func__, timerTask.userId); auto task = std::bind(&FormProviderMgr::RefreshForm, &FormProviderMgr::GetInstance(), timerTask.formId, want); taskExecutor_->AddTask(task); } - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** @@ -1203,7 +1204,7 @@ void FormTimerMgr::ExecTimerTask(const FormTimer &timerTask) */ void FormTimerMgr::Init() { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); timerReceiver_ = nullptr; EventFwk::MatchingSkills matchingSkills; matchingSkills.AddEvent(Constants::ACTION_UPDATEATTIMER); @@ -1220,7 +1221,7 @@ void FormTimerMgr::Init() limiterTimerId_ = 0L; taskExecutor_ = nullptr; - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); } /** @@ -1239,7 +1240,7 @@ void FormTimerMgr::TimerReceiver::OnReceiveEvent(const EventFwk::CommonEventData AAFwk::Want want = eventData.GetWant(); std::string action = want.GetAction(); - APP_LOGI("%{public}s, action:%{public}s.", __func__, action.c_str()); + HILOG_INFO("%{public}s, action:%{public}s.", __func__, action.c_str()); if (action == EventFwk::CommonEventSupport::COMMON_EVENT_TIME_CHANGED || action == EventFwk::CommonEventSupport::COMMON_EVENT_TIMEZONE_CHANGED) { @@ -1251,22 +1252,22 @@ void FormTimerMgr::TimerReceiver::OnReceiveEvent(const EventFwk::CommonEventData } else if (type == Constants::TYPE_STATIC_UPDATE) { long updateTime = want.GetLongParam(Constants::KEY_WAKEUP_TIME, -1); if (updateTime < 0) { - APP_LOGE("%{public}s failed, invalid updateTime:%{public}ld.", __func__, updateTime); + HILOG_ERROR("%{public}s failed, invalid updateTime:%{public}ld.", __func__, updateTime); return; } FormTimerMgr::GetInstance().OnUpdateAtTrigger(updateTime); } else if (type == Constants::TYPE_DYNAMIC_UPDATE) { long updateTime = want.GetLongParam(Constants::KEY_WAKEUP_TIME, 0); if (updateTime <= 0) { - APP_LOGE("%{public}s failed, invalid updateTime:%{public}ld.", __func__, updateTime); + HILOG_ERROR("%{public}s failed, invalid updateTime:%{public}ld.", __func__, updateTime); return; } FormTimerMgr::GetInstance().OnDynamicTimeTrigger(updateTime); } else { - APP_LOGE("%{public}s failed, invalid type when action is update at timer.", __func__); + HILOG_ERROR("%{public}s failed, invalid type when action is update at timer.", __func__); } } else { - APP_LOGE("%{public}s failed, invalid action.", __func__); + HILOG_ERROR("%{public}s failed, invalid action.", __func__); } } /** diff --git a/services/formmgr/src/form_util.cpp b/services/formmgr/src/form_util.cpp index 8c86f8abe5..b566814933 100644 --- a/services/formmgr/src/form_util.cpp +++ b/services/formmgr/src/form_util.cpp @@ -19,10 +19,10 @@ #include #include -#include "app_log_wrapper.h" #include "bundle_constants.h" #include "form_constants.h" #include "form_util.h" +#include "hilog_wrapper.h" #include "ohos_account_kits.h" #include "os_account_manager.h" @@ -86,11 +86,11 @@ int64_t FormUtil::GenerateFormId(int64_t udidHash) int64_t elapsedTime { ((t.tv_sec) * SEC_TO_NANOSEC + t.tv_nsec) }; size_t elapsedHash = std::hash()(std::to_string(elapsedTime)); - APP_LOGI("%{public}s, GenerateFormId generate elapsed hash %{public}zu", __func__, elapsedHash); + HILOG_INFO("%{public}s, GenerateFormId generate elapsed hash %{public}zu", __func__, elapsedHash); uint64_t unsignedudidHash = static_cast(udidHash); uint64_t formId = unsignedudidHash | (int32_t)(elapsedHash & 0x000000007fffffffL); int64_t ret = static_cast(formId); - APP_LOGI("%{public}s, GenerateFormId generate formId %{public}" PRId64 "", __func__, ret); + HILOG_INFO("%{public}s, GenerateFormId generate formId %{public}" PRId64 "", __func__, ret); return ret; } @@ -116,7 +116,7 @@ int64_t FormUtil::PaddingUDIDHash(uint64_t formId, uint64_t udidHash) */ bool FormUtil::GenerateUdidHash(int64_t &udidHash) { - APP_LOGI("%{public}s start, udidHash: %{public}" PRId64 "", __func__, udidHash); + HILOG_INFO("%{public}s start, udidHash: %{public}" PRId64 "", __func__, udidHash); if (udidHash != INVALID_UDID_HASH) { return true; } @@ -127,7 +127,7 @@ bool FormUtil::GenerateUdidHash(int64_t &udidHash) if (udidHash < 0) { udidHash = 0L; } - APP_LOGI("%{public}s, FormAdapter generate hash %{public}" PRId64 "", __func__, udidHash); + HILOG_INFO("%{public}s, FormAdapter generate hash %{public}" PRId64 "", __func__, udidHash); return true; } @@ -162,7 +162,7 @@ int64_t FormUtil::GetMillisecondFromTm(struct tm &tmAtTime) { time_t inputTime = mktime(&tmAtTime); if (inputTime == -1) { - APP_LOGE("%{public}s fail, mktime failed.", __func__); + HILOG_ERROR("%{public}s fail, mktime failed.", __func__); return -1; } system_clock::time_point pointTime = system_clock::from_time_t(inputTime); @@ -194,12 +194,12 @@ int FormUtil::GetCurrentAccountId() std::vector osActiveAccountIds; ErrCode ret = AccountSA::OsAccountManager::QueryActiveOsAccountIds(osActiveAccountIds); if (ret != ERR_OK) { - APP_LOGE("QueryActiveOsAccountIds failed."); + HILOG_ERROR("QueryActiveOsAccountIds failed."); return Constants::ANY_USERID; } if (osActiveAccountIds.empty()) { - APP_LOGE("QueryActiveOsAccountIds is empty, no accounts."); + HILOG_ERROR("QueryActiveOsAccountIds is empty, no accounts."); return Constants::ANY_USERID; } diff --git a/services/formmgr/src/kvstore_death_recipient_callback.cpp b/services/formmgr/src/kvstore_death_recipient_callback.cpp index ad22bb8ffa..c294fd434b 100644 --- a/services/formmgr/src/kvstore_death_recipient_callback.cpp +++ b/services/formmgr/src/kvstore_death_recipient_callback.cpp @@ -18,8 +18,8 @@ #include #include -#include "app_log_wrapper.h" #include "form_db_cache.h" +#include "hilog_wrapper.h" using namespace OHOS::DistributedKv; @@ -31,21 +31,21 @@ const int32_t CHECK_INTERVAL = 100000; // 100ms } // namespace KvStoreDeathRecipientCallback::KvStoreDeathRecipientCallback() { - APP_LOGI("create kvstore death recipient callback instance %{public}p", this); + HILOG_INFO("create kvstore death recipient callback instance %{public}p", this); } KvStoreDeathRecipientCallback::~KvStoreDeathRecipientCallback() { - APP_LOGI("destroy kvstore death recipient callback instance %{public}p", this); + HILOG_INFO("destroy kvstore death recipient callback instance %{public}p", this); } void KvStoreDeathRecipientCallback::OnRemoteDied() { - APP_LOGI("OnRemoteDied, register data change listener begin"); + HILOG_INFO("OnRemoteDied, register data change listener begin"); auto dataStorage = FormDbCache::GetInstance().GetDataStorage(); if (!dataStorage) { - APP_LOGE("dataStorage is nullptr"); + HILOG_ERROR("dataStorage is nullptr"); return; } @@ -56,14 +56,14 @@ void KvStoreDeathRecipientCallback::OnRemoteDied() // init kvStore. if (dataStorage && dataStorage->ResetKvStore()) { // register data change listener again. - APP_LOGI("current times is %{public}d", times); + HILOG_INFO("current times is %{public}d", times); break; } usleep(CHECK_INTERVAL); } }).detach(); - APP_LOGI("OnRemoteDied, register data change listener end"); + HILOG_INFO("OnRemoteDied, register data change listener end"); } } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file diff --git a/services/formmgr/test/mock/include/mock_form_death_callback.h b/services/formmgr/test/mock/include/mock_form_death_callback.h index 55bc225a85..bd63ca4056 100644 --- a/services/formmgr/test/mock/include/mock_form_death_callback.h +++ b/services/formmgr/test/mock/include/mock_form_death_callback.h @@ -23,7 +23,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "event_handler.h" #include "form_constants.h" #include "form_callback_interface.h" @@ -46,7 +46,7 @@ public: void OnDeathReceived() { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); } /** @@ -56,7 +56,7 @@ public: */ void ProcessFormUpdate(const FormJsInfo &formJsInfo) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); } /** @@ -66,7 +66,7 @@ public: */ void ProcessFormUninstall(const int64_t formId) { - APP_LOGI("%{public}s called.", __func__); + HILOG_INFO("%{public}s called.", __func__); } }; } // namespace AppExecFwk diff --git a/services/formmgr/test/mock/src/mock_form_host_client.cpp b/services/formmgr/test/mock/src/mock_form_host_client.cpp index 8c70e7e66a..268f7b26ce 100644 --- a/services/formmgr/test/mock/src/mock_form_host_client.cpp +++ b/services/formmgr/test/mock/src/mock_form_host_client.cpp @@ -15,8 +15,8 @@ #include "mock_form_host_client.h" #include #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" #include "errors.h" +#include "hilog_wrapper.h" #include "string_ex.h" namespace OHOS { @@ -29,7 +29,7 @@ namespace AppExecFwk { */ void MockFormHostClient::OnAcquired(const FormJsInfo &formInfo) { - APP_LOGD("MockFormHostClient OnAcquired"); + HILOG_DEBUG("MockFormHostClient OnAcquired"); int64_t formId = formInfo.formId; ASSERT_FALSE(formId == 0); @@ -44,7 +44,7 @@ void MockFormHostClient::OnAcquired(const FormJsInfo &formInfo) */ void MockFormHostClient::OnUpdate(const FormJsInfo &formInfo) { - APP_LOGD("MockFormHostClient OnUpdate"); + HILOG_DEBUG("MockFormHostClient OnUpdate"); PostVoid(); } @@ -56,7 +56,7 @@ void MockFormHostClient::OnUpdate(const FormJsInfo &formInfo) */ void MockFormHostClient::OnUninstall(const std::vector &formIds) { - APP_LOGD("MockFormHostClient OnUnInstall"); + HILOG_DEBUG("MockFormHostClient OnUnInstall"); PostVoid(); } } // namespace AppExecFwk diff --git a/services/formmgr/test/mock/src/mock_form_provider_client.cpp b/services/formmgr/test/mock/src/mock_form_provider_client.cpp index d0d545dedd..e582ddb0ce 100644 --- a/services/formmgr/test/mock/src/mock_form_provider_client.cpp +++ b/services/formmgr/test/mock/src/mock_form_provider_client.cpp @@ -13,10 +13,10 @@ * limitations under the License. */ -#include "app_log_wrapper.h" #include "errors.h" #include "form_constants.h" #include "form_supply_interface.h" +#include "hilog_wrapper.h" #include "mock_form_provider_client.h" #include "string_ex.h" @@ -34,11 +34,11 @@ int MockFormProviderClient::AcquireProviderFormInfo(const int64_t formId, const { // avoid the user modify the number in onCreate - APP_LOGD("Acquire provider form info"); + HILOG_DEBUG("Acquire provider form info"); sptr formSupply = iface_cast(callerToken); if (formSupply == nullptr) { - APP_LOGE("failed to get formSupplyProxy"); + HILOG_ERROR("failed to get formSupplyProxy"); } FormProviderInfo formProviderInfo; @@ -62,7 +62,7 @@ int MockFormProviderClient::AcquireProviderFormInfo(const int64_t formId, const int MockFormProviderClient::NotifyFormDelete(const int64_t formId, const Want &want, const sptr &callerToken) { - APP_LOGD("Notify form delete"); + HILOG_DEBUG("Notify form delete"); return ERR_OK; } /** @@ -76,7 +76,7 @@ int MockFormProviderClient::NotifyFormDelete(const int64_t formId, const Want &w int MockFormProviderClient::NotifyFormsDelete(const std::vector &formIds, const Want &want, const sptr &callerToken) { - APP_LOGD("Notify forms delete"); + HILOG_DEBUG("Notify forms delete"); return ERR_OK; } @@ -89,7 +89,7 @@ int MockFormProviderClient::NotifyFormsDelete(const std::vector &formId int MockFormProviderClient::NotifyFormUpdate(const int64_t formId, const Want &want, const sptr &callerToken) { - APP_LOGD("Notify form update"); + HILOG_DEBUG("Notify form update"); return ERR_OK; } @@ -105,7 +105,7 @@ int MockFormProviderClient::NotifyFormUpdate(const int64_t formId, const Want &w int MockFormProviderClient::EventNotify(const std::vector &formIds, const int32_t formVisibleType, const Want &want, const sptr &callerToken) { - APP_LOGD("Event notify"); + HILOG_DEBUG("Event notify"); return ERR_OK; } @@ -119,7 +119,7 @@ int MockFormProviderClient::EventNotify(const std::vector &formIds, con int MockFormProviderClient::NotifyFormCastTempForm(const int64_t formId, const Want &want, const sptr &callerToken) { - APP_LOGD("Notify cast temp form"); + HILOG_DEBUG("Notify cast temp form"); return ERR_OK; } /** @@ -133,7 +133,7 @@ int MockFormProviderClient::NotifyFormCastTempForm(const int64_t formId, const W int MockFormProviderClient::FireFormEvent(const int64_t formId, const std::string &message, const Want &want, const sptr &callerToken) { - APP_LOGD("Fire form event"); + HILOG_DEBUG("Fire form event"); return ERR_OK; } } // namespace AppExecFwk diff --git a/services/formmgr/test/unittest/fms_form_cache_mgr_test/fms_form_cache_mgr_test.cpp b/services/formmgr/test/unittest/fms_form_cache_mgr_test/fms_form_cache_mgr_test.cpp index 2ca06825e0..5fb5067da0 100644 --- a/services/formmgr/test/unittest/fms_form_cache_mgr_test/fms_form_cache_mgr_test.cpp +++ b/services/formmgr/test/unittest/fms_form_cache_mgr_test/fms_form_cache_mgr_test.cpp @@ -15,10 +15,10 @@ #include -#include "app_log_wrapper.h" #define private public #include "form_cache_mgr.h" #undef private +#include "hilog_wrapper.h" using namespace testing::ext; using namespace OHOS; @@ -62,7 +62,7 @@ void FmsFormCacheMgrTest::TearDown() */ HWTEST_F(FmsFormCacheMgrTest, FmsFormCacheMgrTest_001, TestSize.Level0) { - APP_LOGI("fms_form_cache_mgr_test_001 start"); + HILOG_INFO("fms_form_cache_mgr_test_001 start"); std::string dataResult = ""; formCacheMgr_.cacheData_[PARAM_FORM_ID_FIRST]= "{'a':'1','b':'2'}"; @@ -82,7 +82,7 @@ HWTEST_F(FmsFormCacheMgrTest, FmsFormCacheMgrTest_001, TestSize.Level0) HWTEST_F(FmsFormCacheMgrTest, FmsFormCacheMgrTest_002, TestSize.Level0) { - APP_LOGI("fms_form_cache_mgr_test_002 start"); + HILOG_INFO("fms_form_cache_mgr_test_002 start"); std::string dataResult = ""; formCacheMgr_.cacheData_[PARAM_FORM_ID_FIRST]= "{'a':'1','b':'2'}"; @@ -100,7 +100,7 @@ HWTEST_F(FmsFormCacheMgrTest, FmsFormCacheMgrTest_002, TestSize.Level0) */ HWTEST_F(FmsFormCacheMgrTest, FmsFormCacheMgrTest_003, TestSize.Level0) { - APP_LOGI("fms_form_cache_mgr_test_003 start"); + HILOG_INFO("fms_form_cache_mgr_test_003 start"); std::string dataResult = "{'a':'1','b':'2'}"; EXPECT_TRUE(formCacheMgr_.AddData(PARAM_FORM_ID_FIRST, dataResult)); @@ -118,7 +118,7 @@ HWTEST_F(FmsFormCacheMgrTest, FmsFormCacheMgrTest_003, TestSize.Level0) */ HWTEST_F(FmsFormCacheMgrTest, FmsFormCacheMgrTest_004, TestSize.Level0) { - APP_LOGI("fms_form_cache_mgr_test_004 start"); + HILOG_INFO("fms_form_cache_mgr_test_004 start"); std::string dataResult1 = "{'a':'1','b':'2'}"; std::string dataResult2 = "{'a':'2','b':'2'}"; @@ -138,7 +138,7 @@ HWTEST_F(FmsFormCacheMgrTest, FmsFormCacheMgrTest_004, TestSize.Level0) */ HWTEST_F(FmsFormCacheMgrTest, FmsFormCacheMgrTest_010, TestSize.Level0) { - APP_LOGI("fms_form_cache_mgr_test_010 start"); + HILOG_INFO("fms_form_cache_mgr_test_010 start"); std::string dataResult1 = "{'a':'1','b':'2'}"; std::string dataResult2 = "{'a':'2','b':'2'}"; @@ -157,7 +157,7 @@ HWTEST_F(FmsFormCacheMgrTest, FmsFormCacheMgrTest_010, TestSize.Level0) */ HWTEST_F(FmsFormCacheMgrTest, FmsFormCacheMgrTest_005, TestSize.Level0) { - APP_LOGI("fms_form_cache_mgr_test_005 start"); + HILOG_INFO("fms_form_cache_mgr_test_005 start"); std::string dataResult = ""; std::string dataResult1 = "{'a':'1','b':'2'}"; @@ -180,7 +180,7 @@ HWTEST_F(FmsFormCacheMgrTest, FmsFormCacheMgrTest_005, TestSize.Level0) */ HWTEST_F(FmsFormCacheMgrTest, FmsFormCacheMgrTest_006, TestSize.Level0) { - APP_LOGI("fms_form_cache_mgr_test_006 start"); + HILOG_INFO("fms_form_cache_mgr_test_006 start"); EXPECT_TRUE(formCacheMgr_.DeleteData(PARAM_FORM_ID_SECOND)); @@ -196,7 +196,7 @@ HWTEST_F(FmsFormCacheMgrTest, FmsFormCacheMgrTest_006, TestSize.Level0) */ HWTEST_F(FmsFormCacheMgrTest, FmsFormCacheMgrTest_007, TestSize.Level0) { - APP_LOGI("fms_form_cache_mgr_test_007 start"); + HILOG_INFO("fms_form_cache_mgr_test_007 start"); std::string dataResult = ""; std::string dataResult1 = "{'a':'1','b':'2'}"; @@ -217,7 +217,7 @@ HWTEST_F(FmsFormCacheMgrTest, FmsFormCacheMgrTest_007, TestSize.Level0) */ HWTEST_F(FmsFormCacheMgrTest, FmsFormCacheMgrTest_008, TestSize.Level0) { - APP_LOGI("fms_form_cache_mgr_test_008 start"); + HILOG_INFO("fms_form_cache_mgr_test_008 start"); std::string dataResult1 = "{'a':'1','b':'2'}"; EXPECT_FALSE(formCacheMgr_.UpdateData(PARAM_FORM_ID_FIRST, dataResult1)); diff --git a/services/formmgr/test/unittest/fms_form_data_mgr_test/fms_form_data_mgr_test.cpp b/services/formmgr/test/unittest/fms_form_data_mgr_test/fms_form_data_mgr_test.cpp index 1c1d2f67dd..e82ef5566e 100644 --- a/services/formmgr/test/unittest/fms_form_data_mgr_test/fms_form_data_mgr_test.cpp +++ b/services/formmgr/test/unittest/fms_form_data_mgr_test/fms_form_data_mgr_test.cpp @@ -18,13 +18,13 @@ #include #include -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" #define private public #include "form_data_mgr.h" #undef private #include "form_constants.h" #include "form_record.h" +#include "hilog_wrapper.h" #include "mock_form_host_client.h" using namespace testing::ext; diff --git a/services/formmgr/test/unittest/fms_form_db_record_test/fms_form_db_record_test.cpp b/services/formmgr/test/unittest/fms_form_db_record_test/fms_form_db_record_test.cpp index 09f6455fd8..a70a2803bb 100644 --- a/services/formmgr/test/unittest/fms_form_db_record_test/fms_form_db_record_test.cpp +++ b/services/formmgr/test/unittest/fms_form_db_record_test/fms_form_db_record_test.cpp @@ -17,13 +17,13 @@ #include #include #include -#include "app_log_wrapper.h" #define private public #include "form_db_cache.h" #include "form_mgr_adapter.h" #include "form_storage_mgr.h" #undef private #include "form_record.h" +#include "hilog_wrapper.h" using namespace testing::ext; using namespace OHOS; diff --git a/services/formmgr/test/unittest/fms_form_mgr_notify_invisible_forms_test/fms_form_mgr_notify_invisible_forms_test.cpp b/services/formmgr/test/unittest/fms_form_mgr_notify_invisible_forms_test/fms_form_mgr_notify_invisible_forms_test.cpp index bb38d6a70f..ca821d2872 100644 --- a/services/formmgr/test/unittest/fms_form_mgr_notify_invisible_forms_test/fms_form_mgr_notify_invisible_forms_test.cpp +++ b/services/formmgr/test/unittest/fms_form_mgr_notify_invisible_forms_test/fms_form_mgr_notify_invisible_forms_test.cpp @@ -17,7 +17,6 @@ #include #include -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" #define private public #include "form_bms_helper.h" @@ -27,6 +26,7 @@ #include "form_mgr.h" #undef private #include "form_constants.h" +#include "hilog_wrapper.h" #include "mock_form_host_client.h" #include "mock_bundle_manager.h" #include "permission/permission_def.h" diff --git a/services/formmgr/test/unittest/fms_form_mgr_notify_visible_forms_test/fms_form_mgr_notify_visible_forms_test.cpp b/services/formmgr/test/unittest/fms_form_mgr_notify_visible_forms_test/fms_form_mgr_notify_visible_forms_test.cpp index a5d4d7f233..d9f7fa2c80 100644 --- a/services/formmgr/test/unittest/fms_form_mgr_notify_visible_forms_test/fms_form_mgr_notify_visible_forms_test.cpp +++ b/services/formmgr/test/unittest/fms_form_mgr_notify_visible_forms_test/fms_form_mgr_notify_visible_forms_test.cpp @@ -17,7 +17,6 @@ #include #include -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" #define private public #include "form_bms_helper.h" @@ -27,6 +26,7 @@ #include "form_mgr_service.h" #include "form_mgr_adapter.h" #undef private +#include "hilog_wrapper.h" #include "mock_bundle_manager.h" #include "mock_form_host_client.h" #include "permission/permission.h" diff --git a/services/formmgr/test/unittest/fms_form_mgr_release_form_test/fms_form_mgr_release_form_test.cpp b/services/formmgr/test/unittest/fms_form_mgr_release_form_test/fms_form_mgr_release_form_test.cpp index d8122862fc..ee7ac33dde 100644 --- a/services/formmgr/test/unittest/fms_form_mgr_release_form_test/fms_form_mgr_release_form_test.cpp +++ b/services/formmgr/test/unittest/fms_form_mgr_release_form_test/fms_form_mgr_release_form_test.cpp @@ -15,7 +15,6 @@ #include -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" #include "form_bms_helper.h" #include "form_cache_mgr.h" @@ -26,6 +25,7 @@ #include "form_mgr.h" #undef private #include "form_mgr_service.h" +#include "hilog_wrapper.h" #include "if_system_ability_manager.h" #include "ipc_skeleton.h" #include "iservice_registry.h" diff --git a/services/formmgr/test/unittest/fms_form_mgr_request_form_test/fms_form_mgr_request_form_test.cpp b/services/formmgr/test/unittest/fms_form_mgr_request_form_test/fms_form_mgr_request_form_test.cpp index 08af600355..63d6d5c2f2 100644 --- a/services/formmgr/test/unittest/fms_form_mgr_request_form_test/fms_form_mgr_request_form_test.cpp +++ b/services/formmgr/test/unittest/fms_form_mgr_request_form_test/fms_form_mgr_request_form_test.cpp @@ -14,7 +14,6 @@ */ #include -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" #include "form_data_mgr.h" #define private public @@ -23,6 +22,7 @@ #include "form_mgr_service.h" #include "form_ams_helper.h" #include "form_bms_helper.h" +#include "hilog_wrapper.h" #include "if_system_ability_manager.h" #include "ipc_skeleton.h" #include "iservice_registry.h" @@ -106,7 +106,7 @@ void FmsFormMgrRequestFormTest::TearDown() */ HWTEST_F(FmsFormMgrRequestFormTest, RequestForm_001, TestSize.Level0) { - APP_LOGI("fms_form_mgr_request_test_001 start"); + HILOG_INFO("fms_form_mgr_request_test_001 start"); int64_t formId {0X0000FFFF00000000}; int callingUid {0}; @@ -128,7 +128,7 @@ HWTEST_F(FmsFormMgrRequestFormTest, RequestForm_001, TestSize.Level0) token_->Wait(); FormDataMgr::GetInstance().DeleteFormRecord(formId); FormDataMgr::GetInstance().DeleteHostRecord(token_, formId); - APP_LOGI("fms_form_mgr_request_test_001 end"); + HILOG_INFO("fms_form_mgr_request_test_001 end"); } /* @@ -141,7 +141,7 @@ HWTEST_F(FmsFormMgrRequestFormTest, RequestForm_001, TestSize.Level0) */ HWTEST_F(FmsFormMgrRequestFormTest, RequestForm_003, TestSize.Level0) { - APP_LOGI("fms_form_mgr_request_test_003 start"); + HILOG_INFO("fms_form_mgr_request_test_003 start"); int64_t formId {0X00AAAAFF00000000}; FormItemInfo record; @@ -158,7 +158,7 @@ HWTEST_F(FmsFormMgrRequestFormTest, RequestForm_003, TestSize.Level0) token_->Wait(); FormDataMgr::GetInstance().DeleteFormRecord(formId); FormDataMgr::GetInstance().DeleteHostRecord(token_, formId); - APP_LOGI("fms_form_mgr_request_test_003 end"); + HILOG_INFO("fms_form_mgr_request_test_003 end"); } /* @@ -171,7 +171,7 @@ HWTEST_F(FmsFormMgrRequestFormTest, RequestForm_003, TestSize.Level0) */ HWTEST_F(FmsFormMgrRequestFormTest, RequestForm_004, TestSize.Level0) { - APP_LOGI("fms_form_mgr_request_test_004 start"); + HILOG_INFO("fms_form_mgr_request_test_004 start"); int64_t formId {0X000ABCFF00000000}; int64_t fakeFormId {0X0ABCDEFF00000000}; FormItemInfo record; @@ -191,6 +191,6 @@ HWTEST_F(FmsFormMgrRequestFormTest, RequestForm_004, TestSize.Level0) token_->Wait(); FormDataMgr::GetInstance().DeleteFormRecord(formId); FormDataMgr::GetInstance().DeleteHostRecord(token_, formId); - APP_LOGI("fms_form_mgr_request_test_004 end"); + HILOG_INFO("fms_form_mgr_request_test_004 end"); } } \ No newline at end of file diff --git a/services/formmgr/test/unittest/fms_form_mgr_update_form_test/fms_form_mgr_update_form_test.cpp b/services/formmgr/test/unittest/fms_form_mgr_update_form_test/fms_form_mgr_update_form_test.cpp index 311ee272f6..5ed1e919aa 100644 --- a/services/formmgr/test/unittest/fms_form_mgr_update_form_test/fms_form_mgr_update_form_test.cpp +++ b/services/formmgr/test/unittest/fms_form_mgr_update_form_test/fms_form_mgr_update_form_test.cpp @@ -76,7 +76,7 @@ void FmsFormMgrUpdateFormTest::TearDownTestCase() void FmsFormMgrUpdateFormTest::SetUp() { - APP_LOGI("fms_form_mgr_client_updateForm_test_001 setup"); + HILOG_INFO("fms_form_mgr_client_updateForm_test_001 setup"); formyMgrServ_->OnStart(); token_ = new (std::nothrow) MockFormHostClient(); diff --git a/services/formmgr/test/unittest/fms_form_provider_data_test/fms_form_provider_data_test.cpp b/services/formmgr/test/unittest/fms_form_provider_data_test/fms_form_provider_data_test.cpp index 69244b5b00..85e444ec95 100644 --- a/services/formmgr/test/unittest/fms_form_provider_data_test/fms_form_provider_data_test.cpp +++ b/services/formmgr/test/unittest/fms_form_provider_data_test/fms_form_provider_data_test.cpp @@ -20,10 +20,10 @@ #include #include -#include "app_log_wrapper.h" #define private public #include "form_provider_data.h" #undef private +#include "hilog_wrapper.h" #include "nlohmann/json.hpp" using namespace testing::ext; @@ -52,9 +52,9 @@ void FmsFormProviderDataTest::SetUp() { DIR *dirptr = opendir(FORM_DB_DATA_BASE_FILE_DIR.c_str()); if (dirptr == nullptr) { - APP_LOGW("%{public}s, opendir is fail", __func__); + HILOG_WARN("%{public}s, opendir is fail", __func__); if (-1 == mkdir(FORM_DB_DATA_BASE_FILE_DIR.c_str(), S_IRWXU)) { - APP_LOGE("%{public}s, dir create fail", __func__); + HILOG_ERROR("%{public}s, dir create fail", __func__); return; } } else { diff --git a/services/formmgr/test/unittest/fms_form_set_next_refresh_test/fms_form_set_next_refresh_test.cpp b/services/formmgr/test/unittest/fms_form_set_next_refresh_test/fms_form_set_next_refresh_test.cpp index 7d18793db1..5381727650 100644 --- a/services/formmgr/test/unittest/fms_form_set_next_refresh_test/fms_form_set_next_refresh_test.cpp +++ b/services/formmgr/test/unittest/fms_form_set_next_refresh_test/fms_form_set_next_refresh_test.cpp @@ -17,7 +17,6 @@ #include #include -#include "app_log_wrapper.h" #include "appexecfwk_errors.h" #define private public #include "form_bms_helper.h" @@ -27,6 +26,7 @@ #include "form_mgr_service.h" #include "form_timer_mgr.h" #undef private +#include "hilog_wrapper.h" #include "if_system_ability_manager.h" #include "ipc_skeleton.h" #include "iservice_registry.h" diff --git a/services/test/BUILD.gn b/services/test/BUILD.gn index d1e1565524..d84ee39d23 100644 --- a/services/test/BUILD.gn +++ b/services/test/BUILD.gn @@ -15,8 +15,8 @@ import("//foundation/aafwk/standard/aafwk.gni") config("aafwk_module_test_config") { defines = [ - # "APP_LOG_TAG = \"AbilityMgrService\"", - # "LOG_DOMAIN = 0xD00111F", + # "AMS_LOG_TAG = \"AbilityMgrService\"", + # "AMS_LOG_DOMAIN = 0xD00111F", ] configs = [ "${services_path}/abilitymgr:abilityms_config" ] diff --git a/services/test/mock/src/appmgr/system_ability_helper.cpp b/services/test/mock/src/appmgr/system_ability_helper.cpp index 5c7567701c..fd32aaf70f 100644 --- a/services/test/mock/src/appmgr/system_ability_helper.cpp +++ b/services/test/mock/src/appmgr/system_ability_helper.cpp @@ -17,7 +17,7 @@ #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "mock_ability_mgr_host.h" #include "system_ability_definition.h" @@ -27,7 +27,7 @@ static std::map> g_abilities; sptr SystemAbilityHelper::GetSystemAbility(const int32_t systemAbilityId) { - APP_LOGD("mock system ability helper get %{public}d system ability", systemAbilityId); + HILOG_DEBUG("mock system ability helper get %{public}d system ability", systemAbilityId); auto iter = g_abilities.find(systemAbilityId); if (iter != g_abilities.end()) { return iter->second; @@ -41,9 +41,9 @@ sptr SystemAbilityHelper::GetSystemAbility(const int32_t systemAb bool SystemAbilityHelper::AddSystemAbility(const int32_t systemAbilityId, const sptr &systemAbility) { if (g_abilities.erase(systemAbilityId) > 0) { - APP_LOGD("mock system ability helper add system ability erase exist key"); + HILOG_DEBUG("mock system ability helper add system ability erase exist key"); } - APP_LOGD("mock system ability helper emplace %{public}d system ability", systemAbilityId); + HILOG_DEBUG("mock system ability helper emplace %{public}d system ability", systemAbilityId); g_abilities.emplace(systemAbilityId, systemAbility); // mock helper always return true. return true; @@ -51,9 +51,9 @@ bool SystemAbilityHelper::AddSystemAbility(const int32_t systemAbilityId, const bool SystemAbilityHelper::RemoveSystemAbility(const int32_t systemAbilityId) { - APP_LOGD("mock system ability helper remove system ability"); + HILOG_DEBUG("mock system ability helper remove system ability"); if (g_abilities.erase(systemAbilityId) > 0) { - APP_LOGD("mock system ability helper remove %{public}d system ability erase exist key", systemAbilityId); + HILOG_DEBUG("mock system ability helper remove %{public}d system ability erase exist key", systemAbilityId); } // mock helper always return true. return true; diff --git a/services/test/moduletest/ability_mgr_module_account_test/BUILD.gn b/services/test/moduletest/ability_mgr_module_account_test/BUILD.gn index 728c5234a0..d304427ca0 100644 --- a/services/test/moduletest/ability_mgr_module_account_test/BUILD.gn +++ b/services/test/moduletest/ability_mgr_module_account_test/BUILD.gn @@ -111,6 +111,7 @@ ohos_moduletest("ability_mgr_module_account_test") { ] external_deps = [ + "ability_base:configuration", "access_token:libaccesstoken_sdk", "bytrace_standard:bytrace_core", "ces_standard:cesfwk_core", diff --git a/services/test/moduletest/ability_record_test/BUILD.gn b/services/test/moduletest/ability_record_test/BUILD.gn index 0c2de1e795..b00798f977 100644 --- a/services/test/moduletest/ability_record_test/BUILD.gn +++ b/services/test/moduletest/ability_record_test/BUILD.gn @@ -115,6 +115,7 @@ ohos_moduletest("AbilityRecordModuleTest") { ] external_deps = [ + "ability_base:configuration", "access_token:libaccesstoken_sdk", "bundle_framework:appexecfwk_core", "bytrace_standard:bytrace_core", diff --git a/services/test/moduletest/ability_timeout_module_test/BUILD.gn b/services/test/moduletest/ability_timeout_module_test/BUILD.gn index 7708c1b463..7664b762f6 100644 --- a/services/test/moduletest/ability_timeout_module_test/BUILD.gn +++ b/services/test/moduletest/ability_timeout_module_test/BUILD.gn @@ -112,6 +112,7 @@ ohos_moduletest("ability_timeout_module_test") { ] external_deps = [ + "ability_base:configuration", "access_token:libaccesstoken_sdk", "bundle_framework:appexecfwk_core", "bytrace_standard:bytrace_core", diff --git a/services/test/moduletest/common/ams/BUILD.gn b/services/test/moduletest/common/ams/BUILD.gn index 6813c43e6d..8c313c4c2c 100755 --- a/services/test/moduletest/common/ams/BUILD.gn +++ b/services/test/moduletest/common/ams/BUILD.gn @@ -14,6 +14,18 @@ import("//build/ohos.gni") import("//foundation/aafwk/standard/aafwk.gni") +config("appmgr_test_config") { + include_dirs = [ + "//utils/system/safwk/native/include", + "//base/account/os_account/interfaces/innerkits/osaccount/native/include", + "//base/notification/ces_standard/frameworks/core/include", + "//base/notification/ces_standard/interfaces/innerkits/native/include", + "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk/main/cpp/include", + "//base/global/i18n_standard/frameworks/intl/include", + "//base/hiviewdfx/hicollie/interfaces/native/innerkits/include", + ] +} + ohos_source_set("appmgr_mst_source") { testonly = true @@ -38,7 +50,7 @@ ohos_source_set("appmgr_mst_source") { #"//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/src/appmgr/app_resident_process_info.cpp", ] - defines = [ "APP_LOG_TAG = \"AppMgrService\"" ] + defines = [ "AMS_LOG_TAG = \"AppMgrService\"" ] include_dirs = [ "//third_party/json/include", @@ -49,6 +61,7 @@ ohos_source_set("appmgr_mst_source") { ] public_configs = [ + ":appmgr_test_config", "${appexecfwk_path}/libs/libeventhandler:libeventhandler_config", "${services_path}/test:services_module_test_config", "${services_path}/appmgr:appmgr_config", @@ -89,6 +102,7 @@ ohos_source_set("appmgr_mst_source") { ] external_deps = [ + "ability_base:configuration", "appspawn:appspawn_socket_client", "bundle_framework:appexecfwk_core", "bytrace_standard:bytrace_core", diff --git a/services/test/moduletest/common/ams/ability_running_record_test/ams_ability_running_record_module_test.cpp b/services/test/moduletest/common/ams/ability_running_record_test/ams_ability_running_record_module_test.cpp index 45d723fed9..70ef4d43d1 100644 --- a/services/test/moduletest/common/ams/ability_running_record_test/ams_ability_running_record_module_test.cpp +++ b/services/test/moduletest/common/ams/ability_running_record_test/ams_ability_running_record_module_test.cpp @@ -15,12 +15,12 @@ #include "ability_running_record.h" #include -#include "app_log_wrapper.h" #include "app_record_id.h" #include "app_scheduler_host.h" #include "ability_info.h" #include "application_info.h" #include "app_running_record.h" +#include "hilog_wrapper.h" #include "mock_ability_token.h" using namespace testing::ext; @@ -205,7 +205,7 @@ std::shared_ptr AmsAbilityRunningRecordModuleTest::QueryAppRun */ HWTEST_F(AmsAbilityRunningRecordModuleTest, AddAbilityRunningRecord_001, TestSize.Level1) { - APP_LOGI("AddAbilityRunningRecord_001 start"); + HILOG_INFO("AddAbilityRunningRecord_001 start"); auto appRunningRecord = QueryAppRunningRecord(); auto caseAbilityInfo = std::make_shared(); caseAbilityInfo->name = ABILITY_RECORD_NAME; @@ -225,7 +225,7 @@ HWTEST_F(AmsAbilityRunningRecordModuleTest, AddAbilityRunningRecord_001, TestSiz EXPECT_TRUE(abilityRunningRecordWithSameName == nullptr); appRunningRecord->ClearAbility(caseAbilityRunningRecord); EXPECT_TRUE(appRunningRecord->GetAbilityRunningRecordByToken(token) == nullptr); - APP_LOGI("AddAbilityRunningRecord_001 end"); + HILOG_INFO("AddAbilityRunningRecord_001 end"); } /* @@ -238,7 +238,7 @@ HWTEST_F(AmsAbilityRunningRecordModuleTest, AddAbilityRunningRecord_001, TestSiz */ HWTEST_F(AmsAbilityRunningRecordModuleTest, AddAbilityRunningRecord_002, TestSize.Level1) { - APP_LOGI("AddAbilityRunningRecord_002 start"); + HILOG_INFO("AddAbilityRunningRecord_002 start"); int i; auto appRunningRecord = QueryAppRunningRecord(); auto appInfo = std::make_shared(); @@ -259,7 +259,7 @@ HWTEST_F(AmsAbilityRunningRecordModuleTest, AddAbilityRunningRecord_002, TestSiz EXPECT_EQ(caseAbilityRunningRecord, appRunningRecord->GetAbilityRunningRecordByToken(token)); EXPECT_EQ(caseAbilityRunningRecord->GetState(), AbilityState::ABILITY_STATE_BEGIN); } - APP_LOGI("AddAbilityRunningRecord_002 end"); + HILOG_INFO("AddAbilityRunningRecord_002 end"); } /* @@ -272,7 +272,7 @@ HWTEST_F(AmsAbilityRunningRecordModuleTest, AddAbilityRunningRecord_002, TestSiz */ HWTEST_F(AmsAbilityRunningRecordModuleTest, UpdateAbilityRunningRecord_001, TestSize.Level1) { - APP_LOGI("UpdateAbilityRunningRecord_001 start"); + HILOG_INFO("UpdateAbilityRunningRecord_001 start"); int i; auto appRunningRecord = QueryAppRunningRecord(); auto appInfo = std::make_shared(); @@ -298,7 +298,7 @@ HWTEST_F(AmsAbilityRunningRecordModuleTest, UpdateAbilityRunningRecord_001, Test appRunningRecord->UpdateAbilityState(token, AbilityState::ABILITY_STATE_BACKGROUND); EXPECT_EQ(caseAbilityRunningRecord->GetState(), AbilityState::ABILITY_STATE_BACKGROUND); } - APP_LOGI("UpdateAbilityRunningRecord_001 end"); + HILOG_INFO("UpdateAbilityRunningRecord_001 end"); } /* @@ -311,7 +311,7 @@ HWTEST_F(AmsAbilityRunningRecordModuleTest, UpdateAbilityRunningRecord_001, Test */ HWTEST_F(AmsAbilityRunningRecordModuleTest, UpdateAbilityRunningRecord_002, TestSize.Level1) { - APP_LOGI("UpdateAbilityRunningRecord_002 start"); + HILOG_INFO("UpdateAbilityRunningRecord_002 start"); int i; auto appRunningRecord = QueryAppRunningRecord(); auto appInfo = std::make_shared(); @@ -333,7 +333,7 @@ HWTEST_F(AmsAbilityRunningRecordModuleTest, UpdateAbilityRunningRecord_002, Test appRunningRecord->UpdateAbilityState(token, AbilityState::ABILITY_STATE_END); EXPECT_EQ(caseAbilityRunningRecord->GetState(), AbilityState::ABILITY_STATE_BEGIN); } - APP_LOGI("UpdateAbilityRunningRecord_002 end"); + HILOG_INFO("UpdateAbilityRunningRecord_002 end"); } /* @@ -346,7 +346,7 @@ HWTEST_F(AmsAbilityRunningRecordModuleTest, UpdateAbilityRunningRecord_002, Test */ HWTEST_F(AmsAbilityRunningRecordModuleTest, UpdateAbilityRunningRecord_003, TestSize.Level1) { - APP_LOGI("UpdateAbilityRunningRecord_003 start"); + HILOG_INFO("UpdateAbilityRunningRecord_003 start"); int i; auto appRunningRecord = QueryAppRunningRecord(); auto appInfo = std::make_shared(); @@ -372,7 +372,7 @@ HWTEST_F(AmsAbilityRunningRecordModuleTest, UpdateAbilityRunningRecord_003, Test appRunningRecord->UpdateAbilityState(token, AbilityState::ABILITY_STATE_READY); EXPECT_EQ(caseAbilityRunningRecord->GetState(), AbilityState::ABILITY_STATE_BACKGROUND); } - APP_LOGI("UpdateAbilityRunningRecord_003 end"); + HILOG_INFO("UpdateAbilityRunningRecord_003 end"); } /* @@ -385,7 +385,7 @@ HWTEST_F(AmsAbilityRunningRecordModuleTest, UpdateAbilityRunningRecord_003, Test */ HWTEST_F(AmsAbilityRunningRecordModuleTest, ClearAbilityRunningRecord_001, TestSize.Level1) { - APP_LOGI("ClearAbilityRunningRecord_001 start"); + HILOG_INFO("ClearAbilityRunningRecord_001 start"); int i; auto appRunningRecord = QueryAppRunningRecord(); auto appInfo = std::make_shared(); @@ -413,7 +413,7 @@ HWTEST_F(AmsAbilityRunningRecordModuleTest, ClearAbilityRunningRecord_001, TestS appRunningRecord->ClearAbility(caseAbilityRunningRecord); EXPECT_TRUE(appRunningRecord->GetAbilityRunningRecordByToken(token) == nullptr); } - APP_LOGI("ClearAbilityRunningRecord_001 end"); + HILOG_INFO("ClearAbilityRunningRecord_001 end"); } /* @@ -426,7 +426,7 @@ HWTEST_F(AmsAbilityRunningRecordModuleTest, ClearAbilityRunningRecord_001, TestS */ HWTEST_F(AmsAbilityRunningRecordModuleTest, ClearAbilityRunningRecord_002, TestSize.Level1) { - APP_LOGI("ClearAbilityRunningRecord_002 start"); + HILOG_INFO("ClearAbilityRunningRecord_002 start"); int i; auto appRunningRecord = QueryAppRunningRecord(); auto appInfo = std::make_shared(); @@ -452,7 +452,7 @@ HWTEST_F(AmsAbilityRunningRecordModuleTest, ClearAbilityRunningRecord_002, TestS auto abilityMap = appRunningRecord->GetAbilities(); EXPECT_TRUE(abilityMap.empty()); } - APP_LOGI("ClearAbilityRunningRecord_002 end"); + HILOG_INFO("ClearAbilityRunningRecord_002 end"); } /* @@ -465,7 +465,7 @@ HWTEST_F(AmsAbilityRunningRecordModuleTest, ClearAbilityRunningRecord_002, TestS */ HWTEST_F(AmsAbilityRunningRecordModuleTest, OperateAbilityRunningRecord_001, TestSize.Level1) { - APP_LOGI("OperateAbilityRunningRecord_001 start"); + HILOG_INFO("OperateAbilityRunningRecord_001 start"); int i; auto appRunningRecord = QueryAppRunningRecord(); auto appInfo = std::make_shared(); @@ -493,7 +493,7 @@ HWTEST_F(AmsAbilityRunningRecordModuleTest, OperateAbilityRunningRecord_001, Tes appRunningRecord->ClearAbility(caseAbilityRunningRecord); EXPECT_TRUE(appRunningRecord->GetAbilityRunningRecordByToken(token) == nullptr); } - APP_LOGI("OperateAbilityRunningRecord_001 end"); + HILOG_INFO("OperateAbilityRunningRecord_001 end"); } } // namespace AppExecFwk } // namespace OHOS diff --git a/services/test/moduletest/common/ams/app_life_cycle_test/ams_app_life_cycle_module_test.cpp b/services/test/moduletest/common/ams/app_life_cycle_test/ams_app_life_cycle_module_test.cpp index 16b9b75b90..5944178afd 100755 --- a/services/test/moduletest/common/ams/app_life_cycle_test/ams_app_life_cycle_module_test.cpp +++ b/services/test/moduletest/common/ams/app_life_cycle_test/ams_app_life_cycle_module_test.cpp @@ -24,7 +24,7 @@ #include "app_mgr_interface.h" #include "iremote_object.h" #include "app_state_callback_proxy.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "refbase.h" #include "mock_bundle_manager.h" #include "mock_ability_token.h" diff --git a/services/test/moduletest/common/ams/app_recent_list_test/ams_app_recent_list_module_test.cpp b/services/test/moduletest/common/ams/app_recent_list_test/ams_app_recent_list_module_test.cpp index ba7660d872..c50fc317b3 100644 --- a/services/test/moduletest/common/ams/app_recent_list_test/ams_app_recent_list_module_test.cpp +++ b/services/test/moduletest/common/ams/app_recent_list_test/ams_app_recent_list_module_test.cpp @@ -20,8 +20,8 @@ #include #include -#include "app_log_wrapper.h" #include "refbase.h" +#include "hilog_wrapper.h" #include "iremote_object.h" #include "mock_bundle_manager.h" #include "mock_ability_token.h" @@ -139,7 +139,7 @@ void AmsAppRecentListModuleTest::CreateAppRecentList(const int32_t appNum) */ HWTEST_F(AmsAppRecentListModuleTest, Create_Recent_List_001, TestSize.Level1) { - APP_LOGI("Create_Recent_List_001 start"); + HILOG_INFO("Create_Recent_List_001 start"); EXPECT_TRUE(serviceInner_->GetRecentAppList().empty()); CreateAppRecentList(INDEX_NUM_10); EXPECT_EQ(INDEX_NUM_10, static_cast(serviceInner_->GetRecentAppList().size())); @@ -159,7 +159,7 @@ HWTEST_F(AmsAppRecentListModuleTest, Create_Recent_List_001, TestSize.Level1) serviceInner_->SetAppSpawnClient(std::unique_ptr(mockedSpawnClient)); serviceInner_->LoadAbility(token, nullptr, abilityInfo, appInfo, nullptr); EXPECT_EQ(INDEX_NUM_10, static_cast(serviceInner_->GetRecentAppList().size())); - APP_LOGI("Create_Recent_List_001 end"); + HILOG_INFO("Create_Recent_List_001 end"); } /* @@ -172,7 +172,7 @@ HWTEST_F(AmsAppRecentListModuleTest, Create_Recent_List_001, TestSize.Level1) */ HWTEST_F(AmsAppRecentListModuleTest, Create_Recent_List_002, TestSize.Level1) { - APP_LOGI("Create_Recent_List_002 start"); + HILOG_INFO("Create_Recent_List_002 start"); EXPECT_TRUE(serviceInner_->GetRecentAppList().empty()); CreateAppRecentList(INDEX_NUM_10); EXPECT_EQ(INDEX_NUM_10, static_cast(serviceInner_->GetRecentAppList().size())); @@ -194,7 +194,7 @@ HWTEST_F(AmsAppRecentListModuleTest, Create_Recent_List_002, TestSize.Level1) serviceInner_->SetAppSpawnClient(std::unique_ptr(mockedSpawnClient)); serviceInner_->LoadAbility(token, nullptr, abilityInfo, appInfo, nullptr); EXPECT_EQ(INDEX_NUM_10 + INDEX_NUM_1, static_cast(serviceInner_->GetRecentAppList().size())); - APP_LOGI("Create_Recent_List_002 end"); + HILOG_INFO("Create_Recent_List_002 end"); } /* @@ -207,7 +207,7 @@ HWTEST_F(AmsAppRecentListModuleTest, Create_Recent_List_002, TestSize.Level1) */ HWTEST_F(AmsAppRecentListModuleTest, Update_Recent_List_001, TestSize.Level1) { - APP_LOGI("Update_Recent_List_001 start"); + HILOG_INFO("Update_Recent_List_001 start"); EXPECT_TRUE(serviceInner_->GetRecentAppList().empty()); CreateAppRecentList(INDEX_NUM_10); EXPECT_EQ(INDEX_NUM_10, static_cast(serviceInner_->GetRecentAppList().size())); @@ -220,7 +220,7 @@ HWTEST_F(AmsAppRecentListModuleTest, Update_Recent_List_001, TestSize.Level1) appRecord->SetApplicationClient(client); serviceInner_->ApplicationTerminated(p); EXPECT_EQ(INDEX_NUM_10 - INDEX_NUM_1, static_cast(serviceInner_->GetRecentAppList().size())); - APP_LOGI("Update_Recent_List_001 end"); + HILOG_INFO("Update_Recent_List_001 end"); } /* @@ -233,7 +233,7 @@ HWTEST_F(AmsAppRecentListModuleTest, Update_Recent_List_001, TestSize.Level1) */ HWTEST_F(AmsAppRecentListModuleTest, Update_Recent_List_002, TestSize.Level1) { - APP_LOGI("Update_Recent_List_002 start"); + HILOG_INFO("Update_Recent_List_002 start"); EXPECT_TRUE(serviceInner_->GetRecentAppList().empty()); CreateAppRecentList(INDEX_NUM_10); EXPECT_EQ(INDEX_NUM_10, static_cast(serviceInner_->GetRecentAppList().size())); @@ -246,7 +246,7 @@ HWTEST_F(AmsAppRecentListModuleTest, Update_Recent_List_002, TestSize.Level1) wptr app = object; serviceInner_->OnRemoteDied(app); EXPECT_EQ(INDEX_NUM_10 - INDEX_NUM_1, static_cast(serviceInner_->GetRecentAppList().size())); - APP_LOGI("Update_Recent_List_002 end"); + HILOG_INFO("Update_Recent_List_002 end"); } /* @@ -259,7 +259,7 @@ HWTEST_F(AmsAppRecentListModuleTest, Update_Recent_List_002, TestSize.Level1) */ HWTEST_F(AmsAppRecentListModuleTest, Remove_Recent_List_001, TestSize.Level1) { - APP_LOGI("Remove_Recent_List_001 start"); + HILOG_INFO("Remove_Recent_List_001 start"); EXPECT_TRUE(serviceInner_->GetRecentAppList().empty()); CreateAppRecentList(INDEX_NUM_10); EXPECT_EQ(INDEX_NUM_10, static_cast(serviceInner_->GetRecentAppList().size())); @@ -276,7 +276,7 @@ HWTEST_F(AmsAppRecentListModuleTest, Remove_Recent_List_001, TestSize.Level1) serviceInner_->RemoveAppFromRecentList(appInfo->name, appInfo->bundleName); // specify process condition EXPECT_EQ(INDEX_NUM_10 - INDEX_NUM_1, static_cast(serviceInner_->GetRecentAppList().size())); - APP_LOGI("Remove_Recent_List_001 end"); + HILOG_INFO("Remove_Recent_List_001 end"); } /* @@ -289,7 +289,7 @@ HWTEST_F(AmsAppRecentListModuleTest, Remove_Recent_List_001, TestSize.Level1) */ HWTEST_F(AmsAppRecentListModuleTest, Remove_Recent_List_002, TestSize.Level1) { - APP_LOGI("Remove_Recent_List_002 start"); + HILOG_INFO("Remove_Recent_List_002 start"); EXPECT_TRUE(serviceInner_->GetRecentAppList().empty()); CreateAppRecentList(INDEX_NUM_10); EXPECT_EQ(INDEX_NUM_10, static_cast(serviceInner_->GetRecentAppList().size())); @@ -306,7 +306,7 @@ HWTEST_F(AmsAppRecentListModuleTest, Remove_Recent_List_002, TestSize.Level1) serviceInner_->RemoveAppFromRecentList(appInfo->name, appInfo->bundleName); // specify process condition } EXPECT_TRUE(serviceInner_->GetRecentAppList().empty()); - APP_LOGI("Remove_Recent_List_002 end"); + HILOG_INFO("Remove_Recent_List_002 end"); } /* @@ -319,7 +319,7 @@ HWTEST_F(AmsAppRecentListModuleTest, Remove_Recent_List_002, TestSize.Level1) */ HWTEST_F(AmsAppRecentListModuleTest, Clear_Recent_List_001, TestSize.Level1) { - APP_LOGI("Clear_Recent_List_002 start"); + HILOG_INFO("Clear_Recent_List_002 start"); EXPECT_TRUE(serviceInner_->GetRecentAppList().empty()); CreateAppRecentList(INDEX_NUM_10); EXPECT_EQ(INDEX_NUM_10, static_cast(serviceInner_->GetRecentAppList().size())); @@ -342,7 +342,7 @@ HWTEST_F(AmsAppRecentListModuleTest, Clear_Recent_List_001, TestSize.Level1) } serviceInner_->ClearRecentAppList(); EXPECT_TRUE(serviceInner_->GetRecentAppList().empty()); - APP_LOGI("Clear_Recent_List_002 end"); + HILOG_INFO("Clear_Recent_List_002 end"); } } // namespace AppExecFwk } // namespace OHOS diff --git a/services/test/moduletest/common/ams/app_service_flow_test/ams_app_service_flow_module_test.cpp b/services/test/moduletest/common/ams/app_service_flow_test/ams_app_service_flow_module_test.cpp index 905040828e..a7ddbf433e 100644 --- a/services/test/moduletest/common/ams/app_service_flow_test/ams_app_service_flow_module_test.cpp +++ b/services/test/moduletest/common/ams/app_service_flow_test/ams_app_service_flow_module_test.cpp @@ -20,10 +20,10 @@ #include "refbase.h" #include "app_launch_data.h" -#include "app_log_wrapper.h" #define private public #include "app_mgr_service_inner.h" #undef private +#include "hilog_wrapper.h" #include "mock_ability_token.h" #include "mock_bundle_manager.h" #include "mock_ability_token.h" @@ -167,7 +167,7 @@ TestApplicationPreRunningRecord AmsAppServiceFlowModuleTest::TestCreateApplicati */ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_BackKey_001, TestSize.Level1) { - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_001 start"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_001 start"); TestApplicationPreRunningRecord testAppA = TestCreateApplicationRecordAndSetState( "abilityA1", "appA", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); TestCreateApplicationRecordAndSetState("abilityA2", @@ -198,7 +198,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_BackKey_001, TestSize.Level1) EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, testAppA.GetAbility("abilityA1")->GetState()); EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, testAppA.GetAbility("abilityA2")->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_BACKGROUND, testAppA.appRecord_->GetState()); - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_001 end"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_001 end"); } /* @@ -210,7 +210,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_BackKey_001, TestSize.Level1) */ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_BackKey_002, TestSize.Level1) { - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_002 start"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_002 start"); TestApplicationPreRunningRecord testAppA = TestCreateApplicationRecordAndSetState( "abilityA1", "appA", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); TestApplicationPreRunningRecord testAppB = TestCreateApplicationRecordAndSetState( @@ -241,7 +241,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_BackKey_002, TestSize.Level1) EXPECT_EQ(ApplicationState::APP_STATE_FOREGROUND, testappC.appRecord_->GetState()); EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, testAppA.GetAbility("abilityA1")->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_BACKGROUND, testAppA.appRecord_->GetState()); - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_002 end"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_002 end"); } /* @@ -253,7 +253,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_BackKey_002, TestSize.Level1) */ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_BackKey_003, TestSize.Level1) { - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_003 start"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_003 start"); TestApplicationPreRunningRecord testAppA = TestCreateApplicationRecordAndSetState( "abilityA1", "appA", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); TestCreateApplicationRecordAndSetState("abilityA2", @@ -273,7 +273,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_BackKey_003, TestSize.Level1) EXPECT_EQ(AbilityState::ABILITY_STATE_FOREGROUND, testAppA.GetAbility("abilityA2")->GetState()); EXPECT_EQ(AbilityState::ABILITY_STATE_FOREGROUND, testAppA.GetAbility("abilityA3")->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_FOREGROUND, testAppA.appRecord_->GetState()); - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_003 end"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_003 end"); } /* @@ -285,7 +285,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_BackKey_003, TestSize.Level1) */ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_BackKey_004, TestSize.Level1) { - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_004 start"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_004 start"); TestApplicationPreRunningRecord testAppA = TestCreateApplicationRecordAndSetState( "abilityA1", "appA", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); TestCreateApplicationRecordAndSetState("abilityA2", @@ -329,7 +329,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_BackKey_004, TestSize.Level1) EXPECT_EQ(testAppA.GetAbility("abilityA1"), nullptr); EXPECT_EQ(testAppA.GetAbility("abilityA2"), nullptr); EXPECT_EQ(ApplicationState::APP_STATE_TERMINATED, testAppA.appRecord_->GetState()); - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_004 end"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_004 end"); } /* @@ -343,7 +343,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_BackKey_004, TestSize.Level1) */ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_BackKey_005, TestSize.Level1) { - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_005 start"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_005 start"); TestApplicationPreRunningRecord testAppA = TestCreateApplicationRecordAndSetState( "abilityA1", "appA", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); TestApplicationPreRunningRecord testAppB = TestCreateApplicationRecordAndSetState( @@ -383,7 +383,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_BackKey_005, TestSize.Level1) EXPECT_EQ(ApplicationState::APP_STATE_FOREGROUND, testappC.appRecord_->GetState()); EXPECT_EQ(testAppB.GetAbility("abilityB1"), nullptr); EXPECT_EQ(ApplicationState::APP_STATE_TERMINATED, testAppB.appRecord_->GetState()); - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_005 end"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_BackKey_005 end"); } /* @@ -395,7 +395,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_BackKey_005, TestSize.Level1) */ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOff_001, TestSize.Level1) { - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOff_001 start"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOff_001 start"); TestApplicationPreRunningRecord testAppA = TestCreateApplicationRecordAndSetState( "abilityA1", "appA", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); // The previous app and ability @@ -423,7 +423,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOff_001, TestSize.Level1 EXPECT_EQ(ApplicationState::APP_STATE_TERMINATED, testAppA.appRecord_->GetState()); EXPECT_EQ(testAppB.GetAbility("abilityB1"), nullptr); EXPECT_EQ(ApplicationState::APP_STATE_TERMINATED, testAppB.appRecord_->GetState()); - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOff_001 end"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOff_001 end"); } /* @@ -435,7 +435,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOff_001, TestSize.Level1 */ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOff_002, TestSize.Level1) { - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOff_002 start"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOff_002 start"); TestApplicationPreRunningRecord testAppA = TestCreateApplicationRecordAndSetState( "abilityA1", "appA", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); TestCreateApplicationRecordAndSetState("abilityA2", @@ -466,7 +466,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOff_002, TestSize.Level1 EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, testAppA.GetAbility("abilityA1")->GetState()); EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, testAppA.GetAbility("abilityA2")->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_BACKGROUND, testAppA.appRecord_->GetState()); - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOff_002 end"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOff_002 end"); } /* @@ -478,7 +478,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOff_002, TestSize.Level1 */ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOff_003, TestSize.Level1) { - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOff_003 start"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOff_003 start"); TestApplicationPreRunningRecord testAppA = TestCreateApplicationRecordAndSetState( "abilityA1", "appA", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); TestCreateApplicationRecordAndSetState("abilityA2", @@ -512,7 +512,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOff_003, TestSize.Level1 EXPECT_EQ(ApplicationState::APP_STATE_TERMINATED, testAppA.appRecord_->GetState()); EXPECT_EQ(testAppB.GetAbility("abilityB1"), nullptr); EXPECT_EQ(ApplicationState::APP_STATE_TERMINATED, testAppB.appRecord_->GetState()); - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOff_003 end"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOff_003 end"); } /* @@ -524,7 +524,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOff_003, TestSize.Level1 */ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOff_004, TestSize.Level1) { - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOff_004 start"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOff_004 start"); TestApplicationPreRunningRecord testAppA = TestCreateApplicationRecordAndSetState( "abilityA1", "appA", AbilityState::ABILITY_STATE_FOREGROUND, ApplicationState::APP_STATE_FOREGROUND); TestCreateApplicationRecordAndSetState("abilityA2", @@ -559,7 +559,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOff_004, TestSize.Level1 EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, testAppA.GetAbility("abilityA1")->GetState()); EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, testAppA.GetAbility("abilityA2")->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_BACKGROUND, testAppA.appRecord_->GetState()); - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOff_004 end"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOff_004 end"); } /* @@ -571,7 +571,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOff_004, TestSize.Level1 */ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOn_001, TestSize.Level1) { - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOn_001 start"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOn_001 start"); TestApplicationPreRunningRecord testAppA = TestCreateApplicationRecordAndSetState( "abilityA1", "appA", AbilityState::ABILITY_STATE_BACKGROUND, ApplicationState::APP_STATE_BACKGROUND); TestCreateApplicationRecordAndSetState("abilityA2", @@ -593,7 +593,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOn_001, TestSize.Level1) EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, testAppA.GetAbility("abilityA2")->GetState()); EXPECT_EQ(AbilityState::ABILITY_STATE_BACKGROUND, testAppA.GetAbility("abilityA3")->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_FOREGROUND, testAppA.appRecord_->GetState()); - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOn_001 end"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOn_001 end"); } /* @@ -605,7 +605,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOn_001, TestSize.Level1) */ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOn_002, TestSize.Level1) { - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOn_002 start"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOn_002 start"); TestApplicationPreRunningRecord testAppA = TestCreateApplicationRecordAndSetState( "abilityA1", "appA", AbilityState::ABILITY_STATE_BACKGROUND, ApplicationState::APP_STATE_BACKGROUND); TestCreateApplicationRecordAndSetState("abilityA2", @@ -629,7 +629,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOn_002, TestSize.Level1) EXPECT_EQ(AbilityState::ABILITY_STATE_FOREGROUND, testAppA.GetAbility("abilityA2")->GetState()); EXPECT_EQ(AbilityState::ABILITY_STATE_FOREGROUND, testAppA.GetAbility("abilityA3")->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_FOREGROUND, testAppA.appRecord_->GetState()); - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOn_002 end"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOn_002 end"); } /* @@ -641,7 +641,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOn_002, TestSize.Level1) */ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOn_003, TestSize.Level1) { - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOn_003 start"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOn_003 start"); TestApplicationPreRunningRecord testAppA = TestCreateApplicationRecordAndSetState( "abilityA1", "appA", AbilityState::ABILITY_STATE_BACKGROUND, ApplicationState::APP_STATE_BACKGROUND); TestCreateApplicationRecordAndSetState("abilityA2", @@ -672,7 +672,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOn_003, TestSize.Level1) EXPECT_EQ(AbilityState::ABILITY_STATE_FOREGROUND, testAppB.GetAbility("abilityB1")->GetState()); EXPECT_EQ(AbilityState::ABILITY_STATE_FOREGROUND, testAppB.GetAbility("abilityB2")->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_FOREGROUND, testAppB.appRecord_->GetState()); - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOn_003 end"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOn_003 end"); } /* @@ -684,7 +684,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOn_003, TestSize.Level1) */ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOnAndOff_001, TestSize.Level1) { - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOnAndOff_001 start"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOnAndOff_001 start"); TestApplicationPreRunningRecord testAppA = TestCreateApplicationRecordAndSetState( "abilityA1", "appA", AbilityState::ABILITY_STATE_BACKGROUND, ApplicationState::APP_STATE_BACKGROUND); TestCreateApplicationRecordAndSetState("abilityA2", @@ -715,7 +715,7 @@ HWTEST_F(AmsAppServiceFlowModuleTest, ServiceFlow_ScreenOnAndOff_001, TestSize.L EXPECT_EQ(AbilityState::ABILITY_STATE_FOREGROUND, testAppA.GetAbility("abilityA1")->GetState()); EXPECT_EQ(AbilityState::ABILITY_STATE_FOREGROUND, testAppA.GetAbility("abilityA2")->GetState()); EXPECT_EQ(ApplicationState::APP_STATE_FOREGROUND, testAppA.appRecord_->GetState()); - APP_LOGI("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOnAndOff_001 end"); + HILOG_INFO("AmsAppServiceFlowModuleTest ServiceFlow_ScreenOnAndOff_001 end"); } } // namespace AppExecFwk } // namespace OHOS diff --git a/services/test/moduletest/common/ams/service_app_spawn_client_test/ams_service_app_spawn_client_module_test.cpp b/services/test/moduletest/common/ams/service_app_spawn_client_test/ams_service_app_spawn_client_module_test.cpp index 840fe9e185..2168a943cf 100644 --- a/services/test/moduletest/common/ams/service_app_spawn_client_test/ams_service_app_spawn_client_module_test.cpp +++ b/services/test/moduletest/common/ams/service_app_spawn_client_test/ams_service_app_spawn_client_module_test.cpp @@ -27,7 +27,7 @@ #undef private #undef protected -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "mock_app_spawn_socket.h" using namespace testing::ext; @@ -62,10 +62,10 @@ public: int32_t OpenAppSpawnConnection() override { - APP_LOGI("MockedAppSpawnSocket::OpenAppSpawnConnection ready to openConnection!"); + HILOG_INFO("MockedAppSpawnSocket::OpenAppSpawnConnection ready to openConnection!"); gHasConnected_ = true; if (!gConnectSuccess_) { - APP_LOGE("MockedAppSpawnSocket::OpenAppSpawnConnection mock case failed to openConnection!"); + HILOG_ERROR("MockedAppSpawnSocket::OpenAppSpawnConnection mock case failed to openConnection!"); return ERR_APPEXECFWK_CONNECT_APPSPAWN_FAILED; } return ERR_OK; @@ -73,21 +73,21 @@ public: void CloseAppSpawnConnection() override { - APP_LOGI("MockedAppSpawnSocket::CloseAppSpawnConnection ready to openConnection!"); + HILOG_INFO("MockedAppSpawnSocket::CloseAppSpawnConnection ready to openConnection!"); } int32_t WriteMessage([[maybe_unused]] const void *buf, [[maybe_unused]] int32_t len) override { if (!gHasConnected_) { - APP_LOGE("MockedAppSpawnSocket::WriteMessage mock case not openConnection!"); + HILOG_ERROR("MockedAppSpawnSocket::WriteMessage mock case not openConnection!"); return ERR_APPEXECFWK_BAD_APPSPAWN_SOCKET; } if (!gConnectSuccess_) { - APP_LOGE("MockedAppSpawnSocket::WriteMessage mock case failed to openConnection!"); + HILOG_ERROR("MockedAppSpawnSocket::WriteMessage mock case failed to openConnection!"); return ERR_APPEXECFWK_CONNECT_APPSPAWN_FAILED; } if (!gWriteMessageSuccess_) { - APP_LOGE("MockedAppSpawnSocket::WriteMessage mock case failed to writeMessage!"); + HILOG_ERROR("MockedAppSpawnSocket::WriteMessage mock case failed to writeMessage!"); return ERR_APPEXECFWK_SOCKET_WRITE_FAILED; } return ERR_OK; @@ -96,15 +96,15 @@ public: int32_t ReadMessage(void *buf, [[maybe_unused]] int32_t len) override { if (!gHasConnected_) { - APP_LOGE("MockedAppSpawnSocket::ReadMessage mock case not openConnection!"); + HILOG_ERROR("MockedAppSpawnSocket::ReadMessage mock case not openConnection!"); return ERR_APPEXECFWK_BAD_APPSPAWN_SOCKET; } if (!gConnectSuccess_) { - APP_LOGE("MockedAppSpawnSocket::ReadMessage mock case failed to openConnection!"); + HILOG_ERROR("MockedAppSpawnSocket::ReadMessage mock case failed to openConnection!"); return ERR_APPEXECFWK_CONNECT_APPSPAWN_FAILED; } if (!gReadMessageSuccess_) { - APP_LOGE("MockedAppSpawnSocket::ReadMessage mock case failed to readMessage!"); + HILOG_ERROR("MockedAppSpawnSocket::ReadMessage mock case failed to readMessage!"); return ERR_APPEXECFWK_SOCKET_READ_FAILED; } AppSpawnPidMsg msg; @@ -199,7 +199,7 @@ void AmsServiceAppSpawnClientModuleTest::TearDown() */ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_001, TestSize.Level2) { - APP_LOGI("ConnectAppSpawnDaemon_001 start"); + HILOG_INFO("ConnectAppSpawnDaemon_001 start"); std::shared_ptr appMgrService = std::make_shared(); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appMgrService->QueryServiceState().connectionState); std::shared_ptr amsInner = std::make_shared(); @@ -213,7 +213,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_001, TestSize EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appMgrService->QueryServiceState().connectionState); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, amsInner->QueryAppSpawnConnectionState()); } - APP_LOGI("ConnectAppSpawnDaemon_001 end"); + HILOG_INFO("ConnectAppSpawnDaemon_001 end"); } /* @@ -226,7 +226,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_001, TestSize */ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_002, TestSize.Level2) { - APP_LOGI("ConnectAppSpawnDaemon_002 start"); + HILOG_INFO("ConnectAppSpawnDaemon_002 start"); std::shared_ptr appMgrService = std::make_shared(); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appMgrService->QueryServiceState().connectionState); std::shared_ptr amsInner = std::make_shared(); @@ -248,7 +248,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_002, TestSize EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appMgrService->QueryServiceState().connectionState); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, amsInner->QueryAppSpawnConnectionState()); } - APP_LOGI("ConnectAppSpawnDaemon_002 end"); + HILOG_INFO("ConnectAppSpawnDaemon_002 end"); } /* @@ -261,7 +261,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_002, TestSize */ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_003, TestSize.Level2) { - APP_LOGI("ConnectAppSpawnDaemon_003 start"); + HILOG_INFO("ConnectAppSpawnDaemon_003 start"); std::shared_ptr appMgrService = std::make_shared(); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appMgrService->QueryServiceState().connectionState); std::shared_ptr amsInner = std::make_shared(); @@ -278,7 +278,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_003, TestSize EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appMgrService->QueryServiceState().connectionState); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, amsInner->QueryAppSpawnConnectionState()); } - APP_LOGI("ConnectAppSpawnDaemon_003 end"); + HILOG_INFO("ConnectAppSpawnDaemon_003 end"); } /* @@ -291,7 +291,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_003, TestSize */ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_004, TestSize.Level1) { - APP_LOGI("ConnectAppSpawnDaemon_004 start"); + HILOG_INFO("ConnectAppSpawnDaemon_004 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr mockedAppSpawnSocket = std::make_shared(); appSpawnClient->SetSocket(mockedAppSpawnSocket); @@ -302,7 +302,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_004, TestSize EXPECT_EQ(ERR_OK, mockedAppSpawnSocket->OpenAppSpawnConnection()); appSpawnClient->CloseConnection(); } - APP_LOGI("ConnectAppSpawnDaemon_004 end"); + HILOG_INFO("ConnectAppSpawnDaemon_004 end"); } /* @@ -315,7 +315,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_004, TestSize */ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_005, TestSize.Level1) { - APP_LOGI("ConnectAppSpawnDaemon_005 start"); + HILOG_INFO("ConnectAppSpawnDaemon_005 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr mockedAppSpawnSocket = std::make_shared(); appSpawnClient->SetSocket(mockedAppSpawnSocket); @@ -330,7 +330,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_005, TestSize } appSpawnClient->CloseConnection(); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appSpawnClient->QueryConnectionState()); - APP_LOGI("ConnectAppSpawnDaemon_005 end"); + HILOG_INFO("ConnectAppSpawnDaemon_005 end"); } /* @@ -344,7 +344,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_005, TestSize */ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_006, TestSize.Level1) { - APP_LOGI("ConnectAppSpawnDaemon_006 start"); + HILOG_INFO("ConnectAppSpawnDaemon_006 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr mockedAppSpawnSocket = std::make_shared(); appSpawnClient->SetSocket(mockedAppSpawnSocket); @@ -362,7 +362,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_006, TestSize } appSpawnClient->CloseConnection(); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appSpawnClient->QueryConnectionState()); - APP_LOGI("ConnectAppSpawnDaemon_006 end"); + HILOG_INFO("ConnectAppSpawnDaemon_006 end"); } /* @@ -376,7 +376,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_006, TestSize */ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_007, TestSize.Level1) { - APP_LOGI("ConnectAppSpawnDaemon_007 start"); + HILOG_INFO("ConnectAppSpawnDaemon_007 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr mockedAppSpawnSocket = std::make_shared(); @@ -396,7 +396,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_007, TestSize } appSpawnClient->CloseConnection(); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appSpawnClient->QueryConnectionState()); - APP_LOGI("ConnectAppSpawnDaemon_007 end"); + HILOG_INFO("ConnectAppSpawnDaemon_007 end"); } /* @@ -410,7 +410,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_007, TestSize */ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_008, TestSize.Level1) { - APP_LOGI("ConnectAppSpawnDaemon_008 start"); + HILOG_INFO("ConnectAppSpawnDaemon_008 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr mockedAppSpawnSocket = std::make_shared(); @@ -430,7 +430,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_008, TestSize } appSpawnClient->CloseConnection(); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appSpawnClient->QueryConnectionState()); - APP_LOGI("ConnectAppSpawnDaemon_008 end"); + HILOG_INFO("ConnectAppSpawnDaemon_008 end"); } /* @@ -444,7 +444,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_008, TestSize */ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_009, TestSize.Level1) { - APP_LOGI("ConnectAppSpawnDaemon_009 start"); + HILOG_INFO("ConnectAppSpawnDaemon_009 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr mockedAppSpawnSocket = std::make_shared(); appSpawnClient->SetSocket(mockedAppSpawnSocket); @@ -459,7 +459,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_009, TestSize } appSpawnClient->CloseConnection(); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appSpawnClient->QueryConnectionState()); - APP_LOGI("ConnectAppSpawnDaemon_009 end"); + HILOG_INFO("ConnectAppSpawnDaemon_009 end"); } /* @@ -473,7 +473,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_009, TestSize */ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_010, TestSize.Level1) { - APP_LOGI("ConnectAppSpawnDaemon_010 start"); + HILOG_INFO("ConnectAppSpawnDaemon_010 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr mockedAppSpawnSocket = std::make_shared(); appSpawnClient->SetSocket(mockedAppSpawnSocket); @@ -488,7 +488,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_010, TestSize } appSpawnClient->CloseConnection(); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appSpawnClient->QueryConnectionState()); - APP_LOGI("ConnectAppSpawnDaemon_010 end"); + HILOG_INFO("ConnectAppSpawnDaemon_010 end"); } /* @@ -501,7 +501,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ConnectAppSpawnDaemon_010, TestSize */ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ReconnectAppSpawnDaemon_001, TestSize.Level1) { - APP_LOGI("ReconnectAppSpawnDaemon_001 start"); + HILOG_INFO("ReconnectAppSpawnDaemon_001 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr mockedAppSpawnSocket = std::make_shared(); appSpawnClient->SetSocket(mockedAppSpawnSocket); @@ -523,7 +523,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ReconnectAppSpawnDaemon_001, TestSi auto returnCode = appSpawnClient->StartProcess(params, newPid); EXPECT_EQ(pid, newPid); EXPECT_EQ(ERR_OK, returnCode); - APP_LOGI("ReconnectAppSpawnDaemon_001 end"); + HILOG_INFO("ReconnectAppSpawnDaemon_001 end"); } /* @@ -536,7 +536,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ReconnectAppSpawnDaemon_001, TestSi */ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ReconnectAppSpawnDaemon_002, TestSize.Level1) { - APP_LOGI("ReconnectAppSpawnDaemon_002 start"); + HILOG_INFO("ReconnectAppSpawnDaemon_002 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr mockedAppSpawnSocket = std::make_shared(); appSpawnClient->SetSocket(mockedAppSpawnSocket); @@ -559,7 +559,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ReconnectAppSpawnDaemon_002, TestSi auto returnCode = appSpawnClient->StartProcessImpl(params, newPid); EXPECT_EQ(pid, newPid); EXPECT_EQ(ERR_OK, returnCode); - APP_LOGI("ReconnectAppSpawnDaemon_002 end"); + HILOG_INFO("ReconnectAppSpawnDaemon_002 end"); } /* @@ -573,7 +573,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ReconnectAppSpawnDaemon_002, TestSi */ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ReconnectAppSpawnDaemon_003, TestSize.Level1) { - APP_LOGI("ReconnectAppSpawnDaemon_003 start"); + HILOG_INFO("ReconnectAppSpawnDaemon_003 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr mockedAppSpawnSocket = std::make_shared(); appSpawnClient->SetSocket(mockedAppSpawnSocket); @@ -590,7 +590,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ReconnectAppSpawnDaemon_003, TestSi auto returnCode = appSpawnClient->StartProcessImpl(params, newPid); EXPECT_NE(pid, newPid); EXPECT_EQ(ERR_APPEXECFWK_CONNECT_APPSPAWN_FAILED, returnCode); - APP_LOGI("ReconnectAppSpawnDaemon_003 end"); + HILOG_INFO("ReconnectAppSpawnDaemon_003 end"); } /* @@ -604,7 +604,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ReconnectAppSpawnDaemon_003, TestSi */ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ReconnectAppSpawnDaemon_004, TestSize.Level1) { - APP_LOGI("ReconnectAppSpawnDaemon_004 start"); + HILOG_INFO("ReconnectAppSpawnDaemon_004 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr mockedAppSpawnSocket = std::make_shared(); appSpawnClient->SetSocket(mockedAppSpawnSocket); @@ -632,7 +632,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ReconnectAppSpawnDaemon_004, TestSi EXPECT_EQ(pid, newPid); EXPECT_EQ(ERR_OK, returnCode); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appSpawnClient->QueryConnectionState()); - APP_LOGI("ReconnectAppSpawnDaemon_004 end"); + HILOG_INFO("ReconnectAppSpawnDaemon_004 end"); } /* @@ -645,7 +645,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ReconnectAppSpawnDaemon_004, TestSi */ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ReconnectAppSpawnDaemon_005, TestSize.Level1) { - APP_LOGI("ReconnectAppSpawnDaemon_005 start"); + HILOG_INFO("ReconnectAppSpawnDaemon_005 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr mockedAppSpawnSocket = std::make_shared(); appSpawnClient->SetSocket(mockedAppSpawnSocket); @@ -660,7 +660,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ReconnectAppSpawnDaemon_005, TestSi auto returnCode = appSpawnClient->StartProcess(params, newPid); EXPECT_EQ(ERR_APPEXECFWK_SOCKET_READ_FAILED, returnCode); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appSpawnClient->QueryConnectionState()); - APP_LOGI("ReconnectAppSpawnDaemon_005 end"); + HILOG_INFO("ReconnectAppSpawnDaemon_005 end"); } /* @@ -675,7 +675,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ReconnectAppSpawnDaemon_005, TestSi */ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ReconnectAppSpawnDaemon_006, TestSize.Level1) { - APP_LOGI("ReconnectAppSpawnDaemon_006 start"); + HILOG_INFO("ReconnectAppSpawnDaemon_006 start"); std::shared_ptr appSpawnClient = std::make_shared(); std::shared_ptr mockedAppSpawnSocket = std::make_shared(); appSpawnClient->SetSocket(mockedAppSpawnSocket); @@ -698,7 +698,7 @@ HWTEST_F(AmsServiceAppSpawnClientModuleTest, ReconnectAppSpawnDaemon_006, TestSi EXPECT_EQ(pid, newPid); EXPECT_EQ(ERR_OK, returnCode); EXPECT_EQ(SpawnConnectionState::STATE_NOT_CONNECT, appSpawnClient->QueryConnectionState()); - APP_LOGI("ReconnectAppSpawnDaemon_006 end"); + HILOG_INFO("ReconnectAppSpawnDaemon_006 end"); } } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file diff --git a/services/test/moduletest/common/ams/service_event_drive_test/ams_service_event_drive_module_test.cpp b/services/test/moduletest/common/ams/service_event_drive_test/ams_service_event_drive_module_test.cpp index 3bddabe678..d864216306 100644 --- a/services/test/moduletest/common/ams/service_event_drive_test/ams_service_event_drive_module_test.cpp +++ b/services/test/moduletest/common/ams/service_event_drive_test/ams_service_event_drive_module_test.cpp @@ -19,7 +19,7 @@ #include "app_mgr_service.h" #undef private #undef protected -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "semaphore_ex.h" #include @@ -188,7 +188,7 @@ void AmsServiceEventDriveModuleTest::TearDown() */ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_001, TestSize.Level2) { - APP_LOGI("AmsServiceEventDrive_001 start"); + HILOG_INFO("AmsServiceEventDrive_001 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -201,7 +201,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_001, TestSize.Leve } innerService->Wait(); EXPECT_EQ(AmsInnerState::STATE_APPLICATION_BACK_TO_FORE, innerService->GetInnerServiceState()); - APP_LOGI("AmsServiceEventDrive_001 end"); + HILOG_INFO("AmsServiceEventDrive_001 end"); } /* @@ -214,7 +214,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_001, TestSize.Leve */ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_002, TestSize.Level2) { - APP_LOGI("AmsServiceEventDrive_002 start"); + HILOG_INFO("AmsServiceEventDrive_002 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -227,7 +227,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_002, TestSize.Leve } innerService->Wait(); EXPECT_EQ(AmsInnerState::STATE_APPLICATION_FORE_TO_BACK, innerService->GetInnerServiceState()); - APP_LOGI("AmsServiceEventDrive_002 end"); + HILOG_INFO("AmsServiceEventDrive_002 end"); } /* @@ -240,7 +240,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_002, TestSize.Leve */ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_003, TestSize.Level1) { - APP_LOGI("AmsServiceEventDrive_003 start"); + HILOG_INFO("AmsServiceEventDrive_003 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -253,7 +253,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_003, TestSize.Leve } innerService->Wait(); EXPECT_EQ(AmsInnerState::STATE_APPLICATION_BACK_TO_TER, innerService->GetInnerServiceState()); - APP_LOGI("AmsServiceEventDrive_003 end"); + HILOG_INFO("AmsServiceEventDrive_003 end"); } /* @@ -266,7 +266,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_003, TestSize.Leve */ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_004, TestSize.Level2) { - APP_LOGI("AmsServiceEventDrive_004 start"); + HILOG_INFO("AmsServiceEventDrive_004 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -279,7 +279,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_004, TestSize.Leve } innerService->Wait(); EXPECT_EQ(AmsInnerState::STATE_APPLICATION_FORE_TO_TER, innerService->GetInnerServiceState()); - APP_LOGI("AmsServiceEventDrive_004 end"); + HILOG_INFO("AmsServiceEventDrive_004 end"); } /* @@ -292,7 +292,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_004, TestSize.Leve */ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_005, TestSize.Level1) { - APP_LOGI("AmsServiceEventDrive_005 start"); + HILOG_INFO("AmsServiceEventDrive_005 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -305,7 +305,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_005, TestSize.Leve } innerService->Wait(); EXPECT_EQ(AmsInnerState::STATE_APPLICATION_TER_TO_FORE, innerService->GetInnerServiceState()); - APP_LOGI("AmsServiceEventDrive_005 end"); + HILOG_INFO("AmsServiceEventDrive_005 end"); } /* @@ -318,7 +318,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_005, TestSize.Leve */ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_006, TestSize.Level2) { - APP_LOGI("AmsServiceEventDrive_006 start"); + HILOG_INFO("AmsServiceEventDrive_006 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -331,7 +331,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_006, TestSize.Leve } innerService->Wait(); EXPECT_EQ(AmsInnerState::STATE_APPLICATION_TER_TO_BACK, innerService->GetInnerServiceState()); - APP_LOGI("AmsServiceEventDrive_006 end"); + HILOG_INFO("AmsServiceEventDrive_006 end"); } /* @@ -344,7 +344,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_006, TestSize.Leve */ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_007, TestSize.Level1) { - APP_LOGI("AmsServiceEventDrive_007 start"); + HILOG_INFO("AmsServiceEventDrive_007 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -358,7 +358,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_007, TestSize.Leve } innerService->Wait(); EXPECT_EQ(AmsInnerState::STATE_APPLICATION_BACK_TO_FORE, innerService->GetInnerServiceState()); - APP_LOGI("AmsServiceEventDrive_007 end"); + HILOG_INFO("AmsServiceEventDrive_007 end"); } /* @@ -371,7 +371,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_007, TestSize.Leve */ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_008, TestSize.Level1) { - APP_LOGI("AmsServiceEventDrive_008 start"); + HILOG_INFO("AmsServiceEventDrive_008 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -385,7 +385,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_008, TestSize.Leve } innerService->Wait(); EXPECT_EQ(AmsInnerState::STATE_APPLICATION_FORE_TO_BACK, innerService->GetInnerServiceState()); - APP_LOGI("AmsServiceEventDrive_008 end"); + HILOG_INFO("AmsServiceEventDrive_008 end"); } /* @@ -398,7 +398,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_008, TestSize.Leve */ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_009, TestSize.Level1) { - APP_LOGI("AmsServiceEventDrive_009 start"); + HILOG_INFO("AmsServiceEventDrive_009 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -412,7 +412,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_009, TestSize.Leve } innerService->Wait(); EXPECT_EQ(AmsInnerState::STATE_APPLICATION_TER_TO_BACK, innerService->GetInnerServiceState()); - APP_LOGI("AmsServiceEventDrive_009 end"); + HILOG_INFO("AmsServiceEventDrive_009 end"); } /* @@ -425,7 +425,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_009, TestSize.Leve */ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_010, TestSize.Level1) { - APP_LOGI("AmsServiceEventDrive_010 start"); + HILOG_INFO("AmsServiceEventDrive_010 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -439,7 +439,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_010, TestSize.Leve } innerService->Wait(); EXPECT_EQ(AmsInnerState::STATE_APPLICATION_BACK_TO_TER, innerService->GetInnerServiceState()); - APP_LOGI("AmsServiceEventDrive_010 end"); + HILOG_INFO("AmsServiceEventDrive_010 end"); } /* @@ -452,7 +452,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_010, TestSize.Leve */ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_011, TestSize.Level1) { - APP_LOGI("AmsServiceEventDrive_011 start"); + HILOG_INFO("AmsServiceEventDrive_011 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -466,7 +466,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_011, TestSize.Leve } innerService->Wait(); EXPECT_EQ(AmsInnerState::STATE_APPLICATION_FORE_TO_TER, innerService->GetInnerServiceState()); - APP_LOGI("AmsServiceEventDrive_011 end"); + HILOG_INFO("AmsServiceEventDrive_011 end"); } /* @@ -479,7 +479,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_011, TestSize.Leve */ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_012, TestSize.Level1) { - APP_LOGI("AmsServiceEventDrive_012 start"); + HILOG_INFO("AmsServiceEventDrive_012 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -493,7 +493,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_012, TestSize.Leve } innerService->Wait(); EXPECT_EQ(AmsInnerState::STATE_APPLICATION_TER_TO_FORE, innerService->GetInnerServiceState()); - APP_LOGI("AmsServiceEventDrive_012 end"); + HILOG_INFO("AmsServiceEventDrive_012 end"); } /* @@ -506,7 +506,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_012, TestSize.Leve */ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_013, TestSize.Level1) { - APP_LOGI("AmsServiceEventDrive_013 start"); + HILOG_INFO("AmsServiceEventDrive_013 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -519,7 +519,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_013, TestSize.Leve } innerService->Wait(); EXPECT_EQ(AmsInnerState::STATE_APPLICATION_TERMINATED, innerService->GetInnerServiceState()); - APP_LOGI("AmsServiceEventDrive_013 end"); + HILOG_INFO("AmsServiceEventDrive_013 end"); } /* @@ -532,7 +532,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_013, TestSize.Leve */ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_014, TestSize.Level1) { - APP_LOGI("AmsServiceEventDrive_014 start"); + HILOG_INFO("AmsServiceEventDrive_014 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -545,7 +545,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_014, TestSize.Leve } innerService->Wait(); EXPECT_EQ(AmsInnerState::STATE_APPLICATION_BACKGROUNDED, innerService->GetInnerServiceState()); - APP_LOGI("AmsServiceEventDrive_014 end"); + HILOG_INFO("AmsServiceEventDrive_014 end"); } /* @@ -558,7 +558,7 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_014, TestSize.Leve */ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_015, TestSize.Level1) { - APP_LOGI("AmsServiceEventDrive_015 start"); + HILOG_INFO("AmsServiceEventDrive_015 start"); std::shared_ptr innerService = std::make_shared(); appMgrService_->SetInnerService(innerService); appMgrService_->OnStart(); @@ -571,5 +571,5 @@ HWTEST_F(AmsServiceEventDriveModuleTest, AmsServiceEventDrive_015, TestSize.Leve } innerService->Wait(); EXPECT_EQ(AmsInnerState::STATE_APPLICATION_FOREGROUNDED, innerService->GetInnerServiceState()); - APP_LOGI("AmsServiceEventDrive_015 end"); + HILOG_INFO("AmsServiceEventDrive_015 end"); } \ No newline at end of file diff --git a/services/test/moduletest/common/ams/service_start_process_test/ams_service_start_process_module_test.cpp b/services/test/moduletest/common/ams/service_start_process_test/ams_service_start_process_module_test.cpp index 53e88c5284..98ad9fa006 100644 --- a/services/test/moduletest/common/ams/service_start_process_test/ams_service_start_process_module_test.cpp +++ b/services/test/moduletest/common/ams/service_start_process_test/ams_service_start_process_module_test.cpp @@ -20,7 +20,7 @@ #undef private #undef protected #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" using namespace testing::ext; using namespace OHOS::AppExecFwk; @@ -67,7 +67,7 @@ void AmsServiceStartModuleTest::TearDown() */ HWTEST_F(AmsServiceStartModuleTest, AmsStartupMoretimes_001, TestSize.Level1) { - APP_LOGI("AmsStartupMoretimes_001 start"); + HILOG_INFO("AmsStartupMoretimes_001 start"); std::shared_ptr appMgrService = std::make_shared(); EXPECT_TRUE(appMgrService.get() != nullptr); std::shared_ptr innerService = std::make_shared(); @@ -81,7 +81,7 @@ HWTEST_F(AmsServiceStartModuleTest, AmsStartupMoretimes_001, TestSize.Level1) appMgrService->OnStop(); EXPECT_EQ(ServiceRunningState::STATE_NOT_START, appMgrService->QueryServiceState().serviceRunningState); - APP_LOGI("AmsStartupMoretimes_001 end"); + HILOG_INFO("AmsStartupMoretimes_001 end"); } /* @@ -94,7 +94,7 @@ HWTEST_F(AmsServiceStartModuleTest, AmsStartupMoretimes_001, TestSize.Level1) */ HWTEST_F(AmsServiceStartModuleTest, AmsStartupMoretimes_002, TestSize.Level1) { - APP_LOGI("AmsStartupMoretimes_002 start"); + HILOG_INFO("AmsStartupMoretimes_002 start"); std::shared_ptr appMgrService = std::make_shared(); EXPECT_TRUE(appMgrService.get() != nullptr); std::shared_ptr innerService = std::make_shared(); @@ -108,5 +108,5 @@ HWTEST_F(AmsServiceStartModuleTest, AmsStartupMoretimes_002, TestSize.Level1) appMgrService->OnStart(); EXPECT_EQ(ServiceRunningState::STATE_RUNNING, appMgrService->QueryServiceState().serviceRunningState); - APP_LOGI("AmsStartupMoretimes_002 end"); + HILOG_INFO("AmsStartupMoretimes_002 end"); } diff --git a/services/test/moduletest/ipc_ability_scheduler_test/BUILD.gn b/services/test/moduletest/ipc_ability_scheduler_test/BUILD.gn index df80d051f3..bb3989e550 100644 --- a/services/test/moduletest/ipc_ability_scheduler_test/BUILD.gn +++ b/services/test/moduletest/ipc_ability_scheduler_test/BUILD.gn @@ -61,6 +61,7 @@ ohos_moduletest("IpcAbilitySchedulerModuleTest") { ] external_deps = [ + "ability_base:configuration", "bundle_framework:appexecfwk_core", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", diff --git a/services/test/moduletest/running_infos_module_test/BUILD.gn b/services/test/moduletest/running_infos_module_test/BUILD.gn index c0e24fc3d3..e08e6ec101 100644 --- a/services/test/moduletest/running_infos_module_test/BUILD.gn +++ b/services/test/moduletest/running_infos_module_test/BUILD.gn @@ -108,6 +108,7 @@ ohos_moduletest("running_infos_module_test") { ] external_deps = [ + "ability_base:configuration", "access_token:libaccesstoken_sdk", "bytrace_standard:bytrace_core", "ces_standard:cesfwk_core", diff --git a/services/test/moduletest/static_start_ability_test/BUILD.gn b/services/test/moduletest/static_start_ability_test/BUILD.gn index 006c5e82d9..cba7819867 100644 --- a/services/test/moduletest/static_start_ability_test/BUILD.gn +++ b/services/test/moduletest/static_start_ability_test/BUILD.gn @@ -111,6 +111,7 @@ ohos_moduletest("static_start_ability_test") { ] external_deps = [ + "ability_base:configuration", "access_token:libaccesstoken_sdk", "bytrace_standard:bytrace_core", "ces_standard:cesfwk_core", diff --git a/services/uripermmgr/BUILD.gn b/services/uripermmgr/BUILD.gn index f33fa24b0d..2a4cfccb2c 100644 --- a/services/uripermmgr/BUILD.gn +++ b/services/uripermmgr/BUILD.gn @@ -47,12 +47,10 @@ ohos_shared_library("libupms") { "src/uri_permission_manager_stub_impl.cpp", ] - deps = [ - "${innerkits_path}/uri_permission:uri_permission_mgr", - "${innerkits_path}/want:want", - ] + deps = [ "${innerkits_path}/uri_permission:uri_permission_mgr" ] external_deps = [ + "ability_base:want", "ability_base:zuri", "access_token:libaccesstoken_sdk", "hiviewdfx_hilog_native:libhilog", diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestA/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestA/BUILD.gn index 816de4a009..3805e20a59 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestA/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestA/BUILD.gn @@ -32,8 +32,8 @@ config("amsAbilityAppendTestAConfig") { "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsAbilityAppendTestA\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsAbilityAppendTestA\"", + "AMS_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestA/src/main_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestA/src/main_ability.cpp index ea3ddd7cd7..96e4f48194 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestA/src/main_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestA/src/main_ability.cpp @@ -14,7 +14,7 @@ */ #include "main_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -31,7 +31,7 @@ void MainAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("MainAbility::Init"); + HILOG_INFO("MainAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } @@ -42,7 +42,7 @@ MainAbility::~MainAbility() void MainAbility::OnStart(const Want &want) { - APP_LOGI("MainAbility::onStart"); + HILOG_INFO("MainAbility::onStart"); SubscribeEvent(); Ability::OnStart(want); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, MAIN_ABILITY_A_CODE, "onStart"); @@ -50,7 +50,7 @@ void MainAbility::OnStart(const Want &want) void MainAbility::OnStop() { - APP_LOGI("MainAbility::OnStop"); + HILOG_INFO("MainAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, MAIN_ABILITY_A_CODE, "OnStop"); @@ -58,35 +58,35 @@ void MainAbility::OnStop() void MainAbility::OnActive() { - APP_LOGI("MainAbility::OnActive"); + HILOG_INFO("MainAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, MAIN_ABILITY_A_CODE, "OnActive"); } void MainAbility::OnInactive() { - APP_LOGI("MainAbility::OnInactive"); + HILOG_INFO("MainAbility::OnInactive"); Ability::OnInactive(); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, MAIN_ABILITY_A_CODE, "OnInactive"); } void MainAbility::OnBackground() { - APP_LOGI("MainAbility::OnBackground"); + HILOG_INFO("MainAbility::OnBackground"); Ability::OnBackground(); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, MAIN_ABILITY_A_CODE, "OnBackground"); } void MainAbility::OnForeground(const Want &want) { - APP_LOGI("MainAbility::OnForeground"); + HILOG_INFO("MainAbility::OnForeground"); Ability::OnForeground(want); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, MAIN_ABILITY_A_CODE, "OnForeground"); } Uri MainAbility::OnSetCaller() { - APP_LOGI("MainAbility::OnSetCaller"); + HILOG_INFO("MainAbility::OnSetCaller"); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, MAIN_ABILITY_A_CODE, "OnSetCaller"); return Ability::OnSetCaller(); } @@ -109,9 +109,9 @@ void MainAbility::SubscribeEvent() void FirstEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), g_EVENT_REQU_FIRST.c_str()) == 0) { auto target = data.GetData(); @@ -122,14 +122,14 @@ void FirstEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (mapTestFunc_.find(caseInfo[numZero]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[numZero]](std::stoi(caseInfo[numOne]), std::stoi(caseInfo[numTwo]), data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } void MainAbility::TestAbility(int apiIndex, int caseIndex, int code) { - APP_LOGI("MainAbility::TestAbility"); + HILOG_INFO("MainAbility::TestAbility"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestA/src/second_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestA/src/second_ability.cpp index fe9672953a..8e2e2d9ab4 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestA/src/second_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestA/src/second_ability.cpp @@ -14,7 +14,7 @@ */ #include "second_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -31,7 +31,7 @@ void SecondAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("SecondAbility::Init"); + HILOG_INFO("SecondAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } @@ -42,7 +42,7 @@ SecondAbility::~SecondAbility() void SecondAbility::OnStart(const Want &want) { - APP_LOGI("SecondAbility::onStart"); + HILOG_INFO("SecondAbility::onStart"); SubscribeEvent(); Ability::OnStart(want); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SECOND_ABILITY_A_CODE, "onStart"); @@ -50,7 +50,7 @@ void SecondAbility::OnStart(const Want &want) void SecondAbility::OnStop() { - APP_LOGI("SecondAbility::OnStop"); + HILOG_INFO("SecondAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SECOND_ABILITY_A_CODE, "OnStop"); @@ -58,35 +58,35 @@ void SecondAbility::OnStop() void SecondAbility::OnActive() { - APP_LOGI("SecondAbility::OnActive"); + HILOG_INFO("SecondAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SECOND_ABILITY_A_CODE, "OnActive"); } void SecondAbility::OnInactive() { - APP_LOGI("SecondAbility::OnInactive"); + HILOG_INFO("SecondAbility::OnInactive"); Ability::OnInactive(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SECOND_ABILITY_A_CODE, "OnInactive"); } void SecondAbility::OnBackground() { - APP_LOGI("SecondAbility::OnBackground"); + HILOG_INFO("SecondAbility::OnBackground"); Ability::OnBackground(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SECOND_ABILITY_A_CODE, "OnBackground"); } void SecondAbility::OnForeground(const Want &want) { - APP_LOGI("SecondAbility::OnForeground"); + HILOG_INFO("SecondAbility::OnForeground"); Ability::OnForeground(want); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SECOND_ABILITY_A_CODE, "OnForeground"); } void SecondAbility::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("AmsStServiceAbilityA1::OnCommand"); + HILOG_INFO("AmsStServiceAbilityA1::OnCommand"); Ability::OnCommand(want, restart, startId); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SECOND_ABILITY_A_CODE, "OnActive"); @@ -94,7 +94,7 @@ void SecondAbility::OnCommand(const AAFwk::Want &want, bool restart, int startId sptr SecondAbility::OnConnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityA1::OnConnect"); + HILOG_INFO("AmsStServiceAbilityA1::OnConnect"); sptr ret = Ability::OnConnect(want); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SECOND_ABILITY_A_CODE, "OnActive"); @@ -102,7 +102,7 @@ sptr SecondAbility::OnConnect(const Want &want) } void SecondAbility::OnDisconnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityA1::OnDisconnect"); + HILOG_INFO("AmsStServiceAbilityA1::OnDisconnect"); Ability::OnDisconnect(want); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SECOND_ABILITY_A_CODE, "OnDisconnect"); @@ -126,9 +126,9 @@ void SecondAbility::SubscribeEvent() void SecondEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), g_EVENT_REQU_SECOND.c_str()) == 0) { auto target = data.GetData(); @@ -139,14 +139,14 @@ void SecondEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (mapTestFunc_.find(caseInfo[numZero]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[numZero]](std::stoi(caseInfo[numOne]), std::stoi(caseInfo[numTwo]), data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } void SecondAbility::TestAbility(int apiIndex, int caseIndex, int code) { - APP_LOGI("SecondAbility::TestAbility"); + HILOG_INFO("SecondAbility::TestAbility"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestB/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestB/BUILD.gn index 3aa2864bed..52d81f07b4 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestB/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestB/BUILD.gn @@ -32,8 +32,8 @@ config("amsAbilityAppendTestBConfig") { "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsAbilityAppendTestB\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsAbilityAppendTestB\"", + "AMS_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestB/src/main_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestB/src/main_ability.cpp index a3f873ca15..43c85e5f61 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestB/src/main_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityAppendTestB/src/main_ability.cpp @@ -14,7 +14,7 @@ */ #include "main_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -31,13 +31,13 @@ void MainAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("MainAbility::Init"); + HILOG_INFO("MainAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } void MainAbility::OnStart(const Want &want) { - APP_LOGI("MainAbility::onStart"); + HILOG_INFO("MainAbility::onStart"); SubscribeEvent(); Ability::OnStart(want); TestUtils::PublishEvent(g_EVENT_RESP_FIRSTB_LIFECYCLE, MAIN_ABILITY_B_CODE, "onStart"); @@ -45,7 +45,7 @@ void MainAbility::OnStart(const Want &want) void MainAbility::OnStop() { - APP_LOGI("MainAbility::OnStop"); + HILOG_INFO("MainAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); TestUtils::PublishEvent(g_EVENT_RESP_FIRSTB_LIFECYCLE, MAIN_ABILITY_B_CODE, "OnStop"); @@ -53,28 +53,28 @@ void MainAbility::OnStop() void MainAbility::OnActive() { - APP_LOGI("MainAbility::OnActive"); + HILOG_INFO("MainAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent(g_EVENT_RESP_FIRSTB_LIFECYCLE, MAIN_ABILITY_B_CODE, "OnActive"); } void MainAbility::OnInactive() { - APP_LOGI("MainAbility::OnInactive"); + HILOG_INFO("MainAbility::OnInactive"); Ability::OnInactive(); TestUtils::PublishEvent(g_EVENT_RESP_FIRSTB_LIFECYCLE, MAIN_ABILITY_B_CODE, "OnInactive"); } void MainAbility::OnBackground() { - APP_LOGI("MainAbility::OnBackground"); + HILOG_INFO("MainAbility::OnBackground"); Ability::OnBackground(); TestUtils::PublishEvent(g_EVENT_RESP_FIRSTB_LIFECYCLE, MAIN_ABILITY_B_CODE, "OnBackground"); } void MainAbility::OnForeground(const Want &want) { - APP_LOGI("MainAbility::OnForeground"); + HILOG_INFO("MainAbility::OnForeground"); Ability::OnForeground(want); TestUtils::PublishEvent(g_EVENT_RESP_FIRSTB_LIFECYCLE, MAIN_ABILITY_B_CODE, "OnForeground"); } @@ -102,9 +102,9 @@ void MainAbility::SubscribeEvent() void FirstEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), g_EVENT_REQU_FIRSTB.c_str()) == 0) { auto target = data.GetData(); @@ -115,14 +115,14 @@ void FirstEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (mapTestFunc_.find(caseInfo[numZero]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[numZero]](std::stoi(caseInfo[numOne]), std::stoi(caseInfo[numTwo]), data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } void MainAbility::TestAbility(int apiIndex, int caseIndex, int code) { - APP_LOGI("MainAbility::TestAbility"); + HILOG_INFO("MainAbility::TestAbility"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/BUILD.gn index 7c2ea44053..ae8f833b8b 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/BUILD.gn @@ -27,12 +27,13 @@ config("amsAbilityVisibleTestPageAConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", ] defines = [ - "APP_LOG_TAG = \"amsAbilityVisibleTestPageA\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsAbilityVisibleTestPageA\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsAbilityVisibleTestPageA") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/include/amsabilityvisibletestpagea1.h b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/include/amsabilityvisibletestpagea1.h index b80ae5f178..85e7dd9a6b 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/include/amsabilityvisibletestpagea1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/include/amsabilityvisibletestpagea1.h @@ -22,7 +22,7 @@ #include "ability_connect_callback_proxy.h" #include "abs_shared_result_set.h" #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "data_ability_predicates.h" #include "values_bucket.h" @@ -43,7 +43,7 @@ public: void OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) override { - APP_LOGI("AbilityConnectCallback::OnAbilityConnectDone:resultCode = %{public}d", resultCode); + HILOG_INFO("AbilityConnectCallback::OnAbilityConnectDone:resultCode = %{public}d", resultCode); } /** @@ -54,7 +54,7 @@ public: */ void OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) override { - APP_LOGI("AbilityConnectCallback::OnAbilityDisconnectDone:resultCode = %{public}d", resultCode); + HILOG_INFO("AbilityConnectCallback::OnAbilityDisconnectDone:resultCode = %{public}d", resultCode); } }; diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/include/amsabilityvisibletestpagea2.h b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/include/amsabilityvisibletestpagea2.h index 1ce71962a7..b81ca183fa 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/include/amsabilityvisibletestpagea2.h +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/include/amsabilityvisibletestpagea2.h @@ -22,7 +22,7 @@ #include "ability_connect_callback_proxy.h" #include "abs_shared_result_set.h" #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "data_ability_predicates.h" #include "values_bucket.h" #include "want_agent_helper.h" @@ -45,7 +45,7 @@ public: void OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) override { - APP_LOGI("AbilityConnectCallback::OnAbilityConnectDone:resultCode = %{public}d", resultCode); + HILOG_INFO("AbilityConnectCallback::OnAbilityConnectDone:resultCode = %{public}d", resultCode); } /** @@ -56,7 +56,7 @@ public: */ void OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) override { - APP_LOGI("AbilityConnectCallback::OnAbilityDisconnectDone:resultCode = %{public}d", resultCode); + HILOG_INFO("AbilityConnectCallback::OnAbilityDisconnectDone:resultCode = %{public}d", resultCode); } }; diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/include/amsabilityvisibletestpagea3.h b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/include/amsabilityvisibletestpagea3.h index adb17b5f67..76f41badac 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/include/amsabilityvisibletestpagea3.h +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/include/amsabilityvisibletestpagea3.h @@ -22,7 +22,7 @@ #include "ability_connect_callback_proxy.h" #include "abs_shared_result_set.h" #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "data_ability_predicates.h" #include "values_bucket.h" @@ -43,7 +43,7 @@ public: void OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) override { - APP_LOGI("AbilityConnectCallback::OnAbilityConnectDone:resultCode = %{public}d", resultCode); + HILOG_INFO("AbilityConnectCallback::OnAbilityConnectDone:resultCode = %{public}d", resultCode); } /** @@ -54,7 +54,7 @@ public: */ void OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) override { - APP_LOGI("AbilityConnectCallback::OnAbilityDisconnectDone:resultCode = %{public}d", resultCode); + HILOG_INFO("AbilityConnectCallback::OnAbilityDisconnectDone:resultCode = %{public}d", resultCode); } }; diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/include/amsabilityvisibletestpagea4.h b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/include/amsabilityvisibletestpagea4.h index 2b88f5aaf5..79668ed36f 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/include/amsabilityvisibletestpagea4.h +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/include/amsabilityvisibletestpagea4.h @@ -22,7 +22,7 @@ #include "ability_connect_callback_proxy.h" #include "abs_shared_result_set.h" #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "data_ability_predicates.h" #include "values_bucket.h" @@ -43,7 +43,7 @@ public: void OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) override { - APP_LOGI("AbilityConnectCallback::OnAbilityConnectDone:resultCode = %{public}d", resultCode); + HILOG_INFO("AbilityConnectCallback::OnAbilityConnectDone:resultCode = %{public}d", resultCode); } /** @@ -54,7 +54,7 @@ public: */ void OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) override { - APP_LOGI("AbilityConnectCallback::OnAbilityDisconnectDone:resultCode = %{public}d", resultCode); + HILOG_INFO("AbilityConnectCallback::OnAbilityDisconnectDone:resultCode = %{public}d", resultCode); } }; diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/src/amsabilityvisibletestpagea1.cpp b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/src/amsabilityvisibletestpagea1.cpp index 0c0e041b42..eae8f5923c 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/src/amsabilityvisibletestpagea1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/src/amsabilityvisibletestpagea1.cpp @@ -22,7 +22,7 @@ void AmsAbilityVisibleTestPageA1::Init(const std::shared_ptr &abili const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AmsAbilityVisibleTestPageA1::Init"); + HILOG_INFO("AmsAbilityVisibleTestPageA1::Init"); Ability::Init(abilityInfo, application, handler, token); stub_ = (new (std::nothrow) AbilityConnectCallback()); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this(), stub_); @@ -33,7 +33,7 @@ void AmsAbilityVisibleTestPageA1::Init(const std::shared_ptr &abili void AmsAbilityVisibleTestPageA1::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsAbilityVisibleTestPageA1::onStart"); + HILOG_INFO("AmsAbilityVisibleTestPageA1::onStart"); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnStartCount(), eventData); @@ -41,7 +41,7 @@ void AmsAbilityVisibleTestPageA1::OnStart(const Want &want) void AmsAbilityVisibleTestPageA1::OnNewWant(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestPageA1::OnNewWant"); + HILOG_INFO("AmsAbilityVisibleTestPageA1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -49,7 +49,7 @@ void AmsAbilityVisibleTestPageA1::OnNewWant(const Want &want) void AmsAbilityVisibleTestPageA1::OnForeground(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestPageA1::OnForeground"); + HILOG_INFO("AmsAbilityVisibleTestPageA1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -57,7 +57,7 @@ void AmsAbilityVisibleTestPageA1::OnForeground(const Want &want) void AmsAbilityVisibleTestPageA1::OnStop() { - APP_LOGI("AmsAbilityVisibleTestPageA1::onStop"); + HILOG_INFO("AmsAbilityVisibleTestPageA1::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -66,7 +66,7 @@ void AmsAbilityVisibleTestPageA1::OnStop() void AmsAbilityVisibleTestPageA1::OnActive() { - APP_LOGI("AmsAbilityVisibleTestPageA1::OnActive"); + HILOG_INFO("AmsAbilityVisibleTestPageA1::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle_, ","); std::string startAbilityName = this->Split(targetAbility_, ","); @@ -101,7 +101,7 @@ void AmsAbilityVisibleTestPageA1::OnActive() void AmsAbilityVisibleTestPageA1::OnInactive() { - APP_LOGI("AmsAbilityVisibleTestPageA1::OnInactive"); + HILOG_INFO("AmsAbilityVisibleTestPageA1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -109,7 +109,7 @@ void AmsAbilityVisibleTestPageA1::OnInactive() void AmsAbilityVisibleTestPageA1::OnBackground() { - APP_LOGI("AmsAbilityVisibleTestPageA1::OnBackground"); + HILOG_INFO("AmsAbilityVisibleTestPageA1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/src/amsabilityvisibletestpagea2.cpp b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/src/amsabilityvisibletestpagea2.cpp index 3a3ac9fbff..97eb6fc9f2 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/src/amsabilityvisibletestpagea2.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/src/amsabilityvisibletestpagea2.cpp @@ -22,7 +22,7 @@ void AmsAbilityVisibleTestPageA2::Init(const std::shared_ptr &abili const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AmsAbilityVisibleTestPageA2::Init"); + HILOG_INFO("AmsAbilityVisibleTestPageA2::Init"); Ability::Init(abilityInfo, application, handler, token); std::string eventData = GetAbilityName() + STEventName::g_abilityStateInit; pageAbilityEvent.PublishEvent(STEventName::g_eventName, STEventName::g_defeventCode, eventData); @@ -33,7 +33,7 @@ void AmsAbilityVisibleTestPageA2::Init(const std::shared_ptr &abili void AmsAbilityVisibleTestPageA2::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsAbilityVisibleTestPageA2::onStart"); + HILOG_INFO("AmsAbilityVisibleTestPageA2::onStart"); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnStartCount(), eventData); @@ -41,7 +41,7 @@ void AmsAbilityVisibleTestPageA2::OnStart(const Want &want) void AmsAbilityVisibleTestPageA2::OnNewWant(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestPageA2::OnNewWant"); + HILOG_INFO("AmsAbilityVisibleTestPageA2::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -49,7 +49,7 @@ void AmsAbilityVisibleTestPageA2::OnNewWant(const Want &want) void AmsAbilityVisibleTestPageA2::OnForeground(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestPageA2::OnForeground"); + HILOG_INFO("AmsAbilityVisibleTestPageA2::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -57,7 +57,7 @@ void AmsAbilityVisibleTestPageA2::OnForeground(const Want &want) void AmsAbilityVisibleTestPageA2::OnStop() { - APP_LOGI("AmsAbilityVisibleTestPageA2::onStop"); + HILOG_INFO("AmsAbilityVisibleTestPageA2::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -66,7 +66,7 @@ void AmsAbilityVisibleTestPageA2::OnStop() void AmsAbilityVisibleTestPageA2::OnActive() { - APP_LOGI("AmsAbilityVisibleTestPageA2::OnActive"); + HILOG_INFO("AmsAbilityVisibleTestPageA2::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle_, ","); std::string startAbilityName = this->Split(targetAbility_, ","); @@ -107,7 +107,7 @@ void AmsAbilityVisibleTestPageA2::OnActive() void AmsAbilityVisibleTestPageA2::OnInactive() { - APP_LOGI("AmsAbilityVisibleTestPageA2::OnInactive"); + HILOG_INFO("AmsAbilityVisibleTestPageA2::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -115,7 +115,7 @@ void AmsAbilityVisibleTestPageA2::OnInactive() void AmsAbilityVisibleTestPageA2::OnBackground() { - APP_LOGI("AmsAbilityVisibleTestPageA2::OnBackground"); + HILOG_INFO("AmsAbilityVisibleTestPageA2::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); @@ -159,19 +159,19 @@ void AmsAbilityVisibleTestPageA2::GetAndTriggerWantAgent( std::shared_ptr wantParameter = std::make_shared(want); vec.push_back(wantParameter); WantAgentInfo info(0, operationType, WantAgentConstant::Flags::UPDATE_PRESENT_FLAG, vec, nullptr); - APP_LOGI("AmsAbilityVisibleTestPageA2::StartOtherAbility()"); + HILOG_INFO("AmsAbilityVisibleTestPageA2::StartOtherAbility()"); std::shared_ptr context = OHOS::AbilityRuntime::Context::GetApplicationContext(); std::shared_ptr agent = WantAgentHelper::GetWantAgent(context, info); if (agent == nullptr) { pageAbilityEvent.PublishEvent( STEventName::g_eventName, STEventName::g_defeventCode, STEventName::g_getWantAgentState); - APP_LOGI("AmsAbilityVisibleTestPageA2::StartOtherAbility():GetWantAgent is nullptr."); + HILOG_INFO("AmsAbilityVisibleTestPageA2::StartOtherAbility():GetWantAgent is nullptr."); return; } TriggerInfo paramsInfo; std::shared_ptr callback = std::make_shared(); WantAgentHelper::TriggerWantAgent(agent, callback, paramsInfo); - APP_LOGI("AmsAbilityVisibleTestPageA2::StartOtherAbility():WantAgentHelper::TriggerWantAgent end."); + HILOG_INFO("AmsAbilityVisibleTestPageA2::StartOtherAbility():WantAgentHelper::TriggerWantAgent end."); } REGISTER_AA(AmsAbilityVisibleTestPageA2); diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/src/amsabilityvisibletestpagea3.cpp b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/src/amsabilityvisibletestpagea3.cpp index 779118fd81..8e23be16df 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/src/amsabilityvisibletestpagea3.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/src/amsabilityvisibletestpagea3.cpp @@ -20,7 +20,7 @@ namespace AppExecFwk { void AmsAbilityVisibleTestPageA3::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsAbilityVisibleTestPageA3::onStart"); + HILOG_INFO("AmsAbilityVisibleTestPageA3::onStart"); stub_ = (new (std::nothrow) AbilityConnectCallback()); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this(), stub_); Ability::OnStart(want); @@ -30,7 +30,7 @@ void AmsAbilityVisibleTestPageA3::OnStart(const Want &want) void AmsAbilityVisibleTestPageA3::OnNewWant(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestPageA3::OnNewWant"); + HILOG_INFO("AmsAbilityVisibleTestPageA3::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -38,7 +38,7 @@ void AmsAbilityVisibleTestPageA3::OnNewWant(const Want &want) void AmsAbilityVisibleTestPageA3::OnForeground(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestPageA3::OnForeground"); + HILOG_INFO("AmsAbilityVisibleTestPageA3::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -46,7 +46,7 @@ void AmsAbilityVisibleTestPageA3::OnForeground(const Want &want) void AmsAbilityVisibleTestPageA3::OnStop() { - APP_LOGI("AmsAbilityVisibleTestPageA3::onStop"); + HILOG_INFO("AmsAbilityVisibleTestPageA3::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsAbilityVisibleTestPageA3::OnStop() void AmsAbilityVisibleTestPageA3::OnActive() { - APP_LOGI("AmsAbilityVisibleTestPageA3::OnActive"); + HILOG_INFO("AmsAbilityVisibleTestPageA3::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle_, ","); std::string startAbilityName = this->Split(targetAbility_, ","); @@ -90,7 +90,7 @@ void AmsAbilityVisibleTestPageA3::OnActive() void AmsAbilityVisibleTestPageA3::OnInactive() { - APP_LOGI("AmsAbilityVisibleTestPageA3::OnInactive"); + HILOG_INFO("AmsAbilityVisibleTestPageA3::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -98,7 +98,7 @@ void AmsAbilityVisibleTestPageA3::OnInactive() void AmsAbilityVisibleTestPageA3::OnBackground() { - APP_LOGI("AmsAbilityVisibleTestPageA3::OnBackground"); + HILOG_INFO("AmsAbilityVisibleTestPageA3::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/src/amsabilityvisibletestpagea4.cpp b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/src/amsabilityvisibletestpagea4.cpp index ed29b77455..faa1696bd6 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/src/amsabilityvisibletestpagea4.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestPageA/src/amsabilityvisibletestpagea4.cpp @@ -21,7 +21,7 @@ void AmsAbilityVisibleTestPageA4::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsAbilityVisibleTestPageA4::onStart"); + HILOG_INFO("AmsAbilityVisibleTestPageA4::onStart"); stub_ = (new (std::nothrow) AbilityConnectCallback()); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this(), stub_); Ability::OnStart(want); @@ -31,7 +31,7 @@ void AmsAbilityVisibleTestPageA4::OnStart(const Want &want) void AmsAbilityVisibleTestPageA4::OnNewWant(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestPageA4::OnNewWant"); + HILOG_INFO("AmsAbilityVisibleTestPageA4::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -39,7 +39,7 @@ void AmsAbilityVisibleTestPageA4::OnNewWant(const Want &want) void AmsAbilityVisibleTestPageA4::OnForeground(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestPageA4::OnForeground"); + HILOG_INFO("AmsAbilityVisibleTestPageA4::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -47,7 +47,7 @@ void AmsAbilityVisibleTestPageA4::OnForeground(const Want &want) void AmsAbilityVisibleTestPageA4::OnStop() { - APP_LOGI("AmsAbilityVisibleTestPageA4::onStop"); + HILOG_INFO("AmsAbilityVisibleTestPageA4::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -56,7 +56,7 @@ void AmsAbilityVisibleTestPageA4::OnStop() void AmsAbilityVisibleTestPageA4::OnActive() { - APP_LOGI("AmsAbilityVisibleTestPageA4::OnActive"); + HILOG_INFO("AmsAbilityVisibleTestPageA4::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle_, ","); std::string startAbilityName = this->Split(targetAbility_, ","); @@ -91,7 +91,7 @@ void AmsAbilityVisibleTestPageA4::OnActive() void AmsAbilityVisibleTestPageA4::OnInactive() { - APP_LOGI("AmsAbilityVisibleTestPageA4::OnInactive"); + HILOG_INFO("AmsAbilityVisibleTestPageA4::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -99,7 +99,7 @@ void AmsAbilityVisibleTestPageA4::OnInactive() void AmsAbilityVisibleTestPageA4::OnBackground() { - APP_LOGI("AmsAbilityVisibleTestPageA4::OnBackground"); + HILOG_INFO("AmsAbilityVisibleTestPageA4::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/BUILD.gn index 3ee5f26e69..c2b158cfd5 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/BUILD.gn @@ -26,12 +26,13 @@ config("amsAbilityVisibleTestServiceBConfig") { "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/frameworks/kits/appkit/native/ability_runtime", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", ] defines = [ - "APP_LOG_TAG = \"amsAbilityVisibleTestServiceB\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsAbilityVisibleTestServiceB\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsAbilityVisibleTestServiceB") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/include/amsabilityvisibletestpageb1.h b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/include/amsabilityvisibletestpageb1.h index 6bf338ec01..80e5a12cfd 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/include/amsabilityvisibletestpageb1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/include/amsabilityvisibletestpageb1.h @@ -22,7 +22,7 @@ #include "ability_connect_callback_proxy.h" #include "abs_shared_result_set.h" #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "data_ability_predicates.h" #include "values_bucket.h" @@ -43,7 +43,7 @@ public: void OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) override { - APP_LOGI("AbilityConnectCallback::OnAbilityConnectDone:resultCode = %{public}d", resultCode); + HILOG_INFO("AbilityConnectCallback::OnAbilityConnectDone:resultCode = %{public}d", resultCode); } /** @@ -54,7 +54,7 @@ public: */ void OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) override { - APP_LOGI("AbilityConnectCallback::OnAbilityDisconnectDone:resultCode = %{public}d", resultCode); + HILOG_INFO("AbilityConnectCallback::OnAbilityDisconnectDone:resultCode = %{public}d", resultCode); } }; diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/include/amsabilityvisibletestpageb2.h b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/include/amsabilityvisibletestpageb2.h index 9ff13302d8..13d8e28d46 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/include/amsabilityvisibletestpageb2.h +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/include/amsabilityvisibletestpageb2.h @@ -22,7 +22,7 @@ #include "ability_connect_callback_proxy.h" #include "abs_shared_result_set.h" #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "completed_callback.h" #include "data_ability_predicates.h" #include "values_bucket.h" @@ -47,7 +47,7 @@ public: void OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) override { - APP_LOGI("AbilityConnectCallback::OnAbilityConnectDone:resultCode = %{public}d", resultCode); + HILOG_INFO("AbilityConnectCallback::OnAbilityConnectDone:resultCode = %{public}d", resultCode); } /** @@ -58,7 +58,7 @@ public: */ void OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) override { - APP_LOGI("AbilityConnectCallback::OnAbilityDisconnectDone:resultCode = %{public}d", resultCode); + HILOG_INFO("AbilityConnectCallback::OnAbilityDisconnectDone:resultCode = %{public}d", resultCode); } }; diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/include/amsabilityvisibletestservice.h b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/include/amsabilityvisibletestservice.h index e58eaf7002..ca5af2e8d7 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/include/amsabilityvisibletestservice.h +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/include/amsabilityvisibletestservice.h @@ -23,7 +23,7 @@ #include "ability_connect_callback_proxy.h" #include "abs_shared_result_set.h" #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" #include "data_ability_predicates.h" @@ -46,7 +46,7 @@ public: void OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) override { - APP_LOGI("AbilityConnectCallback::OnAbilityConnectDone:resultCode = %{public}d", resultCode); + HILOG_INFO("AbilityConnectCallback::OnAbilityConnectDone:resultCode = %{public}d", resultCode); } /** @@ -57,7 +57,7 @@ public: */ void OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) override { - APP_LOGI("AbilityConnectCallback::OnAbilityDisconnectDone:resultCode = %{public}d", resultCode); + HILOG_INFO("AbilityConnectCallback::OnAbilityDisconnectDone:resultCode = %{public}d", resultCode); } }; diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/include/amsabilityvisibletestservicea1.h b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/include/amsabilityvisibletestservicea1.h index 1d0f1ed417..067bed3ee4 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/include/amsabilityvisibletestservicea1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/include/amsabilityvisibletestservicea1.h @@ -23,7 +23,7 @@ #include "ability_connect_callback_proxy.h" #include "abs_shared_result_set.h" #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" #include "data_ability_predicates.h" @@ -46,7 +46,7 @@ public: void OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) override { - APP_LOGI("AbilityConnectCallback::OnAbilityConnectDone:resultCode = %{public}d", resultCode); + HILOG_INFO("AbilityConnectCallback::OnAbilityConnectDone:resultCode = %{public}d", resultCode); } /** @@ -57,7 +57,7 @@ public: */ void OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) override { - APP_LOGI("AbilityConnectCallback::OnAbilityDisconnectDone:resultCode = %{public}d", resultCode); + HILOG_INFO("AbilityConnectCallback::OnAbilityDisconnectDone:resultCode = %{public}d", resultCode); } }; diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestdata.cpp b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestdata.cpp index bbc9174abc..79559542bd 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestdata.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestdata.cpp @@ -14,7 +14,7 @@ */ #include "amsabilityvisibletestdata.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" using namespace OHOS::EventFwk; @@ -28,7 +28,7 @@ AmsAbilityVisibleTestData::~AmsAbilityVisibleTestData() void AmsAbilityVisibleTestData::OnStart(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestData::OnStart"); + HILOG_INFO("AmsAbilityVisibleTestData::OnStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -37,7 +37,7 @@ void AmsAbilityVisibleTestData::OnStart(const Want &want) int AmsAbilityVisibleTestData::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) { - APP_LOGI("AmsAbilityVisibleTestData::Insert"); + HILOG_INFO("AmsAbilityVisibleTestData::Insert"); int result = Ability::Insert(uri, value); std::string eventData = GetAbilityName() + STEventName::g_abilityStateInsert; pageAbilityEvent.PublishEvent(STEventName::g_eventName, defenvntCode, eventData); @@ -46,7 +46,7 @@ int AmsAbilityVisibleTestData::Insert(const Uri &uri, const NativeRdb::ValuesBuc int AmsAbilityVisibleTestData::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsAbilityVisibleTestData::Delete"); + HILOG_INFO("AmsAbilityVisibleTestData::Delete"); int result = Ability::Delete(uri, predicates); std::string eventData = GetAbilityName() + STEventName::g_abilityStateDelete; pageAbilityEvent.PublishEvent(STEventName::g_eventName, defenvntCode, eventData); @@ -56,7 +56,7 @@ int AmsAbilityVisibleTestData::Delete(const Uri &uri, const NativeRdb::DataAbili int AmsAbilityVisibleTestData::Update( const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsAbilityVisibleTestData::Update"); + HILOG_INFO("AmsAbilityVisibleTestData::Update"); int result = Ability::Update(uri, value, predicates); std::string eventData = GetAbilityName() + STEventName::g_abilityStateUpdate; pageAbilityEvent.PublishEvent(STEventName::g_eventName, defenvntCode, eventData); @@ -66,7 +66,7 @@ int AmsAbilityVisibleTestData::Update( std::shared_ptr AmsAbilityVisibleTestData::Query( const Uri &uri, const std::vector &columns, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsAbilityVisibleTestData::Query"); + HILOG_INFO("AmsAbilityVisibleTestData::Query"); std::shared_ptr result = Ability::Query(uri, columns, predicates); std::string eventData = GetAbilityName() + STEventName::g_abilityStateQuery; pageAbilityEvent.PublishEvent(STEventName::g_eventName, defenvntCode, eventData); @@ -75,7 +75,7 @@ std::shared_ptr AmsAbilityVisibleTestData::Query( std::vector AmsAbilityVisibleTestData::GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) { - APP_LOGI("AmsAbilityVisibleTestData::GetFileTypes"); + HILOG_INFO("AmsAbilityVisibleTestData::GetFileTypes"); std::vector result = Ability::GetFileTypes(uri, mimeTypeFilter); std::string eventData = GetAbilityName() + STEventName::g_abilityStateGetFileTypes; pageAbilityEvent.PublishEvent(STEventName::g_eventName, defenvntCode, eventData); @@ -84,7 +84,7 @@ std::vector AmsAbilityVisibleTestData::GetFileTypes(const Uri &uri, int AmsAbilityVisibleTestData::OpenFile(const Uri &uri, const std::string &mode) { - APP_LOGI("AmsAbilityVisibleTestData::OpenFile"); + HILOG_INFO("AmsAbilityVisibleTestData::OpenFile"); int result = Ability::OpenFile(uri, mode); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOpenFile; pageAbilityEvent.PublishEvent(STEventName::g_eventName, defenvntCode, eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestpageb1.cpp b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestpageb1.cpp index acb02c342a..095b17803a 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestpageb1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestpageb1.cpp @@ -21,7 +21,7 @@ void AmsAbilityVisibleTestPageB1::Init(const std::shared_ptr &abili const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AmsAbilityVisibleTestPageB1::Init"); + HILOG_INFO("AmsAbilityVisibleTestPageB1::Init"); Ability::Init(abilityInfo, application, handler, token); stub_ = (new (std::nothrow) AbilityConnectCallback()); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this(), stub_); @@ -32,7 +32,7 @@ void AmsAbilityVisibleTestPageB1::Init(const std::shared_ptr &abili void AmsAbilityVisibleTestPageB1::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsAbilityVisibleTestPageB1::onStart"); + HILOG_INFO("AmsAbilityVisibleTestPageB1::onStart"); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnStartCount(), eventData); @@ -40,7 +40,7 @@ void AmsAbilityVisibleTestPageB1::OnStart(const Want &want) void AmsAbilityVisibleTestPageB1::OnNewWant(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestPageB1::OnNewWant"); + HILOG_INFO("AmsAbilityVisibleTestPageB1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -48,7 +48,7 @@ void AmsAbilityVisibleTestPageB1::OnNewWant(const Want &want) void AmsAbilityVisibleTestPageB1::OnForeground(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestPageB1::OnForeground"); + HILOG_INFO("AmsAbilityVisibleTestPageB1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -56,7 +56,7 @@ void AmsAbilityVisibleTestPageB1::OnForeground(const Want &want) void AmsAbilityVisibleTestPageB1::OnStop() { - APP_LOGI("AmsAbilityVisibleTestPageB1::onStop"); + HILOG_INFO("AmsAbilityVisibleTestPageB1::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -65,7 +65,7 @@ void AmsAbilityVisibleTestPageB1::OnStop() void AmsAbilityVisibleTestPageB1::OnActive() { - APP_LOGI("AmsAbilityVisibleTestPageB1::OnActive"); + HILOG_INFO("AmsAbilityVisibleTestPageB1::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle_, ","); std::string startAbilityName = this->Split(targetAbility_, ","); @@ -100,7 +100,7 @@ void AmsAbilityVisibleTestPageB1::OnActive() void AmsAbilityVisibleTestPageB1::OnInactive() { - APP_LOGI("AmsAbilityVisibleTestPageB1::OnInactive"); + HILOG_INFO("AmsAbilityVisibleTestPageB1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -108,7 +108,7 @@ void AmsAbilityVisibleTestPageB1::OnInactive() void AmsAbilityVisibleTestPageB1::OnBackground() { - APP_LOGI("AmsAbilityVisibleTestPageB1::OnBackground"); + HILOG_INFO("AmsAbilityVisibleTestPageB1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestpageb2.cpp b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestpageb2.cpp index 10dd093e96..6d09c52028 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestpageb2.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestpageb2.cpp @@ -22,7 +22,7 @@ void AmsAbilityVisibleTestPageB2::Init(const std::shared_ptr &abili const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AmsAbilityVisibleTestPageB2::Init"); + HILOG_INFO("AmsAbilityVisibleTestPageB2::Init"); Ability::Init(abilityInfo, application, handler, token); std::string eventData = GetAbilityName() + STEventName::g_abilityStateInit; pageAbilityEvent.PublishEvent(STEventName::g_eventName, STEventName::g_defeventCode, eventData); @@ -33,7 +33,7 @@ void AmsAbilityVisibleTestPageB2::Init(const std::shared_ptr &abili void AmsAbilityVisibleTestPageB2::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsAbilityVisibleTestPageB2::onStart"); + HILOG_INFO("AmsAbilityVisibleTestPageB2::onStart"); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnStartCount(), eventData); @@ -41,7 +41,7 @@ void AmsAbilityVisibleTestPageB2::OnStart(const Want &want) void AmsAbilityVisibleTestPageB2::OnNewWant(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestPageB2::OnNewWant"); + HILOG_INFO("AmsAbilityVisibleTestPageB2::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -49,7 +49,7 @@ void AmsAbilityVisibleTestPageB2::OnNewWant(const Want &want) void AmsAbilityVisibleTestPageB2::OnForeground(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestPageB2::OnForeground"); + HILOG_INFO("AmsAbilityVisibleTestPageB2::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -57,7 +57,7 @@ void AmsAbilityVisibleTestPageB2::OnForeground(const Want &want) void AmsAbilityVisibleTestPageB2::OnStop() { - APP_LOGI("AmsAbilityVisibleTestPageB2::onStop"); + HILOG_INFO("AmsAbilityVisibleTestPageB2::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -66,7 +66,7 @@ void AmsAbilityVisibleTestPageB2::OnStop() void AmsAbilityVisibleTestPageB2::OnActive() { - APP_LOGI("AmsAbilityVisibleTestPageB2::OnActive"); + HILOG_INFO("AmsAbilityVisibleTestPageB2::OnActive"); Ability::OnActive(); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle_, ","); @@ -111,7 +111,7 @@ void AmsAbilityVisibleTestPageB2::OnActive() void AmsAbilityVisibleTestPageB2::OnInactive() { - APP_LOGI("AmsAbilityVisibleTestPageB2::OnInactive"); + HILOG_INFO("AmsAbilityVisibleTestPageB2::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -119,7 +119,7 @@ void AmsAbilityVisibleTestPageB2::OnInactive() void AmsAbilityVisibleTestPageB2::OnBackground() { - APP_LOGI("AmsAbilityVisibleTestPageB2::OnBackground"); + HILOG_INFO("AmsAbilityVisibleTestPageB2::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); @@ -163,19 +163,19 @@ void AmsAbilityVisibleTestPageB2::GetAndTriggerWantAgent( std::shared_ptr wantParameter = std::make_shared(want); vec.push_back(wantParameter); WantAgentInfo info(0, operationType, WantAgentConstant::Flags::UPDATE_PRESENT_FLAG, vec, nullptr); - APP_LOGI("AmsAbilityVisibleTestPageB2::StartOtherAbility()"); + HILOG_INFO("AmsAbilityVisibleTestPageB2::StartOtherAbility()"); std::shared_ptr context = OHOS::AbilityRuntime::Context::GetApplicationContext(); std::shared_ptr agent = WantAgentHelper::GetWantAgent(context, info); if (agent == nullptr) { pageAbilityEvent.PublishEvent( STEventName::g_eventName, STEventName::g_defeventCode, STEventName::g_getWantAgentState); - APP_LOGI("AmsAbilityVisibleTestPageB2::StartOtherAbility():GetWantAgent is nullptr."); + HILOG_INFO("AmsAbilityVisibleTestPageB2::StartOtherAbility():GetWantAgent is nullptr."); return; } TriggerInfo paramsInfo; std::shared_ptr callback = std::make_shared(); WantAgentHelper::TriggerWantAgent(agent, callback, paramsInfo); - APP_LOGI("AmsAbilityVisibleTestPageB2::StartOtherAbility():WantAgentHelper::TriggerWantAgent end."); + HILOG_INFO("AmsAbilityVisibleTestPageB2::StartOtherAbility():WantAgentHelper::TriggerWantAgent end."); } REGISTER_AA(AmsAbilityVisibleTestPageB2); diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestservice.cpp b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestservice.cpp index 14d341e787..af4fa6304d 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestservice.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestservice.cpp @@ -14,7 +14,7 @@ */ #include "amsabilityvisibletestservice.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" using namespace OHOS::EventFwk; @@ -26,7 +26,7 @@ AmsAbilityVisibleTestService::~AmsAbilityVisibleTestService() void AmsAbilityVisibleTestService::OnStart(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestService::OnStart"); + HILOG_INFO("AmsAbilityVisibleTestService::OnStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -35,7 +35,7 @@ void AmsAbilityVisibleTestService::OnStart(const Want &want) void AmsAbilityVisibleTestService::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("AmsAbilityVisibleTestService::OnCommand"); + HILOG_INFO("AmsAbilityVisibleTestService::OnCommand"); Ability::OnCommand(want, restart, startId); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnCommand; @@ -44,7 +44,7 @@ void AmsAbilityVisibleTestService::OnCommand(const AAFwk::Want &want, bool resta void AmsAbilityVisibleTestService::OnNewWant(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestService::OnNewWant"); + HILOG_INFO("AmsAbilityVisibleTestService::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; @@ -53,7 +53,7 @@ void AmsAbilityVisibleTestService::OnNewWant(const Want &want) void AmsAbilityVisibleTestService::OnStop() { - APP_LOGI("AmsAbilityVisibleTestService::OnStop"); + HILOG_INFO("AmsAbilityVisibleTestService::OnStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); @@ -63,7 +63,7 @@ void AmsAbilityVisibleTestService::OnStop() void AmsAbilityVisibleTestService::OnActive() { - APP_LOGI("AmsAbilityVisibleTestService::OnActive"); + HILOG_INFO("AmsAbilityVisibleTestService::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnActive; @@ -72,7 +72,7 @@ void AmsAbilityVisibleTestService::OnActive() void AmsAbilityVisibleTestService::OnInactive() { - APP_LOGI("AmsAbilityVisibleTestService::OnInactive"); + HILOG_INFO("AmsAbilityVisibleTestService::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; @@ -81,7 +81,7 @@ void AmsAbilityVisibleTestService::OnInactive() void AmsAbilityVisibleTestService::OnBackground() { - APP_LOGI("AmsAbilityVisibleTestService::OnBackground"); + HILOG_INFO("AmsAbilityVisibleTestService::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; @@ -90,7 +90,7 @@ void AmsAbilityVisibleTestService::OnBackground() sptr AmsAbilityVisibleTestService::OnConnect(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestService::OnConnect"); + HILOG_INFO("AmsAbilityVisibleTestService::OnConnect"); sptr ret = Ability::OnConnect(want); GetWantInfo(want); @@ -127,7 +127,7 @@ sptr AmsAbilityVisibleTestService::OnConnect(const Want &want) void AmsAbilityVisibleTestService::OnDisconnect(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestService::OnDisconnect"); + HILOG_INFO("AmsAbilityVisibleTestService::OnDisconnect"); Ability::OnDisconnect(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnDisconnect; diff --git a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestservicea1.cpp b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestservicea1.cpp index 8bbf48e964..3d14c3c1e1 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestservicea1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsAbilityVisibleTestServiceB/src/amsabilityvisibletestservicea1.cpp @@ -14,7 +14,7 @@ */ #include "amsabilityvisibletestservicea1.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" using namespace OHOS::EventFwk; @@ -26,7 +26,7 @@ AmsAbilityVisibleTestServiceA1::~AmsAbilityVisibleTestServiceA1() void AmsAbilityVisibleTestServiceA1::OnStart(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestServiceA1::OnStart"); + HILOG_INFO("AmsAbilityVisibleTestServiceA1::OnStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -35,7 +35,7 @@ void AmsAbilityVisibleTestServiceA1::OnStart(const Want &want) void AmsAbilityVisibleTestServiceA1::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("AmsAbilityVisibleTestServiceA1::OnCommand"); + HILOG_INFO("AmsAbilityVisibleTestServiceA1::OnCommand"); Ability::OnCommand(want, restart, startId); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnCommand; @@ -44,7 +44,7 @@ void AmsAbilityVisibleTestServiceA1::OnCommand(const AAFwk::Want &want, bool res void AmsAbilityVisibleTestServiceA1::OnNewWant(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestServiceA1::OnNewWant"); + HILOG_INFO("AmsAbilityVisibleTestServiceA1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; @@ -53,7 +53,7 @@ void AmsAbilityVisibleTestServiceA1::OnNewWant(const Want &want) void AmsAbilityVisibleTestServiceA1::OnStop() { - APP_LOGI("AmsAbilityVisibleTestServiceA1::OnStop"); + HILOG_INFO("AmsAbilityVisibleTestServiceA1::OnStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); @@ -63,7 +63,7 @@ void AmsAbilityVisibleTestServiceA1::OnStop() void AmsAbilityVisibleTestServiceA1::OnActive() { - APP_LOGI("AmsAbilityVisibleTestServiceA1::OnActive"); + HILOG_INFO("AmsAbilityVisibleTestServiceA1::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnActive; @@ -72,7 +72,7 @@ void AmsAbilityVisibleTestServiceA1::OnActive() void AmsAbilityVisibleTestServiceA1::OnInactive() { - APP_LOGI("AmsAbilityVisibleTestServiceA1::OnInactive"); + HILOG_INFO("AmsAbilityVisibleTestServiceA1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; @@ -81,7 +81,7 @@ void AmsAbilityVisibleTestServiceA1::OnInactive() void AmsAbilityVisibleTestServiceA1::OnBackground() { - APP_LOGI("AmsAbilityVisibleTestServiceA1::OnBackground"); + HILOG_INFO("AmsAbilityVisibleTestServiceA1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; @@ -90,7 +90,7 @@ void AmsAbilityVisibleTestServiceA1::OnBackground() sptr AmsAbilityVisibleTestServiceA1::OnConnect(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestServiceA1::OnConnect"); + HILOG_INFO("AmsAbilityVisibleTestServiceA1::OnConnect"); sptr ret = Ability::OnConnect(want); GetWantInfo(want); @@ -127,7 +127,7 @@ sptr AmsAbilityVisibleTestServiceA1::OnConnect(const Want &want) void AmsAbilityVisibleTestServiceA1::OnDisconnect(const Want &want) { - APP_LOGI("AmsAbilityVisibleTestServiceA1::OnDisconnect"); + HILOG_INFO("AmsAbilityVisibleTestServiceA1::OnDisconnect"); Ability::OnDisconnect(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnDisconnect; diff --git a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedSingletonTest/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedSingletonTest/BUILD.gn index 69fef90ae2..76ae0f27a1 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedSingletonTest/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedSingletonTest/BUILD.gn @@ -31,8 +31,8 @@ config("amsConfigurationUpdatedSingletonTestConfig") { "${SUBST_TOOLS_DIR}/include", ] defines = [ - "APP_LOG_TAG = \"amsConfigurationUpdatedSingletonTest\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsConfigurationUpdatedSingletonTest\"", + "AMS_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedSingletonTest/src/main_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedSingletonTest/src/main_ability.cpp index 794b3ce180..22f5ea6013 100755 --- a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedSingletonTest/src/main_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedSingletonTest/src/main_ability.cpp @@ -14,7 +14,7 @@ */ #include "main_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -26,7 +26,7 @@ void MainAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("MainAbility::Init"); + HILOG_INFO("MainAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } @@ -37,7 +37,7 @@ MainAbility::~MainAbility() void MainAbility::OnStart(const Want &want) { - APP_LOGI("MainAbility::OnStart"); + HILOG_INFO("MainAbility::OnStart"); SubscribeEvent(); Ability::OnStart(want); callbackSeq += "OnStart"; @@ -46,7 +46,7 @@ void MainAbility::OnStart(const Want &want) void MainAbility::OnStop() { - APP_LOGI("MainAbility::OnStop"); + HILOG_INFO("MainAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); callbackSeq += "OnStop"; // OnInactiveOnBackgroundOnStop @@ -56,7 +56,7 @@ void MainAbility::OnStop() void MainAbility::OnActive() { - APP_LOGI("MainAbility::OnActive====<"); + HILOG_INFO("MainAbility::OnActive====<"); Ability::OnActive(); callbackSeq += "OnActive"; // OnStartOnActive TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, THIRD_ABILITY_CODE, callbackSeq); @@ -68,7 +68,7 @@ void MainAbility::OnConfigurationUpdated(const Configuration &configuration) std::string languageValue; std::string orientationValue; - APP_LOGI("MainAbility::OnConfigurationUpdated====<"); + HILOG_INFO("MainAbility::OnConfigurationUpdated====<"); Ability::OnConfigurationUpdated(configuration); languageValue = configuration.GetItem(GlobalConfigurationKey::SYSTEM_LANGUAGE); orientationValue = configuration.GetItem(GlobalConfigurationKey::SYSTEM_ORIENTATION); @@ -81,7 +81,7 @@ void MainAbility::OnConfigurationUpdated(const Configuration &configuration) void MainAbility::OnInactive() { - APP_LOGI("MainAbility::OnInactive"); + HILOG_INFO("MainAbility::OnInactive"); Ability::OnInactive(); callbackSeq += "OnInactive"; TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, THIRD_ABILITY_CODE, "OnInactive"); @@ -89,7 +89,7 @@ void MainAbility::OnInactive() void MainAbility::OnBackground() { - APP_LOGI("MainAbility::OnBackground"); + HILOG_INFO("MainAbility::OnBackground"); Ability::OnBackground(); callbackSeq += "OnBackground"; TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, THIRD_ABILITY_CODE, "OnBackground"); @@ -97,7 +97,7 @@ void MainAbility::OnBackground() void MainAbility::OnForeground(const Want &want) { - APP_LOGI("MainAbility::OnForeground"); + HILOG_INFO("MainAbility::OnForeground"); Ability::OnForeground(want); callbackSeq += "OnForeground"; TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, THIRD_ABILITY_CODE, "OnForeground"); @@ -121,15 +121,15 @@ void MainAbility::SubscribeEvent() void MainAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("MainAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("MainAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("MainAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("MainAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("MainAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("MainAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); } void MainAbility::TestAbility(int apiIndex, int caseIndex, int code) { - APP_LOGI("MainAbility::TestAbility"); + HILOG_INFO("MainAbility::TestAbility"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); diff --git a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/BUILD.gn index 9a927bb9cd..76c598da0f 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/BUILD.gn @@ -31,8 +31,8 @@ config("amsConfigurationUpdatedTestConfig") { "${SUBST_TOOLS_DIR}/include", ] defines = [ - "APP_LOG_TAG = \"amsConfigurationUpdatedTest\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsConfigurationUpdatedTest\"", + "AMS_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/src/main_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/src/main_ability.cpp index 6d2e68bd04..eab075e742 100755 --- a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/src/main_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/src/main_ability.cpp @@ -14,7 +14,7 @@ */ #include "main_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -27,7 +27,7 @@ void MainAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("MainAbility::Init"); + HILOG_INFO("MainAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } @@ -38,7 +38,7 @@ MainAbility::~MainAbility() void MainAbility::OnStart(const Want &want) { - APP_LOGI("MainAbility::OnStart"); + HILOG_INFO("MainAbility::OnStart"); SubscribeEvent(); Ability::OnStart(want); bIsBlockUpdate = false; @@ -48,7 +48,7 @@ void MainAbility::OnStart(const Want &want) void MainAbility::OnStop() { - APP_LOGI("MainAbility::OnStop"); + HILOG_INFO("MainAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); callbackSeq += "OnStop"; // OnInactiveOnBackgroundOnStop @@ -58,7 +58,7 @@ void MainAbility::OnStop() void MainAbility::OnActive() { - APP_LOGI("MainAbility::OnActive====<"); + HILOG_INFO("MainAbility::OnActive====<"); Ability::OnActive(); callbackSeq += "OnActive"; // OnStartOnActive TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, MAIN_ABILITY_CODE, callbackSeq); @@ -71,7 +71,7 @@ void MainAbility::OnBlockProcess(bool &bIsBlockFlag) if (bIsBlockFlag) { while (i-- > 0) { - APP_LOGI("MainAbility::OnBlockProcess time left %{public}d", i); + HILOG_INFO("MainAbility::OnBlockProcess time left %{public}d", i); sleep(1); } bIsBlockFlag = false; @@ -83,7 +83,7 @@ void MainAbility::OnConfigurationUpdated(const Configuration &configuration) std::string languageValue; std::string orientationValue; - APP_LOGI("MainAbility::OnConfigurationUpdated====<"); + HILOG_INFO("MainAbility::OnConfigurationUpdated====<"); Ability::OnConfigurationUpdated(configuration); OnBlockProcess(bIsBlockUpdate); languageValue = configuration.GetItem(GlobalConfigurationKey::SYSTEM_LANGUAGE); @@ -97,7 +97,7 @@ void MainAbility::OnConfigurationUpdated(const Configuration &configuration) void MainAbility::OnInactive() { - APP_LOGI("MainAbility::OnInactive"); + HILOG_INFO("MainAbility::OnInactive"); Ability::OnInactive(); callbackSeq += "OnInactive"; TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, MAIN_ABILITY_CODE, "OnInactive"); @@ -105,7 +105,7 @@ void MainAbility::OnInactive() void MainAbility::OnBackground() { - APP_LOGI("MainAbility::OnBackground"); + HILOG_INFO("MainAbility::OnBackground"); Ability::OnBackground(); callbackSeq += "OnBackground"; TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, MAIN_ABILITY_CODE, "OnBackground"); @@ -113,7 +113,7 @@ void MainAbility::OnBackground() void MainAbility::OnForeground(const Want &want) { - APP_LOGI("MainAbility::OnForeground"); + HILOG_INFO("MainAbility::OnForeground"); Ability::OnForeground(want); callbackSeq += "OnForeground"; TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, MAIN_ABILITY_CODE, "OnForeground"); @@ -137,16 +137,16 @@ void MainAbility::SubscribeEvent() void MainAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("MainAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("MainAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("MainAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("MainAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("MainAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("MainAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (strcmp(eventName.c_str(), g_EVENT_REQU_MAIN.c_str()) == 0) { auto target = data.GetData(); if (mapTestFunc_.find(target) != mapTestFunc_.end()) { mapTestFunc_[target](target, data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } @@ -157,7 +157,7 @@ void MainAbility::StartNext(std::string action, int code) std::string targetAbility = "SecondAbility"; Want want; - APP_LOGI("MainAbility::StartNext"); + HILOG_INFO("MainAbility::StartNext"); want.SetElementName(targetBundle, targetAbility); StartAbility(want); } diff --git a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/src/second_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/src/second_ability.cpp index 97968a0a2a..5661bd2979 100755 --- a/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/src/second_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsConfigurationUpdatedTest/src/second_ability.cpp @@ -14,7 +14,7 @@ */ #include "second_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -26,7 +26,7 @@ void SecondAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("SecondAbility::Init"); + HILOG_INFO("SecondAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } @@ -37,7 +37,7 @@ SecondAbility::~SecondAbility() void SecondAbility::OnStart(const Want &want) { - APP_LOGI("SecondAbility::OnStart"); + HILOG_INFO("SecondAbility::OnStart"); SubscribeEvent(); Ability::OnStart(want); callbackSeq += "OnStart"; @@ -46,7 +46,7 @@ void SecondAbility::OnStart(const Want &want) void SecondAbility::OnStop() { - APP_LOGI("SecondAbility::OnStop"); + HILOG_INFO("SecondAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); callbackSeq += "OnStop"; // OnInactiveOnBackgroundOnStop @@ -56,7 +56,7 @@ void SecondAbility::OnStop() void SecondAbility::OnActive() { - APP_LOGI("SecondAbility::OnActive====<"); + HILOG_INFO("SecondAbility::OnActive====<"); Ability::OnActive(); callbackSeq += "OnActive"; // OnStartOnActive TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, SECOND_ABILITY_CODE, callbackSeq); @@ -68,7 +68,7 @@ void SecondAbility::OnConfigurationUpdated(const Configuration &configuration) std::string languageValue; std::string orientationValue; - APP_LOGI("SecondAbility::OnConfigurationUpdated====<"); + HILOG_INFO("SecondAbility::OnConfigurationUpdated====<"); Ability::OnConfigurationUpdated(configuration); languageValue = configuration.GetItem(GlobalConfigurationKey::SYSTEM_LANGUAGE); @@ -82,7 +82,7 @@ void SecondAbility::OnConfigurationUpdated(const Configuration &configuration) void SecondAbility::OnInactive() { - APP_LOGI("SecondAbility::OnInactive"); + HILOG_INFO("SecondAbility::OnInactive"); Ability::OnInactive(); callbackSeq += "OnInactive"; TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, SECOND_ABILITY_CODE, "OnInactive"); @@ -90,7 +90,7 @@ void SecondAbility::OnInactive() void SecondAbility::OnBackground() { - APP_LOGI("SecondAbility::OnBackground"); + HILOG_INFO("SecondAbility::OnBackground"); Ability::OnBackground(); callbackSeq += "OnBackground"; TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, SECOND_ABILITY_CODE, "OnBackground"); @@ -98,7 +98,7 @@ void SecondAbility::OnBackground() void SecondAbility::OnForeground(const Want &want) { - APP_LOGI("SecondAbility::OnForeground"); + HILOG_INFO("SecondAbility::OnForeground"); Ability::OnForeground(want); callbackSeq += "OnForeground"; TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, SECOND_ABILITY_CODE, "OnForeground"); @@ -122,15 +122,15 @@ void SecondAbility::SubscribeEvent() void SecondAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("SecondAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("SecondAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("SecondAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("SecondAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("SecondAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("SecondAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); } void SecondAbility::TestAbility(int apiIndex, int caseIndex, int code) { - APP_LOGI("SecondAbility::TestAbility"); + HILOG_INFO("SecondAbility::TestAbility"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); diff --git a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestA/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestA/BUILD.gn index 7076c3b792..f9e6e6d47a 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestA/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestA/BUILD.gn @@ -32,8 +32,8 @@ config("amsDataSystemTestAConfig") { "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsDataSystemTestA\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsDataSystemTestA\"", + "AMS_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestA/src/ams_st_data_ability_data_a.cpp b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestA/src/ams_st_data_ability_data_a.cpp index 5728bb8710..0a790ccdbf 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestA/src/ams_st_data_ability_data_a.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestA/src/ams_st_data_ability_data_a.cpp @@ -18,7 +18,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "data_ability_helper.h" #include "file_ex.h" @@ -54,9 +54,9 @@ bool AmsStDataAbilityDataA::PublishEvent(const std::string &eventName, const int void DataTestDataAEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("DataTestDataAEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("DataTestDataAEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("DataTestDataAEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("DataTestDataAEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("DataTestDataAEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("DataTestDataAEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (eventName.compare(testEventName) == 0 && ABILITY_DATA_A_CODE == data.GetCode()) { std::string target = data.GetData(); @@ -92,7 +92,7 @@ void AmsStDataAbilityDataA::SubscribeEvent(const Want &want) void AmsStDataAbilityDataA::OnStart(const Want &want) { - APP_LOGI("AmsStDataAbilityDataA OnStart"); + HILOG_INFO("AmsStDataAbilityDataA OnStart"); SubscribeEvent(want); originWant_ = want; Ability::OnStart(want); @@ -101,18 +101,18 @@ void AmsStDataAbilityDataA::OnStart(const Want &want) int AmsStDataAbilityDataA::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) { - APP_LOGI("AmsStDataAbilityDataA <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataA <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_A_CODE, "Insert"); if (fd <= 0) { - APP_LOGI("AmsStDataAbilityDataA <<<>>> file fd <= 0"); + HILOG_INFO("AmsStDataAbilityDataA <<<>>> file fd <= 0"); return DEFAULT_INSERT_RESULT; } int dupFd = dup(fd); FILE *file = fdopen(dupFd, "r"); if (file == nullptr) { - APP_LOGI("AmsStDataAbilityDataA <<<>>> file == nullptr"); + HILOG_INFO("AmsStDataAbilityDataA <<<>>> file == nullptr"); } else { - APP_LOGI("AmsStDataAbilityDataA <<<>>> file != nullptr"); + HILOG_INFO("AmsStDataAbilityDataA <<<>>> file != nullptr"); fclose(file); file = nullptr; } @@ -121,14 +121,14 @@ int AmsStDataAbilityDataA::Insert(const Uri &uri, const NativeRdb::ValuesBucket int AmsStDataAbilityDataA::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsStDataAbilityDataA <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataA <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_A_CODE, "Delete"); return DEFAULT_DELETE_RESULT; } int AmsStDataAbilityDataA::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsStDataAbilityDataA <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataA <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_A_CODE, "Update"); return DEFAULT_UPDATE_RESULT; } @@ -137,7 +137,7 @@ std::shared_ptr AmsStDataAbilityDataA::Query( const Uri &uri, const std::vector &columns, const NativeRdb::DataAbilityPredicates &predicates) { subscriber_->vectorOperator_ = columns; - APP_LOGI("AmsStDataAbilityDataA <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataA <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_A_CODE, OPERATOR_QUERY); STtools::WaitCompleted(event, OPERATOR_QUERY, ABILITY_DATA_A_CODE); @@ -145,12 +145,12 @@ std::shared_ptr AmsStDataAbilityDataA::Query( std::shared_ptr resultValue = std::make_shared(OPERATOR_QUERY); if (resultValue == nullptr) { - APP_LOGE("AmsStDataAbilityDataA <<<>>> make_shared return nullptr"); + HILOG_ERROR("AmsStDataAbilityDataA <<<>>> make_shared return nullptr"); return nullptr; } AppDataFwk::SharedBlock *pSharedBlock = resultValue->GetBlock(); if (pSharedBlock == nullptr) { - APP_LOGE("AmsStDataAbilityDataA <<<>>> GetBlock return nullptr"); + HILOG_ERROR("AmsStDataAbilityDataA <<<>>> GetBlock return nullptr"); return nullptr; } pSharedBlock->PutString(0, 0, OPERATOR_QUERY.c_str(), OPERATOR_QUERY.size() + 1); @@ -159,7 +159,7 @@ std::shared_ptr AmsStDataAbilityDataA::Query( std::vector AmsStDataAbilityDataA::GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) { - APP_LOGI("AmsStDataAbilityDataA <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataA <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_A_CODE, "GetFileTypes"); std::vector fileType { "filetypes", @@ -169,7 +169,7 @@ std::vector AmsStDataAbilityDataA::GetFileTypes(const Uri &uri, con int AmsStDataAbilityDataA::OpenFile(const Uri &uri, const std::string &mode) { - APP_LOGI("AmsStDataAbilityDataA <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataA <<<>>>"); if (file != nullptr) { fclose(file); @@ -178,11 +178,11 @@ int AmsStDataAbilityDataA::OpenFile(const Uri &uri, const std::string &mode) } file = fopen("/system/vendor/test.txt", "r"); if (file == nullptr) { - APP_LOGI("AmsStDataAbilityDataA <<<>>> fdr == nullptr"); + HILOG_INFO("AmsStDataAbilityDataA <<<>>> fdr == nullptr"); return -1; } fd = fileno(file); - APP_LOGI("AmsStDataAbilityDataA fd: %{public}d", fd); + HILOG_INFO("AmsStDataAbilityDataA fd: %{public}d", fd); PublishEvent(abilityEventName, ABILITY_DATA_A_CODE, "OpenFile"); return fd; } @@ -231,30 +231,30 @@ static void GetResult(std::shared_ptr child, std::shared_pt void DataTestDataAEventSubscriber::TestPost(const std::string funName) { - APP_LOGI("DataTestDataAEventSubscriber::TestPost %{public}s", funName.c_str()); + HILOG_INFO("DataTestDataAEventSubscriber::TestPost %{public}s", funName.c_str()); STtools::StOperator allOperator {}; STtools::DeserializationStOperatorFromVector(allOperator, vectorOperator_); for (auto child : allOperator.GetChildOperator()) { - APP_LOGI("---------data--------targetBundle:%{public}s", child->GetBundleName().c_str()); - APP_LOGI("---------data--------targetAbility:%{public}s", child->GetAbilityName().c_str()); - APP_LOGI("---------data--------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); - APP_LOGI("---------data--------operatorName:%{public}s", child->GetOperatorName().c_str()); - APP_LOGI("---------data--------childOperatorNum:%{public}zu", child->GetChildOperator().size()); + HILOG_INFO("---------data--------targetBundle:%{public}s", child->GetBundleName().c_str()); + HILOG_INFO("---------data--------targetAbility:%{public}s", child->GetAbilityName().c_str()); + HILOG_INFO("---------data--------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); + HILOG_INFO("---------data--------operatorName:%{public}s", child->GetOperatorName().c_str()); + HILOG_INFO("---------data--------childOperatorNum:%{public}zu", child->GetChildOperator().size()); } std::shared_ptr helper = DataAbilityHelper::Creator(mainAbility_->GetContext()); for (auto child : allOperator.GetChildOperator()) { /// data ability if (child->GetAbilityType() == ABILITY_TYPE_DATA) { - APP_LOGI("---------------------targetAbility_--------------------"); + HILOG_INFO("---------------------targetAbility_--------------------"); Uri dataAbilityUri("dataability:///" + child->GetBundleName() + "." + child->GetAbilityName()); std::string result; if (helper != nullptr) { - APP_LOGI("---------------------helper--------------------"); + HILOG_INFO("---------------------helper--------------------"); GetResult(child, helper, dataAbilityUri, result); } mainAbility_->PublishEvent(abilityEventName, ABILITY_DATA_A_CODE, child->GetOperatorName() + " " + result); } else if (child->GetAbilityType() == ABILITY_TYPE_PAGE) { - APP_LOGI("---------------------StartPageAbility--------------------"); + HILOG_INFO("---------------------StartPageAbility--------------------"); std::vector vectoroperator; if (child->GetChildOperator().size() != 0) { vectoroperator = STtools::SerializationStOperatorToVector(*child); diff --git a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestA/src/ams_st_data_ability_page_a.cpp b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestA/src/ams_st_data_ability_page_a.cpp index 45b30019c3..f6e5c56b44 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestA/src/ams_st_data_ability_page_a.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestA/src/ams_st_data_ability_page_a.cpp @@ -18,7 +18,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "data_ability_helper.h" #include "abs_shared_result_set.h" #include "data_ability_predicates.h" @@ -50,9 +50,9 @@ bool AmsStDataAbilityPageA::PublishEvent(const std::string &eventName, const int void DataTestPageAEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("DataTestPageAEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("DataTestPageAEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("DataTestPageAEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("DataTestPageAEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("DataTestPageAEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("DataTestPageAEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (eventName.compare("event_data_test_action") == 0 && ABILITY_PAGE_A_CODE == data.GetCode()) { auto target = data.GetData(); @@ -60,7 +60,7 @@ void DataTestPageAEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (func != mapTestFunc_.end()) { func->second(); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } @@ -90,7 +90,7 @@ void AmsStDataAbilityPageA::SubscribeEvent(const Want &want) void AmsStDataAbilityPageA::OnStart(const Want &want) { - APP_LOGI("AmsStDataAbilityPageA::onStart"); + HILOG_INFO("AmsStDataAbilityPageA::onStart"); originWant_ = want; SubscribeEvent(want); Ability::OnStart(want); @@ -99,35 +99,35 @@ void AmsStDataAbilityPageA::OnStart(const Want &want) void AmsStDataAbilityPageA::OnNewWant(const Want &want) { - APP_LOGI("AmsStDataAbilityPageA::OnNewWant"); + HILOG_INFO("AmsStDataAbilityPageA::OnNewWant"); originWant_ = want; Ability::OnNewWant(want); } void AmsStDataAbilityPageA::OnStop() { - APP_LOGI("AmsStDataAbilityPageA::onStop"); + HILOG_INFO("AmsStDataAbilityPageA::onStop"); Ability::OnStop(); PublishEvent(abilityEventName, ABILITY_PAGE_A_CODE, "OnStop"); } void AmsStDataAbilityPageA::OnActive() { - APP_LOGI("AmsStDataAbilityPageA::OnActive"); + HILOG_INFO("AmsStDataAbilityPageA::OnActive"); Ability::OnActive(); PublishEvent(abilityEventName, ABILITY_PAGE_A_CODE, "OnActive"); } void AmsStDataAbilityPageA::OnInactive() { - APP_LOGI("AmsStDataAbilityPageA::OnInactive"); + HILOG_INFO("AmsStDataAbilityPageA::OnInactive"); Ability::OnInactive(); PublishEvent(abilityEventName, ABILITY_PAGE_A_CODE, "OnInactive"); } void AmsStDataAbilityPageA::OnBackground() { - APP_LOGI("AmsStDataAbilityPageA::OnBackground"); + HILOG_INFO("AmsStDataAbilityPageA::OnBackground"); Ability::OnBackground(); PublishEvent(abilityEventName, ABILITY_PAGE_A_CODE, "OnBackground"); } @@ -140,11 +140,11 @@ void AmsStDataAbilityPageA::GetWantInfo(const Want &want) STtools::DeserializationStOperatorFromVector(allOperator, vectorOperator); for (auto child : allOperator.GetChildOperator()) { - APP_LOGI("-----------------targetBundle:%{public}s", child->GetBundleName().c_str()); - APP_LOGI("-----------------targetAbility:%{public}s", child->GetAbilityName().c_str()); - APP_LOGI("-----------------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); - APP_LOGI("-----------------operatorName:%{public}s", child->GetOperatorName().c_str()); - APP_LOGI("-----------------childOperatorNum:%{public}zu", child->GetChildOperator().size()); + HILOG_INFO("-----------------targetBundle:%{public}s", child->GetBundleName().c_str()); + HILOG_INFO("-----------------targetAbility:%{public}s", child->GetAbilityName().c_str()); + HILOG_INFO("-----------------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); + HILOG_INFO("-----------------operatorName:%{public}s", child->GetOperatorName().c_str()); + HILOG_INFO("-----------------childOperatorNum:%{public}zu", child->GetChildOperator().size()); } } @@ -174,12 +174,12 @@ static void GetResult(std::shared_ptr child, std::shared_pt } else if (child->GetOperatorName() == OPERATOR_OPENFILE) { int fd = helper->OpenFile(dataAbilityUri, child->GetMessage()); if (fd < 0) { - APP_LOGI("---------------------------DataTestPageAEventSubscriber::fd < 0"); + HILOG_INFO("---------------------------DataTestPageAEventSubscriber::fd < 0"); return; } FILE *file = fdopen(fd, "r"); if (file == nullptr) { - APP_LOGI("---------------------------DataTestPageAEventSubscriber::file == nullptr"); + HILOG_INFO("---------------------------DataTestPageAEventSubscriber::file == nullptr"); return; } result = std::to_string(fd); @@ -194,33 +194,33 @@ static void GetResult(std::shared_ptr child, std::shared_pt void DataTestPageAEventSubscriber::TestPost(const std::string funName) { - APP_LOGI("DataTestPageAEventSubscriber::TestPost %{public}s", funName.c_str()); + HILOG_INFO("DataTestPageAEventSubscriber::TestPost %{public}s", funName.c_str()); STtools::StOperator allOperator {}; STtools::DeserializationStOperatorFromVector(allOperator, vectorOperator_); for (auto child : allOperator.GetChildOperator()) { - APP_LOGI("-----------------targetBundle:%{public}s", child->GetBundleName().c_str()); - APP_LOGI("-----------------targetAbility:%{public}s", child->GetAbilityName().c_str()); - APP_LOGI("-----------------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); - APP_LOGI("-----------------operatorName:%{public}s", child->GetOperatorName().c_str()); - APP_LOGI("-----------------childOperatorNum:%{public}zu", child->GetChildOperator().size()); + HILOG_INFO("-----------------targetBundle:%{public}s", child->GetBundleName().c_str()); + HILOG_INFO("-----------------targetAbility:%{public}s", child->GetAbilityName().c_str()); + HILOG_INFO("-----------------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); + HILOG_INFO("-----------------operatorName:%{public}s", child->GetOperatorName().c_str()); + HILOG_INFO("-----------------childOperatorNum:%{public}zu", child->GetChildOperator().size()); } std::shared_ptr helper = DataAbilityHelper::Creator(mainAbility_->GetContext()); for (auto child : allOperator.GetChildOperator()) { /// data ability if (child->GetAbilityType() == "2") { - APP_LOGI("---------------------targetAbility_--------------targetAbility:%{public}s", + HILOG_INFO("---------------------targetAbility_--------------targetAbility:%{public}s", child->GetAbilityName().c_str()); Uri dataAbilityUri("dataability:///" + child->GetBundleName() + "." + child->GetAbilityName()); std::string result; - APP_LOGI("---------------------targetAbility_--------------operatorName:%{public}s", + HILOG_INFO("---------------------targetAbility_--------------operatorName:%{public}s", child->GetOperatorName().c_str()); if (helper != nullptr) { - APP_LOGI("---------------------helper--------------------"); + HILOG_INFO("---------------------helper--------------------"); GetResult(child, helper, dataAbilityUri, result); } mainAbility_->PublishEvent(abilityEventName, ABILITY_PAGE_A_CODE, child->GetOperatorName() + " " + result); } else if (child->GetAbilityType() == "0") { - APP_LOGI("---------------------StartPageAbility--------------------"); + HILOG_INFO("---------------------StartPageAbility--------------------"); std::vector vectoroperator; if (child->GetChildOperator().size() != 0) { vectoroperator = STtools::SerializationStOperatorToVector(*child); diff --git a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestB/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestB/BUILD.gn index 094a72f179..d1b9d258a8 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestB/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestB/BUILD.gn @@ -26,13 +26,14 @@ config("amsDataSystemTestBConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsDataSystemTestB\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsDataSystemTestB\"", + "AMS_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestB/src/ams_st_data_ability_data_b.cpp b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestB/src/ams_st_data_ability_data_b.cpp index c99e80d262..5a2f3d0519 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestB/src/ams_st_data_ability_data_b.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestB/src/ams_st_data_ability_data_b.cpp @@ -18,7 +18,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "data_ability_helper.h" namespace OHOS { @@ -53,9 +53,9 @@ bool AmsStDataAbilityDataB::PublishEvent(const std::string &eventName, const int void DataTestDataBEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("DataTestDataBEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("DataTestDataBEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("DataTestDataBEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("DataTestDataBEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("DataTestDataBEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("DataTestDataBEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (eventName.compare(testEventName) == 0 && ABILITY_DATA_B_CODE == data.GetCode()) { std::string target = data.GetData(); @@ -86,7 +86,7 @@ void AmsStDataAbilityDataB::SubscribeEvent(const Want &want) void AmsStDataAbilityDataB::OnStart(const Want &want) { - APP_LOGI("AmsStDataAbilityDataB OnStart"); + HILOG_INFO("AmsStDataAbilityDataB OnStart"); SubscribeEvent(want); originWant_ = want; Ability::OnStart(want); @@ -95,21 +95,21 @@ void AmsStDataAbilityDataB::OnStart(const Want &want) int AmsStDataAbilityDataB::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) { - APP_LOGI("AmsStDataAbilityDataB <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataB <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_B_CODE, "Insert"); return DEFAULT_INSERT_RESULT; } int AmsStDataAbilityDataB::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsStDataAbilityDataB <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataB <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_B_CODE, "Delete"); return DEFAULT_DELETE_RESULT; } int AmsStDataAbilityDataB::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsStDataAbilityDataB <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataB <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_B_CODE, "Update"); return DEFAULT_UPDATE_RESULT; } @@ -118,7 +118,7 @@ std::shared_ptr AmsStDataAbilityDataB::Query( const Uri &uri, const std::vector &columns, const NativeRdb::DataAbilityPredicates &predicates) { subscriber_->vectorOperator_ = columns; - APP_LOGI("AmsStDataAbilityDataB <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataB <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_B_CODE, OPERATOR_QUERY); STtools::WaitCompleted(event, OPERATOR_QUERY, ABILITY_DATA_B_CODE); @@ -134,7 +134,7 @@ std::shared_ptr AmsStDataAbilityDataB::Query( std::vector AmsStDataAbilityDataB::GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) { - APP_LOGI("AmsStDataAbilityDataB <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataB <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_B_CODE, "GetFileTypes"); std::vector fileType {"filetypes"}; return fileType; @@ -142,12 +142,12 @@ std::vector AmsStDataAbilityDataB::GetFileTypes(const Uri &uri, con int AmsStDataAbilityDataB::OpenFile(const Uri &uri, const std::string &mode) { - APP_LOGI("AmsStDataAbilityDataB <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataB <<<>>>"); FILE *fd1 = fopen("/system/app/test.txt", "r"); if (fd1 == nullptr) return -1; int fd = fileno(fd1); - APP_LOGI("AmsStDataAbilityDataB fd: %{public}d", fd); + HILOG_INFO("AmsStDataAbilityDataB fd: %{public}d", fd); PublishEvent(abilityEventName, ABILITY_DATA_B_CODE, "OpenFile"); fclose(fd1); return fd; @@ -197,23 +197,23 @@ static void GetResult(std::shared_ptr child, std::shared_pt void DataTestDataBEventSubscriber::TestPost(const std::string funName) { - APP_LOGI("DataTestDataBEventSubscriber::TestPost %{public}s", funName.c_str()); + HILOG_INFO("DataTestDataBEventSubscriber::TestPost %{public}s", funName.c_str()); STtools::StOperator allOperator {}; STtools::DeserializationStOperatorFromVector(allOperator, vectorOperator_); std::shared_ptr helper = DataAbilityHelper::Creator(mainAbility_->GetContext()); for (auto child : allOperator.GetChildOperator()) { /// data ability if (child->GetAbilityType() == ABILITY_TYPE_DATA) { - APP_LOGI("---------------------targetAbility_--------------------"); + HILOG_INFO("---------------------targetAbility_--------------------"); Uri dataAbilityUri("dataability:///" + child->GetBundleName() + "." + child->GetAbilityName()); std::string result; if (helper != nullptr) { - APP_LOGI("---------------------helper--------------------"); + HILOG_INFO("---------------------helper--------------------"); GetResult(child, helper, dataAbilityUri, result); } mainAbility_->PublishEvent(abilityEventName, ABILITY_DATA_B_CODE, child->GetOperatorName() + " " + result); } else if (child->GetAbilityType() == ABILITY_TYPE_PAGE) { - APP_LOGI("---------------------StartPageAbility--------------------"); + HILOG_INFO("---------------------StartPageAbility--------------------"); std::vector vectoroperator; if (child->GetChildOperator().size() != 0) { vectoroperator = STtools::SerializationStOperatorToVector(*child); diff --git a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestB/src/ams_st_data_ability_page_b.cpp b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestB/src/ams_st_data_ability_page_b.cpp index dd43df46c6..2355c2e996 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestB/src/ams_st_data_ability_page_b.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestB/src/ams_st_data_ability_page_b.cpp @@ -18,7 +18,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "data_ability_helper.h" #include "abs_shared_result_set.h" #include "data_ability_predicates.h" @@ -51,9 +51,9 @@ bool AmsStDataAbilityPageB::PublishEvent(const std::string &eventName, const int void DataTestPageBEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("DataTestPageBEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("DataTestPageBEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("DataTestPageBEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("DataTestPageBEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("DataTestPageBEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("DataTestPageBEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (eventName.compare("event_data_test_action") == 0 && ABILITY_PAGE_B_CODE == data.GetCode()) { auto target = data.GetData(); @@ -61,7 +61,7 @@ void DataTestPageBEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (func != mapTestFunc_.end()) { func->second(); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } @@ -91,7 +91,7 @@ void AmsStDataAbilityPageB::SubscribeEvent(const Want &want) void AmsStDataAbilityPageB::OnStart(const Want &want) { - APP_LOGI("AmsStDataAbilityPageB::onStart"); + HILOG_INFO("AmsStDataAbilityPageB::onStart"); originWant_ = want; SubscribeEvent(want); Ability::OnStart(want); @@ -100,21 +100,21 @@ void AmsStDataAbilityPageB::OnStart(const Want &want) void AmsStDataAbilityPageB::OnNewWant(const Want &want) { - APP_LOGI("AmsStDataAbilityPageB::OnNewWant"); + HILOG_INFO("AmsStDataAbilityPageB::OnNewWant"); originWant_ = want; Ability::OnNewWant(want); } void AmsStDataAbilityPageB::OnStop() { - APP_LOGI("AmsStDataAbilityPageB::onStop"); + HILOG_INFO("AmsStDataAbilityPageB::onStop"); Ability::OnStop(); PublishEvent(abilityEventName, ABILITY_PAGE_B_CODE, "OnStop"); } void AmsStDataAbilityPageB::OnActive() { - APP_LOGI("AmsStDataAbilityPageB::OnActive"); + HILOG_INFO("AmsStDataAbilityPageB::OnActive"); Ability::OnActive(); PublishEvent(abilityEventName, ABILITY_PAGE_B_CODE, "OnActive"); GetWantInfo(originWant_); @@ -123,14 +123,14 @@ void AmsStDataAbilityPageB::OnActive() void AmsStDataAbilityPageB::OnInactive() { - APP_LOGI("AmsStDataAbilityPageB::OnInactive"); + HILOG_INFO("AmsStDataAbilityPageB::OnInactive"); Ability::OnInactive(); PublishEvent(abilityEventName, ABILITY_PAGE_B_CODE, "OnInactive"); } void AmsStDataAbilityPageB::OnBackground() { - APP_LOGI("AmsStDataAbilityPageB::OnBackground"); + HILOG_INFO("AmsStDataAbilityPageB::OnBackground"); Ability::OnBackground(); PublishEvent(abilityEventName, ABILITY_PAGE_B_CODE, "OnBackground"); } @@ -143,11 +143,11 @@ void AmsStDataAbilityPageB::GetWantInfo(const Want &want) STtools::DeserializationStOperatorFromVector(allOperator, vectorOperator); for (auto child : allOperator.GetChildOperator()) { - APP_LOGI("-----------------targetBundle:%{public}s", child->GetBundleName().c_str()); - APP_LOGI("-----------------targetAbility:%{public}s", child->GetAbilityName().c_str()); - APP_LOGI("-----------------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); - APP_LOGI("-----------------operatorName:%{public}s", child->GetOperatorName().c_str()); - APP_LOGI("-----------------childOperatorNum:%{public}zu", child->GetChildOperator().size()); + HILOG_INFO("-----------------targetBundle:%{public}s", child->GetBundleName().c_str()); + HILOG_INFO("-----------------targetAbility:%{public}s", child->GetAbilityName().c_str()); + HILOG_INFO("-----------------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); + HILOG_INFO("-----------------operatorName:%{public}s", child->GetOperatorName().c_str()); + HILOG_INFO("-----------------childOperatorNum:%{public}zu", child->GetChildOperator().size()); } } @@ -195,23 +195,23 @@ static void GetResult(std::shared_ptr child, std::shared_pt void DataTestPageBEventSubscriber::TestPost(const std::string funName) { - APP_LOGI("DataTestPageBEventSubscriber::TestPost %{public}s", funName.c_str()); + HILOG_INFO("DataTestPageBEventSubscriber::TestPost %{public}s", funName.c_str()); STtools::StOperator allOperator {}; STtools::DeserializationStOperatorFromVector(allOperator, vectorOperator_); std::shared_ptr helper = DataAbilityHelper::Creator(mainAbility_->GetContext()); for (auto child : allOperator.GetChildOperator()) { /// data ability if (child->GetAbilityType() == "2") { - APP_LOGI("---------------------targetAbility_--------------------"); + HILOG_INFO("---------------------targetAbility_--------------------"); Uri dataAbilityUri("dataability:///" + child->GetBundleName() + "." + child->GetAbilityName()); std::string result; if (helper != nullptr) { - APP_LOGI("---------------------helper--------------------"); + HILOG_INFO("---------------------helper--------------------"); GetResult(child, helper, dataAbilityUri, result); } mainAbility_->PublishEvent(abilityEventName, ABILITY_PAGE_B_CODE, child->GetOperatorName() + " " + result); } else if (child->GetAbilityType() == "0") { - APP_LOGI("---------------------StartPageAbility--------------------"); + HILOG_INFO("---------------------StartPageAbility--------------------"); std::vector vectoroperator; if (child->GetChildOperator().size() != 0) { vectoroperator = STtools::SerializationStOperatorToVector(*child); diff --git a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestC/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestC/BUILD.gn index 785b09c7a5..d2ba20d04d 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestC/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestC/BUILD.gn @@ -26,13 +26,14 @@ config("amsDataSystemTestCConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsDataSystemTestC\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsDataSystemTestC\"", + "AMS_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestC/src/ams_st_data_ability_data_c1.cpp b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestC/src/ams_st_data_ability_data_c1.cpp index 5f57ea3870..a374514b9e 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestC/src/ams_st_data_ability_data_c1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestC/src/ams_st_data_ability_data_c1.cpp @@ -18,7 +18,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "data_ability_helper.h" namespace OHOS { @@ -53,9 +53,9 @@ bool AmsStDataAbilityDataC1::PublishEvent(const std::string &eventName, const in void DataTestDataC1EventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("DataTestDataC1EventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("DataTestDataC1EventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("DataTestDataC1EventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("DataTestDataC1EventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("DataTestDataC1EventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("DataTestDataC1EventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (eventName.compare(testEventName) == 0 && ABILITY_DATA_C1_CODE == data.GetCode()) { std::string target = data.GetData(); @@ -86,7 +86,7 @@ void AmsStDataAbilityDataC1::SubscribeEvent(const Want &want) void AmsStDataAbilityDataC1::OnStart(const Want &want) { - APP_LOGI("AmsStDataAbilityDataC1 OnStart"); + HILOG_INFO("AmsStDataAbilityDataC1 OnStart"); SubscribeEvent(want); originWant_ = want; Ability::OnStart(want); @@ -95,18 +95,18 @@ void AmsStDataAbilityDataC1::OnStart(const Want &want) int AmsStDataAbilityDataC1::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) { - APP_LOGI("AmsStDataAbilityDataC1 <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataC1 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_C1_CODE, "Insert"); if (fd <= 0) { - APP_LOGI("AmsStDataAbilityDataC1 <<<>>> file fd <= 0"); + HILOG_INFO("AmsStDataAbilityDataC1 <<<>>> file fd <= 0"); return DEFAULT_INSERT_RESULT; } int dupFd = dup(fd); FILE *file = fdopen(dupFd, "r"); if (file == nullptr) { - APP_LOGI("AmsStDataAbilityDataC1 <<<>>> file == nullptr"); + HILOG_INFO("AmsStDataAbilityDataC1 <<<>>> file == nullptr"); } else { - APP_LOGI("AmsStDataAbilityDataC1 <<<>>> file != nullptr"); + HILOG_INFO("AmsStDataAbilityDataC1 <<<>>> file != nullptr"); fclose(file); file = nullptr; } @@ -115,14 +115,14 @@ int AmsStDataAbilityDataC1::Insert(const Uri &uri, const NativeRdb::ValuesBucket int AmsStDataAbilityDataC1::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsStDataAbilityDataC1 <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataC1 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_C1_CODE, "Delete"); return DEFAULT_DELETE_RESULT; } int AmsStDataAbilityDataC1::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsStDataAbilityDataC1 <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataC1 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_C1_CODE, "Update"); return DEFAULT_UPDATE_RESULT; } @@ -131,7 +131,7 @@ std::shared_ptr AmsStDataAbilityDataC1::Query( const Uri &uri, const std::vector &columns, const NativeRdb::DataAbilityPredicates &predicates) { subscriber_->vectorOperator_ = columns; - APP_LOGI("AmsStDataAbilityDataC1 <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataC1 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_C1_CODE, OPERATOR_QUERY); STtools::WaitCompleted(event, OPERATOR_QUERY, ABILITY_DATA_C1_CODE); @@ -147,7 +147,7 @@ std::shared_ptr AmsStDataAbilityDataC1::Query( std::vector AmsStDataAbilityDataC1::GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) { - APP_LOGI("AmsStDataAbilityDataC1 <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataC1 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_C1_CODE, "GetFileTypes"); std::vector fileType {"filetypes"}; return fileType; @@ -155,15 +155,15 @@ std::vector AmsStDataAbilityDataC1::GetFileTypes(const Uri &uri, co int AmsStDataAbilityDataC1::OpenFile(const Uri &uri, const std::string &mode) { - APP_LOGI("AmsStDataAbilityDataC1 <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataC1 <<<>>>"); FILE *fd1 = fopen("/system/vendor/test.txt", "r"); if (fd1 == nullptr) { - APP_LOGI("AmsStDataAbilityDataC1 <<<>>> fdr == nullptr"); + HILOG_INFO("AmsStDataAbilityDataC1 <<<>>> fdr == nullptr"); return -1; } fd = fileno(fd1); - APP_LOGI("AmsStDataAbilityDataC1 fd: %{public}d", fd); + HILOG_INFO("AmsStDataAbilityDataC1 fd: %{public}d", fd); PublishEvent(abilityEventName, ABILITY_DATA_C1_CODE, "OpenFile"); return fd; } @@ -213,20 +213,20 @@ void DataTestDataC1EventSubscriber::GetResultBySelf( std::shared_ptr child, AmsStDataAbilityDataC1 *mainAbility, Uri dataAbilityUri, string &result) { if (child->GetOperatorName() == OPERATOR_INSERT) { - APP_LOGI("---------------------Insert--------------------"); + HILOG_INFO("---------------------Insert--------------------"); NativeRdb::ValuesBucket bucket; result = std::to_string(mainAbility->Insert(dataAbilityUri, bucket)); } else if (child->GetOperatorName() == OPERATOR_DELETE) { - APP_LOGI("---------------------Delete--------------------"); + HILOG_INFO("---------------------Delete--------------------"); NativeRdb::DataAbilityPredicates predicates; result = std::to_string(mainAbility->Delete(dataAbilityUri, predicates)); } else if (child->GetOperatorName() == OPERATOR_UPDATE) { - APP_LOGI("---------------------Update--------------------"); + HILOG_INFO("---------------------Update--------------------"); NativeRdb::ValuesBucket bucket; NativeRdb::DataAbilityPredicates predicates; result = std::to_string(mainAbility->Update(dataAbilityUri, bucket, predicates)); } else if (child->GetOperatorName() == OPERATOR_QUERY) { - APP_LOGI("---------------------Query--------------------"); + HILOG_INFO("---------------------Query--------------------"); std::vector columns = STtools::SerializationStOperatorToVector(*child); NativeRdb::DataAbilityPredicates predicates; std::shared_ptr resultValue = mainAbility->Query(dataAbilityUri, columns, predicates); @@ -236,7 +236,7 @@ void DataTestDataC1EventSubscriber::GetResultBySelf( resultValue->GetString(0, result); } } else if (child->GetOperatorName() == OPERATOR_GETFILETYPES) { - APP_LOGI("---------------------GetFileTypes--------------------"); + HILOG_INFO("---------------------GetFileTypes--------------------"); std::vector types = mainAbility->GetFileTypes(dataAbilityUri, child->GetMessage()); if (types.size() > 0) { result = types[0]; @@ -244,7 +244,7 @@ void DataTestDataC1EventSubscriber::GetResultBySelf( result = "failed"; } } else if (child->GetOperatorName() == OPERATOR_OPENFILE) { - APP_LOGI("---------------------OpenFile--------------------"); + HILOG_INFO("---------------------OpenFile--------------------"); FILE *file = fopen("/system/vendor/test.txt", "r"); if (file == nullptr) { return; @@ -262,7 +262,7 @@ void DataTestDataC1EventSubscriber::GetResultBySelf( void DataTestDataC1EventSubscriber::TestPost(const std::string funName) { - APP_LOGI("DataTestDataC1EventSubscriber::TestPost %{public}s", funName.c_str()); + HILOG_INFO("DataTestDataC1EventSubscriber::TestPost %{public}s", funName.c_str()); STtools::StOperator allOperator {}; STtools::DeserializationStOperatorFromVector(allOperator, vectorOperator_); std::shared_ptr helper = DataAbilityHelper::Creator(mainAbility_->GetContext()); @@ -275,15 +275,15 @@ void DataTestDataC1EventSubscriber::TestPost(const std::string funName) GetResultBySelf(child, mainAbility_, dataAbilityUri, result); mainAbility_->PublishEvent(abilityEventName, ABILITY_DATA_C1_CODE, child->GetOperatorName() + " " + result); } else if (child->GetAbilityType() == ABILITY_TYPE_DATA) { - APP_LOGI("---------------------targetAbility_--------------------"); + HILOG_INFO("---------------------targetAbility_--------------------"); Uri dataAbilityUri("dataability:///" + child->GetBundleName() + "." + child->GetAbilityName()); if (helper != nullptr) { - APP_LOGI("---------------------helper--------------------"); + HILOG_INFO("---------------------helper--------------------"); GetResult(child, helper, dataAbilityUri, result); } mainAbility_->PublishEvent(abilityEventName, ABILITY_DATA_C1_CODE, child->GetOperatorName() + " " + result); } else if (child->GetAbilityType() == ABILITY_TYPE_PAGE) { - APP_LOGI("---------------------StartPageAbility--------------------"); + HILOG_INFO("---------------------StartPageAbility--------------------"); std::vector vectoroperator; if (child->GetChildOperator().size() != 0) { vectoroperator = STtools::SerializationStOperatorToVector(*child); diff --git a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestC/src/ams_st_data_ability_data_c2.cpp b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestC/src/ams_st_data_ability_data_c2.cpp index 1eccfa2629..3764648d96 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestC/src/ams_st_data_ability_data_c2.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsDataSystemTestC/src/ams_st_data_ability_data_c2.cpp @@ -18,7 +18,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "data_ability_helper.h" namespace OHOS { @@ -53,9 +53,9 @@ bool AmsStDataAbilityDataC2::PublishEvent(const std::string &eventName, const in void DataTestDataC2EventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("DataTestDataC2EventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("DataTestDataC2EventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("DataTestDataC2EventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("DataTestDataC2EventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("DataTestDataC2EventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("DataTestDataC2EventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (eventName.compare(testEventName) == 0 && ABILITY_DATA_C2_CODE == data.GetCode()) { std::string target = data.GetData(); @@ -86,7 +86,7 @@ void AmsStDataAbilityDataC2::SubscribeEvent(const Want &want) void AmsStDataAbilityDataC2::OnStart(const Want &want) { - APP_LOGI("AmsStDataAbilityDataC2 OnStart"); + HILOG_INFO("AmsStDataAbilityDataC2 OnStart"); SubscribeEvent(want); originWant_ = want; Ability::OnStart(want); @@ -95,21 +95,21 @@ void AmsStDataAbilityDataC2::OnStart(const Want &want) int AmsStDataAbilityDataC2::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) { - APP_LOGI("AmsStDataAbilityDataC2 <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataC2 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_C2_CODE, "Insert"); return DEFAULT_INSERT_RESULT; } int AmsStDataAbilityDataC2::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsStDataAbilityDataC2 <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataC2 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_C2_CODE, "Delete"); return DEFAULT_DELETE_RESULT; } int AmsStDataAbilityDataC2::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsStDataAbilityDataC2 <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataC2 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_C2_CODE, "Update"); return DEFAULT_UPDATE_RESULT; } @@ -118,7 +118,7 @@ std::shared_ptr AmsStDataAbilityDataC2::Query( const Uri &uri, const std::vector &columns, const NativeRdb::DataAbilityPredicates &predicates) { subscriber_->vectorOperator_ = columns; - APP_LOGI("AmsStDataAbilityDataC2 <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataC2 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_C2_CODE, OPERATOR_QUERY); STtools::WaitCompleted(event, OPERATOR_QUERY, ABILITY_DATA_C2_CODE); @@ -134,7 +134,7 @@ std::shared_ptr AmsStDataAbilityDataC2::Query( std::vector AmsStDataAbilityDataC2::GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) { - APP_LOGI("AmsStDataAbilityDataC2 <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataC2 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_C2_CODE, "GetFileTypes"); std::vector fileType {"filetypes"}; return fileType; @@ -142,12 +142,12 @@ std::vector AmsStDataAbilityDataC2::GetFileTypes(const Uri &uri, co int AmsStDataAbilityDataC2::OpenFile(const Uri &uri, const std::string &mode) { - APP_LOGI("AmsStDataAbilityDataC2 <<<>>>"); + HILOG_INFO("AmsStDataAbilityDataC2 <<<>>>"); FILE *fd1 = fopen("/system/app/test.txt", "r"); if (fd1 == nullptr) return -1; int fd = fileno(fd1); - APP_LOGI("AmsStDataAbilityDataC2 fd: %{public}d", fd); + HILOG_INFO("AmsStDataAbilityDataC2 fd: %{public}d", fd); PublishEvent(abilityEventName, ABILITY_DATA_C2_CODE, "OpenFile"); fclose(fd1); return fd; @@ -197,23 +197,23 @@ static void GetResult(std::shared_ptr child, std::shared_pt void DataTestDataC2EventSubscriber::TestPost(const std::string funName) { - APP_LOGI("DataTestDataC2EventSubscriber::TestPost %{public}s", funName.c_str()); + HILOG_INFO("DataTestDataC2EventSubscriber::TestPost %{public}s", funName.c_str()); STtools::StOperator allOperator {}; STtools::DeserializationStOperatorFromVector(allOperator, vectorOperator_); std::shared_ptr helper = DataAbilityHelper::Creator(mainAbility_->GetContext()); for (auto child : allOperator.GetChildOperator()) { /// data ability if (child->GetAbilityType() == ABILITY_TYPE_DATA) { - APP_LOGI("---------------------targetAbility_--------------------"); + HILOG_INFO("---------------------targetAbility_--------------------"); Uri dataAbilityUri("dataability:///" + child->GetBundleName() + "." + child->GetAbilityName()); std::string result; if (helper != nullptr) { - APP_LOGI("---------------------helper--------------------"); + HILOG_INFO("---------------------helper--------------------"); GetResult(child, helper, dataAbilityUri, result); } mainAbility_->PublishEvent(abilityEventName, ABILITY_DATA_C2_CODE, child->GetOperatorName() + " " + result); } else if (child->GetAbilityType() == ABILITY_TYPE_PAGE) { - APP_LOGI("---------------------StartPageAbility--------------------"); + HILOG_INFO("---------------------StartPageAbility--------------------"); std::vector vectoroperator; if (child->GetChildOperator().size() != 0) { vectoroperator = STtools::SerializationStOperatorToVector(*child); diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSTAbilityManager/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsKitSTAbilityManager/BUILD.gn index 0c48988bb4..2be820825b 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSTAbilityManager/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSTAbilityManager/BUILD.gn @@ -20,6 +20,7 @@ config("amsKitSTAbilityManagerConfig") { "${aafwk_path}/interfaces/innerkits/ability_manager/include", "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${aafwk_path}/frameworks/kits/appkit/native/app", @@ -30,8 +31,8 @@ config("amsKitSTAbilityManagerConfig") { "//foundation/aafwk/standard/interfaces/innerkits/uri/include", ] defines = [ - "APP_LOG_TAG = \"amsKitSTAbilityManager\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsKitSTAbilityManager\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsKitSTAbilityManager") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSTAbilityManager/src/kit_test_ability_manager_second.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSTAbilityManager/src/kit_test_ability_manager_second.cpp index 901cc5f8f0..1584090ef1 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSTAbilityManager/src/kit_test_ability_manager_second.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSTAbilityManager/src/kit_test_ability_manager_second.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -65,12 +65,12 @@ void KitTestAbilityManagerSecond::SubscribeEvent(const vector_conststr &eventLis void KitTestAbilityManagerSecond::AbilityManagerStByCode(int apiIndex, int caseIndex, int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerStByCode"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerStByCode"); if (mapStKitFunc_.find(apiIndex) != mapStKitFunc_.end() && static_cast(mapStKitFunc_[apiIndex].size()) > caseIndex) { mapStKitFunc_[apiIndex][caseIndex](code); } else { - APP_LOGI("AbilityManagerStByCode error"); + HILOG_INFO("AbilityManagerStByCode error"); } } @@ -124,42 +124,42 @@ void KitTestAbilityManagerSecond::GetAllStackInfo(MissionStackInfo &missionStack // GetAllRunningProcesses ST kit case void KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase1(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase1"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase1"); std::vector info = AbilityManager::GetInstance().GetAllRunningProcesses(); CompareProcessName(info, currentProcessInfo, code); } void KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase2(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase2"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase2"); std::vector info = AbilityManager::GetInstance().GetAllRunningProcesses(); CompareProcessName(info, topProcessInfo, code); } void KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase3(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase3"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase3"); std::vector info = AbilityManager::GetInstance().GetAllRunningProcesses(); CompareProcessName(info, launchProcessInfo, code); } void KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase4(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase4"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase4"); std::vector info = AbilityManager::GetInstance().GetAllRunningProcesses(); CompareProcessState(info, launchProcessInfo, AppProcessState::APP_STATE_BACKGROUND, code); } void KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase5(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase5"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase5"); std::vector info = AbilityManager::GetInstance().GetAllRunningProcesses(); CompareProcessState(info, currentProcessInfo, AppProcessState::APP_STATE_FOREGROUND, code); } void KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase6(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase6"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase6"); std::vector info = AbilityManager::GetInstance().GetAllRunningProcesses(); std::shared_ptr processInfo = AbilityContext::GetProcessInfo(); bool result = false; @@ -174,7 +174,7 @@ void KitTestAbilityManagerSecond::AbilityManagerGetAllRunningProcessesCase6(int // GetAllStackInfo ST kit case void KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase1(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase1"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase1"); MissionStackInfo missionStackInfo; GetAllStackInfo(missionStackInfo, 0); bool result = (missionStackInfo.missionRecords.size() == 1); @@ -183,7 +183,7 @@ void KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase1(int code) void KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase2(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase2"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase2"); MissionStackInfo missionStackInfo; GetAllStackInfo(missionStackInfo, 0); auto abilityInfos = missionStackInfo.missionRecords[0].abilityRecordInfos; @@ -193,7 +193,7 @@ void KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase2(int code) void KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase3(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase3"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase3"); MissionStackInfo missionStackInfo; GetAllStackInfo(missionStackInfo, 1); bool result = (missionStackInfo.missionRecords.size() == 1); @@ -202,7 +202,7 @@ void KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase3(int code) void KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase4(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase4"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase4"); MissionStackInfo missionStackInfo; GetAllStackInfo(missionStackInfo, 1); bool result = false; @@ -214,7 +214,7 @@ void KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase4(int code) void KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase5(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase5"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase5"); MissionStackInfo missionStackInfo; GetAllStackInfo(missionStackInfo, 1); auto abilityInfos = missionStackInfo.missionRecords[0].abilityRecordInfos; @@ -227,7 +227,7 @@ void KitTestAbilityManagerSecond::AbilityManagerGetAllStackInfoCase5(int code) // QueryRecentAbilityMissionInfo ST kit case void KitTestAbilityManagerSecond::AbilityManagerQueryRecentAbilityMissionInfoCase1(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerQueryRecentAbilityMissionInfoCase1"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerQueryRecentAbilityMissionInfoCase1"); std::vector info; info = AbilityManager::GetInstance().QueryRecentAbilityMissionInfo(numThree, RECENT_WITH_EXCLUDED); bool result = false; @@ -241,7 +241,7 @@ void KitTestAbilityManagerSecond::AbilityManagerQueryRecentAbilityMissionInfoCas void KitTestAbilityManagerSecond::AbilityManagerQueryRecentAbilityMissionInfoCase2(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerQueryRecentAbilityMissionInfoCase2"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerQueryRecentAbilityMissionInfoCase2"); std::vector info; info = AbilityManager::GetInstance().QueryRecentAbilityMissionInfo(numThree, RECENT_WITH_EXCLUDED); bool result = false; @@ -253,7 +253,7 @@ void KitTestAbilityManagerSecond::AbilityManagerQueryRecentAbilityMissionInfoCas void KitTestAbilityManagerSecond::AbilityManagerQueryRecentAbilityMissionInfoCase3(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerQueryRecentAbilityMissionInfoCase3"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerQueryRecentAbilityMissionInfoCase3"); std::vector info; info = AbilityManager::GetInstance().QueryRecentAbilityMissionInfo(numThree, RECENT_WITH_EXCLUDED); bool result = false; @@ -269,7 +269,7 @@ void KitTestAbilityManagerSecond::AbilityManagerQueryRecentAbilityMissionInfoCas // QueryRunningAbilityMissionInfo ST kit case void KitTestAbilityManagerSecond::AbilityManagerQueryRunningAbilityMissionInfoCase1(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerQueryRunningAbilityMissionInfoCase1"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerQueryRunningAbilityMissionInfoCase1"); std::vector info; info = AbilityManager::GetInstance().QueryRunningAbilityMissionInfo(numThree); bool result = false; @@ -283,7 +283,7 @@ void KitTestAbilityManagerSecond::AbilityManagerQueryRunningAbilityMissionInfoCa void KitTestAbilityManagerSecond::AbilityManagerQueryRunningAbilityMissionInfoCase2(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerQueryRunningAbilityMissionInfoCase2"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerQueryRunningAbilityMissionInfoCase2"); std::vector info; info = AbilityManager::GetInstance().QueryRunningAbilityMissionInfo(numThree); bool result = false; @@ -295,7 +295,7 @@ void KitTestAbilityManagerSecond::AbilityManagerQueryRunningAbilityMissionInfoCa void KitTestAbilityManagerSecond::AbilityManagerQueryRunningAbilityMissionInfoCase3(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerQueryRunningAbilityMissionInfoCase3"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerQueryRunningAbilityMissionInfoCase3"); std::vector info; info = AbilityManager::GetInstance().QueryRunningAbilityMissionInfo(numThree); bool result = false; @@ -310,7 +310,7 @@ void KitTestAbilityManagerSecond::AbilityManagerQueryRunningAbilityMissionInfoCa void KitTestAbilityManagerSecond::AbilityManagerMoveMissionToTopCase1(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerMoveMissionToTopCase1"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerMoveMissionToTopCase1"); moveMissionToTopCode = code; isMoveMissionToTop = true; Want wantEntity; @@ -320,14 +320,14 @@ void KitTestAbilityManagerSecond::AbilityManagerMoveMissionToTopCase1(int code) void KitTestAbilityManagerSecond::AbilityManagerClearUpApplicationDataCase1(int code) { - APP_LOGI("KitTestAbilityManagerSecond::AbilityManagerClearUpApplicationDataCase1"); + HILOG_INFO("KitTestAbilityManagerSecond::AbilityManagerClearUpApplicationDataCase1"); isClearUpApplicationData = true; clearUpApplicationDataCode = code; } void KitTestAbilityManagerSecond::OnStart(const Want &want) { - APP_LOGI("KitTestAbilityManagerSecond::onStart"); + HILOG_INFO("KitTestAbilityManagerSecond::onStart"); Ability::OnStart(want); SubscribeEvent(g_requPageManagerSecondAbilitySTVector); GetWantInfo(want); @@ -337,7 +337,7 @@ void KitTestAbilityManagerSecond::OnStart(const Want &want) void KitTestAbilityManagerSecond::OnStop() { - APP_LOGI("KitTestAbilityManagerSecond::onStop"); + HILOG_INFO("KitTestAbilityManagerSecond::onStop"); Ability::OnStop(); if (isClearUpApplicationData != false) { PublishEvent(g_respPageManagerAbilityST, clearUpApplicationDataCode, "1"); @@ -351,7 +351,7 @@ void KitTestAbilityManagerSecond::OnStop() void KitTestAbilityManagerSecond::OnActive() { - APP_LOGI("KitTestAbilityManagerSecond::OnActive"); + HILOG_INFO("KitTestAbilityManagerSecond::OnActive"); Ability::OnActive(); if (isMoveMissionToTop == true) { PublishEvent(g_respPageManagerAbilityST, moveMissionToTopCode, "1"); @@ -369,7 +369,7 @@ void KitTestAbilityManagerSecond::OnActive() void KitTestAbilityManagerSecond::OnInactive() { - APP_LOGI("KitTestAbilityManagerSecond::OnInactive"); + HILOG_INFO("KitTestAbilityManagerSecond::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + g_abilityStateOnInactive; PublishEvent(g_respPageManagerSecondAbilityST, 0, eventData); @@ -377,14 +377,14 @@ void KitTestAbilityManagerSecond::OnInactive() void KitTestAbilityManagerSecond::OnBackground() { - APP_LOGI("KitTestAbilityManagerSecond::OnBackground"); + HILOG_INFO("KitTestAbilityManagerSecond::OnBackground"); Ability::OnBackground(); if (isMoveMissionToTop == true) { std::vector info; info = AbilityManager::GetInstance().QueryRecentAbilityMissionInfo(numThree, RECENT_WITH_EXCLUDED); if (info.size() == 1 && info[0].size == numTwo) { GetAbilityManager()->MoveMissionToTop(info[0].id); - APP_LOGI("GetAbilityManager()->MoveMissionToTop(info[0].id);%{public}d", static_cast(info[0].id)); + HILOG_INFO("GetAbilityManager()->MoveMissionToTop(info[0].id);%{public}d", static_cast(info[0].id)); } } std::string eventData = GetAbilityName() + g_abilityStateOnBackground; @@ -393,7 +393,7 @@ void KitTestAbilityManagerSecond::OnBackground() void KitTestAbilityManagerSecond::OnForeground(const Want &want) { - APP_LOGI("KitTestAbilityManagerSecond::OnForeground"); + HILOG_INFO("KitTestAbilityManagerSecond::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + g_abilityStateOnForeground; PublishEvent(g_respPageManagerSecondAbilityST, 0, eventData); @@ -401,7 +401,7 @@ void KitTestAbilityManagerSecond::OnForeground(const Want &want) void KitTestAbilityManagerSecond::OnNewWant(const Want &want) { - APP_LOGI("KitTestAbilityManagerSecond::OnNewWant"); + HILOG_INFO("KitTestAbilityManagerSecond::OnNewWant"); Ability::OnNewWant(want); GetWantInfo(want); std::string eventData = GetAbilityName() + g_abilityStateOnNewWant; @@ -426,16 +426,16 @@ void KitTestAbilityManagerSecond::GetWantInfo(const Want &want) // KitTestManagerSecondEventSubscriber Class void KitTestManagerSecondEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (g_requPageManagerSecondAbilityST == eventName) { auto target = data.GetData(); if (target == "TerminateAbility") { KitTerminateAbility(); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSTAbilityManagerFirst/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsKitSTAbilityManagerFirst/BUILD.gn index e78029703e..369ea707a9 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSTAbilityManagerFirst/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSTAbilityManagerFirst/BUILD.gn @@ -20,6 +20,7 @@ config("amsKitSTAbilityManagerConfig") { "${aafwk_path}/interfaces/innerkits/ability_manager/include", "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${aafwk_path}/frameworks/kits/appkit/native/app", @@ -31,8 +32,8 @@ config("amsKitSTAbilityManagerConfig") { "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsKitSTAbilityManagerFirst\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsKitSTAbilityManagerFirst\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsKitSTAbilityManagerFirst") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSTAbilityManagerFirst/src/kit_test_ability_manager.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSTAbilityManagerFirst/src/kit_test_ability_manager.cpp index 50307f3f9e..e821dd6a51 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSTAbilityManagerFirst/src/kit_test_ability_manager.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSTAbilityManagerFirst/src/kit_test_ability_manager.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -50,12 +50,12 @@ void KitTestAbilityManager::SubscribeEvent(const vector_conststr &eventList) void KitTestAbilityManager::AbilityManagerStByCode(int apiIndex, int caseIndex, int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerStByCode"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerStByCode"); if (mapStKitFunc_.find(apiIndex) != mapStKitFunc_.end() && static_cast(mapStKitFunc_[apiIndex].size()) > caseIndex) { mapStKitFunc_[apiIndex][caseIndex](code); } else { - APP_LOGI("AbilityManagerStByCode error"); + HILOG_INFO("AbilityManagerStByCode error"); } } @@ -108,21 +108,21 @@ void KitTestAbilityManager::GetAllStackInfo(MissionStackInfo &missionStackInfo, // GetAllRunningProcesses ST kit case void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase1(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase1"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase1"); std::vector info = AbilityManager::GetInstance().GetAllRunningProcesses(); CompareProcessName(info, currentProcessInfo, code); } void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase2(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase2"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase2"); std::vector info = AbilityManager::GetInstance().GetAllRunningProcesses(); CompareProcessName(info, launchProcessInfo, code); } void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase3(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase3"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase3"); std::vector info = AbilityManager::GetInstance().GetAllRunningProcesses(); std::shared_ptr processInfo = AbilityContext::GetProcessInfo(); bool result = false; @@ -136,49 +136,49 @@ void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase3(int code) void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase4(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase4"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase4"); std::vector info = AbilityManager::GetInstance().GetAllRunningProcesses(); CompareProcessState(info, currentProcessInfo, AppProcessState::APP_STATE_FOREGROUND, code); } void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase5(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase5"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase5"); auto index = 0; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllRunningProcesses, index, code); } void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase6(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase6"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase6"); auto index = 1; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllRunningProcesses, index, code); } void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase7(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase7"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase7"); auto index = 2; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllRunningProcesses, index, code); } void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase8(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase8"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase8"); auto index = 3; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllRunningProcesses, index, code); } void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase9(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase9"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase9"); auto index = 4; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllRunningProcesses, index, code); } void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase10(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase10"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase10"); auto index = 5; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllRunningProcesses, index, code); } @@ -186,7 +186,7 @@ void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase10(int code) // GetAllStackInfo ST kit case void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase1(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase1"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase1"); MissionStackInfo missionStackInfo; GetAllStackInfo(missionStackInfo, 1); bool result = (missionStackInfo.missionRecords.size() == 1); @@ -195,7 +195,7 @@ void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase1(int code) void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase2(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase2"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase2"); MissionStackInfo missionStackInfo; GetAllStackInfo(missionStackInfo, 1); auto abilityInfos = missionStackInfo.missionRecords[0].abilityRecordInfos; @@ -205,7 +205,7 @@ void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase2(int code) void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase3(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase3"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase3"); MissionStackInfo missionStackInfo; GetAllStackInfo(missionStackInfo, 0); bool result = (missionStackInfo.missionRecords.size() == 1); @@ -214,7 +214,7 @@ void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase3(int code) void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase4(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase4"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase4"); MissionStackInfo missionStackInfo; GetAllStackInfo(missionStackInfo, 0); auto abilityInfos = missionStackInfo.missionRecords[0].abilityRecordInfos; @@ -224,35 +224,35 @@ void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase4(int code) void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase5(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase5"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase5"); auto index = 0; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllStackInfo, index, code); } void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase6(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase6"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase6"); auto index = 1; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllStackInfo, index, code); } void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase7(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase7"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase7"); auto index = 2; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllStackInfo, index, code); } void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase8(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase8"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase8"); auto index = 3; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllStackInfo, index, code); } void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase9(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase9"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase9"); auto index = 4; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllStackInfo, index, code); } @@ -268,7 +268,7 @@ void KitTestAbilityManager::QueryRecentAbilityMissionInfoParam(int numMax, int c void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase1(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase1"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase1"); auto num = -1; auto size = 0; QueryRecentAbilityMissionInfoParam(num, code, size, RECENT_IGNORE_UNAVAILABLE); @@ -276,7 +276,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase1(int void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase2(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase2"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase2"); auto num = 3; auto size = 0; auto flag = -1; @@ -285,7 +285,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase2(int void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase3(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase3"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase3"); auto num = 3; auto size = 0; auto flag = 0; @@ -294,7 +294,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase3(int void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase4(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase4"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase4"); auto num = 3; auto size = 0; auto flag = 3; @@ -303,7 +303,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase4(int void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase5(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase5"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase5"); auto num = 3; auto size = 1; QueryRecentAbilityMissionInfoParam(num, code, size, RECENT_WITH_EXCLUDED); @@ -311,7 +311,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase5(int void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase6(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase6"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase6"); auto num = 3; auto size = 1; QueryRecentAbilityMissionInfoParam(num, code, size, RECENT_IGNORE_UNAVAILABLE); @@ -319,7 +319,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase6(int void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase7(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase7"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase7"); std::vector info; auto num = 3; info = AbilityManager::GetInstance().QueryRecentAbilityMissionInfo(num, RECENT_WITH_EXCLUDED); @@ -332,28 +332,28 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase7(int void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase8(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase8"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase8"); auto index = 0; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::QueryRecentAbilityMissionInfo, index, code); } void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase9(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase9"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase9"); auto index = 1; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::QueryRecentAbilityMissionInfo, index, code); } void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase10(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase10"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase10"); auto index = 2; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::QueryRecentAbilityMissionInfo, index, code); } void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase11(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase11"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase11"); auto num = std::numeric_limits::min(); auto size = 0; QueryRecentAbilityMissionInfoParam(num, code, size, RECENT_WITH_EXCLUDED); @@ -361,7 +361,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase11(in void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase12(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase12"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase12"); auto num = std::numeric_limits::max(); auto size = 1; QueryRecentAbilityMissionInfoParam(num, code, size, RECENT_WITH_EXCLUDED); @@ -369,7 +369,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase12(in void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase13(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase13"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase13"); auto num = 3; auto size = 0; auto flag = std::numeric_limits::min(); @@ -378,7 +378,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase13(in void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase14(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase14"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase14"); auto num = 3; auto size = 0; auto flag = std::numeric_limits::max(); @@ -396,7 +396,7 @@ void KitTestAbilityManager::QueryRunningAbilityMissionInfoParam(int numMax, int void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase1(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase1"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase1"); auto num = -1; auto flag = 0; QueryRunningAbilityMissionInfoParam(num, code, flag); @@ -404,7 +404,7 @@ void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase1(in void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase2(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase2"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase2"); auto num = 0; auto flag = 0; QueryRunningAbilityMissionInfoParam(num, code, flag); @@ -412,7 +412,7 @@ void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase2(in void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase3(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase3"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase3"); auto num = 3; auto flag = 1; QueryRunningAbilityMissionInfoParam(num, code, flag); @@ -420,7 +420,7 @@ void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase3(in void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase4(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase4"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase4"); std::vector info; auto num = 3; info = AbilityManager::GetInstance().QueryRunningAbilityMissionInfo(num); @@ -433,47 +433,47 @@ void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase4(in void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase5(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase5"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase5"); auto index = 0; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::QueryRunningAbilityMissionInfo, index, code); } void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase6(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase6"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase6"); auto index = 1; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::QueryRunningAbilityMissionInfo, index, code); } void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase7(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase7"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase7"); auto index = 2; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::QueryRunningAbilityMissionInfo, index, code); } void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase8(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase8"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase8"); QueryRunningAbilityMissionInfoParam(std::numeric_limits::min(), code, 0); } void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase9(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase9"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase9"); QueryRunningAbilityMissionInfoParam(std::numeric_limits::max(), code, 1); } // MoveMissionToTop ST kit case void KitTestAbilityManager::AbilityManagerMoveMissionToTopCase1(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerMoveMissionToTopCase1"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerMoveMissionToTopCase1"); StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::MoveMissionToTop, 0, code); } void KitTestAbilityManager::AbilityManagerMoveMissionToTopCase2(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerMoveMissionToTopCase2"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerMoveMissionToTopCase2"); moveMissionToTopCode = code; isMoveMissionToTop = true; Want wantEntity; @@ -490,7 +490,7 @@ void KitTestAbilityManager::AbilityManagerClearUpApplicationDataCase1(int code) void KitTestAbilityManager::OnStart(const Want &want) { - APP_LOGI("KitTestAbilityManager::onStart"); + HILOG_INFO("KitTestAbilityManager::onStart"); Ability::OnStart(want); SubscribeEvent(g_requPageManagerAbilitySTVector); std::string eventData = GetAbilityName() + g_abilityStateOnStart; @@ -499,7 +499,7 @@ void KitTestAbilityManager::OnStart(const Want &want) void KitTestAbilityManager::OnStop() { - APP_LOGI("KitTestAbilityManager::onStop"); + HILOG_INFO("KitTestAbilityManager::onStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber); std::string eventData = GetAbilityName() + g_abilityStateOnStop; @@ -508,7 +508,7 @@ void KitTestAbilityManager::OnStop() void KitTestAbilityManager::OnActive() { - APP_LOGI("KitTestAbilityManager::OnActive"); + HILOG_INFO("KitTestAbilityManager::OnActive"); Ability::OnActive(); if (isMoveMissionToTop) { TestUtils::PublishEvent(g_respPageManagerAbilityST, moveMissionToTopCode, "1"); @@ -521,7 +521,7 @@ void KitTestAbilityManager::OnActive() void KitTestAbilityManager::OnInactive() { - APP_LOGI("KitTestAbilityManager::OnInactive"); + HILOG_INFO("KitTestAbilityManager::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + g_abilityStateOnInactive; TestUtils::PublishEvent(g_respPageManagerAbilityST, 0, eventData); @@ -529,7 +529,7 @@ void KitTestAbilityManager::OnInactive() void KitTestAbilityManager::OnBackground() { - APP_LOGI("KitTestAbilityManager::OnBackground"); + HILOG_INFO("KitTestAbilityManager::OnBackground"); Ability::OnBackground(); if (isMoveMissionToTop) { std::vector info; @@ -548,7 +548,7 @@ void KitTestAbilityManager::OnBackground() void KitTestAbilityManager::OnForeground(const Want &want) { - APP_LOGI("KitTestAbilityManager::OnForeground"); + HILOG_INFO("KitTestAbilityManager::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + g_abilityStateOnForeground; TestUtils::PublishEvent(g_respPageManagerAbilityST, 0, eventData); @@ -556,7 +556,7 @@ void KitTestAbilityManager::OnForeground(const Want &want) void KitTestAbilityManager::OnNewWant(const Want &want) { - APP_LOGI("KitTestAbilityManager::OnNewWant"); + HILOG_INFO("KitTestAbilityManager::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + g_abilityStateOnNewWant; TestUtils::PublishEvent(g_respPageManagerAbilityST, 0, eventData); @@ -565,9 +565,9 @@ void KitTestAbilityManager::OnNewWant(const Want &want) // KitTestManagerEventSubscriber Class void KitTestManagerEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (g_requPageManagerAbilityST == eventName) { auto target = data.GetData(); @@ -586,7 +586,7 @@ void KitTestManagerEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (keyMap == "TerminateAbility") { KitTerminateAbility(); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/BUILD.gn index bded016426..4ef63c105d 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/BUILD.gn @@ -20,6 +20,7 @@ config("amsKitSystemTestconfig") { "${aafwk_path}/interfaces/innerkits/ability_manager/include", "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${aafwk_path}/frameworks/kits/appkit/native/app", @@ -31,8 +32,8 @@ config("amsKitSystemTestconfig") { "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsKitSystemTest\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsKitSystemTest\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsKitSystemTest") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/fifth_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/fifth_ability.cpp index 98b82ab1c9..6613287e1e 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/fifth_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/fifth_ability.cpp @@ -14,7 +14,7 @@ */ #include "fifth_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ohos/aafwk/base/array_wrapper.h" #include "ohos/aafwk/base/base_types.h" #include "ohos/aafwk/base/bool_wrapper.h" @@ -37,20 +37,20 @@ void FifthAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("FifthAbility::Init"); + HILOG_INFO("FifthAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } void FifthAbility::OnStart(const Want &want) { - APP_LOGI("FifthAbility::onStart"); + HILOG_INFO("FifthAbility::onStart"); Ability::OnStart(want); SubscribeEvent(); } void FifthAbility::OnStop() { - APP_LOGI("FifthAbility::onStop"); + HILOG_INFO("FifthAbility::onStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber); TestUtils::PublishEvent(g_EVENT_RESP_FIFTH, Ability::GetState(), "OnStop"); @@ -58,44 +58,44 @@ void FifthAbility::OnStop() void FifthAbility::OnActive() { - APP_LOGI("FifthAbility::OnActive"); + HILOG_INFO("FifthAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent(g_EVENT_RESP_FIFTH, Ability::GetState(), "OnActive"); } void FifthAbility::OnInactive() { - APP_LOGI("FifthAbility::OnInactive"); + HILOG_INFO("FifthAbility::OnInactive"); Ability::OnInactive(); } void FifthAbility::OnBackground() { - APP_LOGI("FifthAbility::OnBackground"); + HILOG_INFO("FifthAbility::OnBackground"); Ability::OnBackground(); } void FifthAbility::OnForeground(const Want &want) { - APP_LOGI("FifthAbility::OnForeground"); + HILOG_INFO("FifthAbility::OnForeground"); Ability::OnForeground(want); } void FifthAbility::OnAbilityResult(int requestCode, int resultCode, const Want &resultData) { - APP_LOGI("FifthAbility::OnAbilityResult"); + HILOG_INFO("FifthAbility::OnAbilityResult"); Ability::OnAbilityResult(requestCode, resultCode, resultData); } void FifthAbility::OnBackPressed() { - APP_LOGI("FifthAbility::OnBackPressed"); + HILOG_INFO("FifthAbility::OnBackPressed"); Ability::OnBackPressed(); } void FifthAbility::OnNewWant(const Want &want) { - APP_LOGI("FifthAbility::OnNewWant"); + HILOG_INFO("FifthAbility::OnNewWant"); Ability::OnNewWant(want); } @@ -116,9 +116,9 @@ void FifthAbility::SubscribeEvent() void FifthEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FifthEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("FifthEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("FifthEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FifthEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("FifthEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("FifthEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), g_EVENT_REQU_FIFTH.c_str()) == 0) { auto target = data.GetData(); @@ -133,14 +133,14 @@ void FifthEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (mapTestFunc_.find(caseInfo[handle]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[handle]](std::stoi(caseInfo[api]), std::stoi(caseInfo[code]), data.GetCode()); } else { - APP_LOGI("FifthEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("FifthEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } void FifthAbility::TestWantParams(int apiIndex, int caseIndex, int code) { - APP_LOGI("FifthAbility::TestWantParams"); + HILOG_INFO("FifthAbility::TestWantParams"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); @@ -151,7 +151,7 @@ void FifthAbility::TestWantParams(int apiIndex, int caseIndex, int code) // set string param void FifthAbility::WantParamsSetParamCase1(int code) { - APP_LOGI("WantParamsSetParamCase1"); + HILOG_INFO("WantParamsSetParamCase1"); std::string key = "key"; std::string value = "value"; WantParams wParams; diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/fourth_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/fourth_ability.cpp index 844827e876..6f2b633c79 100755 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/fourth_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/fourth_ability.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ohos/aafwk/base/array_wrapper.h" #include "ohos/aafwk/base/bool_wrapper.h" #include "ohos/aafwk/base/byte_wrapper.h" @@ -576,12 +576,12 @@ void FourthAbility::SubscribeEvent(const vector_conststr &eventList) void FourthAbility::SkillsApiStByCode(int apiIndex, int caseIndex, int code) { - APP_LOGI("FourthAbility::SkillsApiStByCode"); + HILOG_INFO("FourthAbility::SkillsApiStByCode"); if (mapStKitFunc_.find(apiIndex) != mapStKitFunc_.end() && static_cast(mapStKitFunc_[apiIndex].size()) > caseIndex) { mapStKitFunc_[apiIndex][caseIndex](code); } else { - APP_LOGI("SkillsApiStByCode error"); + HILOG_INFO("SkillsApiStByCode error"); } } @@ -2402,7 +2402,7 @@ void FourthAbility::SkillAddSchemeSpecificPartCase1(int code) // Skills API ST End void FourthAbility::OnStart(const Want &want) { - APP_LOGI("FourthAbility::onStart"); + HILOG_INFO("FourthAbility::onStart"); Ability::OnStart(want); SubscribeEvent(g_requPageFourthAbilitySTVector); std::string eventData = GetAbilityName() + g_abilityStateOnStart; @@ -2411,7 +2411,7 @@ void FourthAbility::OnStart(const Want &want) void FourthAbility::OnStop() { - APP_LOGI("FourthAbility::onStop"); + HILOG_INFO("FourthAbility::onStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber); std::string eventData = GetAbilityName() + g_abilityStateOnStop; @@ -2420,7 +2420,7 @@ void FourthAbility::OnStop() void FourthAbility::OnActive() { - APP_LOGI("FourthAbility::OnActive"); + HILOG_INFO("FourthAbility::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + g_abilityStateOnActive; TestUtils::PublishEvent(g_respPageFourthAbilityST, 0, eventData); @@ -2428,7 +2428,7 @@ void FourthAbility::OnActive() void FourthAbility::OnInactive() { - APP_LOGI("FourthAbility::OnInactive"); + HILOG_INFO("FourthAbility::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + g_abilityStateOnInactive; TestUtils::PublishEvent(g_respPageFourthAbilityST, 0, eventData); @@ -2436,7 +2436,7 @@ void FourthAbility::OnInactive() void FourthAbility::OnBackground() { - APP_LOGI("FourthAbility::OnBackground"); + HILOG_INFO("FourthAbility::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + g_abilityStateOnBackground; TestUtils::PublishEvent(g_respPageFourthAbilityST, 0, eventData); @@ -2444,7 +2444,7 @@ void FourthAbility::OnBackground() void FourthAbility::OnForeground(const Want &want) { - APP_LOGI("FourthAbility::OnForeground"); + HILOG_INFO("FourthAbility::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + g_abilityStateOnForeground; TestUtils::PublishEvent(g_respPageFourthAbilityST, 0, eventData); @@ -2452,7 +2452,7 @@ void FourthAbility::OnForeground(const Want &want) void FourthAbility::OnNewWant(const Want &want) { - APP_LOGI("FourthAbility::OnNewWant"); + HILOG_INFO("FourthAbility::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + g_abilityStateOnNewWant; TestUtils::PublishEvent(g_respPageFourthAbilityST, 0, eventData); @@ -2460,9 +2460,9 @@ void FourthAbility::OnNewWant(const Want &want) void KitTestFourthEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (g_requPageFourthAbilityST == eventName) { auto target = data.GetData(); @@ -2481,7 +2481,7 @@ void KitTestFourthEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (keyMap == "TerminateAbility") { KitTerminateAbility(); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/kit_test_ability_manager.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/kit_test_ability_manager.cpp index 844f12ec94..59c82f21a1 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/kit_test_ability_manager.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/kit_test_ability_manager.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -50,12 +50,12 @@ void KitTestAbilityManager::SubscribeEvent(const vector_conststr &eventList) void KitTestAbilityManager::AbilityManagerStByCode(int apiIndex, int caseIndex, int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerStByCode"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerStByCode"); if (mapStKitFunc_.find(apiIndex) != mapStKitFunc_.end() && static_cast(mapStKitFunc_[apiIndex].size()) > caseIndex) { mapStKitFunc_[apiIndex][caseIndex](code); } else { - APP_LOGI("AbilityManagerStByCode error"); + HILOG_INFO("AbilityManagerStByCode error"); } } @@ -108,21 +108,21 @@ void KitTestAbilityManager::GetAllStackInfo(MissionStackInfo &missionStackInfo, // GetAllRunningProcesses ST kit case void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase1(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase1"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase1"); std::vector info = AbilityManager::GetInstance().GetAllRunningProcesses(); CompareProcessName(info, currentProcessInfo, code); } void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase2(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase2"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase2"); std::vector info = AbilityManager::GetInstance().GetAllRunningProcesses(); CompareProcessName(info, launchProcessInfo, code); } void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase3(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase3"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase3"); std::vector info = AbilityManager::GetInstance().GetAllRunningProcesses(); std::shared_ptr processInfo = AbilityContext::GetProcessInfo(); bool result = false; @@ -136,49 +136,49 @@ void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase3(int code) void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase4(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase4"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase4"); std::vector info = AbilityManager::GetInstance().GetAllRunningProcesses(); CompareProcessState(info, currentProcessInfo, AppProcessState::APP_STATE_FOREGROUND, code); } void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase5(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase5"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase5"); auto index = 0; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllRunningProcesses, index, code); } void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase6(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase6"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase6"); auto index = 1; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllRunningProcesses, index, code); } void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase7(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase7"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase7"); auto index = 2; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllRunningProcesses, index, code); } void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase8(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase8"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase8"); auto index = 3; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllRunningProcesses, index, code); } void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase9(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase9"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase9"); auto index = 4; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllRunningProcesses, index, code); } void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase10(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase10"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase10"); auto index = 5; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllRunningProcesses, index, code); } @@ -186,7 +186,7 @@ void KitTestAbilityManager::AbilityManagerGetAllRunningProcessesCase10(int code) // GetAllStackInfo ST kit case void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase1(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase1"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase1"); MissionStackInfo missionStackInfo; GetAllStackInfo(missionStackInfo, 1); bool result = (missionStackInfo.missionRecords.size() == 1); @@ -195,7 +195,7 @@ void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase1(int code) void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase2(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase2"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase2"); MissionStackInfo missionStackInfo; GetAllStackInfo(missionStackInfo, 1); auto abilityInfos = missionStackInfo.missionRecords[0].abilityRecordInfos; @@ -205,7 +205,7 @@ void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase2(int code) void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase3(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase3"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase3"); MissionStackInfo missionStackInfo; GetAllStackInfo(missionStackInfo, 0); bool result = (missionStackInfo.missionRecords.size() == 1); @@ -214,7 +214,7 @@ void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase3(int code) void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase4(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase4"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase4"); MissionStackInfo missionStackInfo; GetAllStackInfo(missionStackInfo, 0); auto abilityInfos = missionStackInfo.missionRecords[0].abilityRecordInfos; @@ -224,35 +224,35 @@ void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase4(int code) void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase5(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase5"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase5"); auto index = 0; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllStackInfo, index, code); } void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase6(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase6"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase6"); auto index = 1; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllStackInfo, index, code); } void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase7(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase7"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase7"); auto index = 2; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllStackInfo, index, code); } void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase8(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase8"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase8"); auto index = 3; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllStackInfo, index, code); } void KitTestAbilityManager::AbilityManagerGetAllStackInfoCase9(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase9"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerGetAllStackInfoCase9"); auto index = 4; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::GetAllStackInfo, index, code); } @@ -268,7 +268,7 @@ void KitTestAbilityManager::QueryRecentAbilityMissionInfoParam(int numMax, int c void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase1(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase1"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase1"); auto num = -1; auto size = 0; QueryRecentAbilityMissionInfoParam(num, code, size, RECENT_IGNORE_UNAVAILABLE); @@ -276,7 +276,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase1(int void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase2(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase2"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase2"); auto num = 3; auto size = 0; auto flag = -1; @@ -285,7 +285,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase2(int void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase3(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase3"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase3"); auto num = 3; auto size = 0; auto flag = 0; @@ -294,7 +294,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase3(int void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase4(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase4"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase4"); auto num = 3; auto size = 0; auto flag = 3; @@ -303,7 +303,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase4(int void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase5(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase5"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase5"); auto num = 3; auto size = 1; QueryRecentAbilityMissionInfoParam(num, code, size, RECENT_WITH_EXCLUDED); @@ -311,7 +311,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase5(int void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase6(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase6"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase6"); auto num = 3; auto size = 1; QueryRecentAbilityMissionInfoParam(num, code, size, RECENT_IGNORE_UNAVAILABLE); @@ -319,7 +319,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase6(int void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase7(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase7"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase7"); std::vector info; auto num = 3; info = AbilityManager::GetInstance().QueryRecentAbilityMissionInfo(num, RECENT_WITH_EXCLUDED); @@ -332,28 +332,28 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase7(int void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase8(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase8"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase8"); auto index = 0; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::QueryRecentAbilityMissionInfo, index, code); } void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase9(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase9"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase9"); auto index = 1; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::QueryRecentAbilityMissionInfo, index, code); } void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase10(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase10"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase10"); auto index = 2; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::QueryRecentAbilityMissionInfo, index, code); } void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase11(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase11"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase11"); auto num = std::numeric_limits::min(); auto size = 0; QueryRecentAbilityMissionInfoParam(num, code, size, RECENT_WITH_EXCLUDED); @@ -361,7 +361,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase11(in void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase12(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase12"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase12"); auto num = std::numeric_limits::max(); auto size = 1; QueryRecentAbilityMissionInfoParam(num, code, size, RECENT_WITH_EXCLUDED); @@ -369,7 +369,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase12(in void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase13(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase13"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase13"); auto num = 3; auto size = 0; auto flag = std::numeric_limits::min(); @@ -378,7 +378,7 @@ void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase13(in void KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase14(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase14"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRecentAbilityMissionInfoCase14"); auto num = 3; auto size = 0; auto flag = std::numeric_limits::max(); @@ -396,7 +396,7 @@ void KitTestAbilityManager::QueryRunningAbilityMissionInfoParam(int numMax, int void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase1(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase1"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase1"); auto num = -1; auto flag = 0; QueryRunningAbilityMissionInfoParam(num, code, flag); @@ -404,7 +404,7 @@ void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase1(in void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase2(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase2"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase2"); auto num = 0; auto flag = 0; QueryRunningAbilityMissionInfoParam(num, code, flag); @@ -412,7 +412,7 @@ void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase2(in void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase3(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase3"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase3"); auto num = 3; auto flag = 1; QueryRunningAbilityMissionInfoParam(num, code, flag); @@ -420,7 +420,7 @@ void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase3(in void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase4(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase4"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase4"); std::vector info; auto num = 3; info = AbilityManager::GetInstance().QueryRunningAbilityMissionInfo(num); @@ -433,47 +433,47 @@ void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase4(in void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase5(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase5"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase5"); auto index = 0; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::QueryRunningAbilityMissionInfo, index, code); } void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase6(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase6"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase6"); auto index = 1; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::QueryRunningAbilityMissionInfo, index, code); } void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase7(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase7"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase7"); auto index = 2; StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::QueryRunningAbilityMissionInfo, index, code); } void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase8(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase8"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase8"); QueryRunningAbilityMissionInfoParam(std::numeric_limits::min(), code, 0); } void KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase9(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase9"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerQueryRunningAbilityMissionInfoCase9"); QueryRunningAbilityMissionInfoParam(std::numeric_limits::max(), code, 1); } // MoveMissionToTop ST kit case void KitTestAbilityManager::AbilityManagerMoveMissionToTopCase1(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerMoveMissionToTopCase1"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerMoveMissionToTopCase1"); StartAbilitySelf(bundleName, abilityName, AbilityManagerApi::MoveMissionToTop, 0, code); } void KitTestAbilityManager::AbilityManagerMoveMissionToTopCase2(int code) { - APP_LOGI("KitTestAbilityManager::AbilityManagerMoveMissionToTopCase2"); + HILOG_INFO("KitTestAbilityManager::AbilityManagerMoveMissionToTopCase2"); moveMissionToTopCode = code; isMoveMissionToTop = true; Want wantEntity; @@ -490,7 +490,7 @@ void KitTestAbilityManager::AbilityManagerClearUpApplicationDataCase1(int code) void KitTestAbilityManager::OnStart(const Want &want) { - APP_LOGI("KitTestAbilityManager::onStart"); + HILOG_INFO("KitTestAbilityManager::onStart"); Ability::OnStart(want); SubscribeEvent(g_requPageManagerAbilitySTVector); std::string eventData = GetAbilityName() + g_abilityStateOnStart; @@ -499,7 +499,7 @@ void KitTestAbilityManager::OnStart(const Want &want) void KitTestAbilityManager::OnStop() { - APP_LOGI("KitTestAbilityManager::onStop"); + HILOG_INFO("KitTestAbilityManager::onStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber); std::string eventData = GetAbilityName() + g_abilityStateOnStop; @@ -508,7 +508,7 @@ void KitTestAbilityManager::OnStop() void KitTestAbilityManager::OnActive() { - APP_LOGI("KitTestAbilityManager::OnActive"); + HILOG_INFO("KitTestAbilityManager::OnActive"); Ability::OnActive(); if (isMoveMissionToTop) { TestUtils::PublishEvent(g_respPageManagerAbilityST, moveMissionToTopCode, "1"); @@ -521,7 +521,7 @@ void KitTestAbilityManager::OnActive() void KitTestAbilityManager::OnInactive() { - APP_LOGI("KitTestAbilityManager::OnInactive"); + HILOG_INFO("KitTestAbilityManager::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + g_abilityStateOnInactive; TestUtils::PublishEvent(g_respPageManagerAbilityST, 0, eventData); @@ -529,7 +529,7 @@ void KitTestAbilityManager::OnInactive() void KitTestAbilityManager::OnBackground() { - APP_LOGI("KitTestAbilityManager::OnBackground"); + HILOG_INFO("KitTestAbilityManager::OnBackground"); Ability::OnBackground(); if (isMoveMissionToTop) { std::vector info; @@ -548,7 +548,7 @@ void KitTestAbilityManager::OnBackground() void KitTestAbilityManager::OnForeground(const Want &want) { - APP_LOGI("KitTestAbilityManager::OnForeground"); + HILOG_INFO("KitTestAbilityManager::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + g_abilityStateOnForeground; TestUtils::PublishEvent(g_respPageManagerAbilityST, 0, eventData); @@ -556,7 +556,7 @@ void KitTestAbilityManager::OnForeground(const Want &want) void KitTestAbilityManager::OnNewWant(const Want &want) { - APP_LOGI("KitTestAbilityManager::OnNewWant"); + HILOG_INFO("KitTestAbilityManager::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + g_abilityStateOnNewWant; TestUtils::PublishEvent(g_respPageManagerAbilityST, 0, eventData); @@ -565,9 +565,9 @@ void KitTestAbilityManager::OnNewWant(const Want &want) // KitTestManagerEventSubscriber Class void KitTestManagerEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (g_requPageManagerAbilityST == eventName) { auto target = data.GetData(); @@ -586,7 +586,7 @@ void KitTestManagerEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (keyMap == "TerminateAbility") { KitTerminateAbility(); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/main_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/main_ability.cpp index cfd54c7116..ef1041671d 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/main_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/main_ability.cpp @@ -14,7 +14,7 @@ */ #include "main_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -25,13 +25,13 @@ void MainAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("MainAbility::Init"); + HILOG_INFO("MainAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } void MainAbility::OnStart(const Want &want) { - APP_LOGI("MainAbility::onStart"); + HILOG_INFO("MainAbility::onStart"); SubscribeEvent(); Ability::OnStart(want); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, Ability::GetState(), "onStart"); @@ -39,7 +39,7 @@ void MainAbility::OnStart(const Want &want) void MainAbility::OnStop() { - APP_LOGI("MainAbility::OnStop"); + HILOG_INFO("MainAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, Ability::GetState(), "OnStop"); @@ -47,49 +47,49 @@ void MainAbility::OnStop() void MainAbility::OnActive() { - APP_LOGI("MainAbility::OnActive"); + HILOG_INFO("MainAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, Ability::GetState(), "OnActive"); } void MainAbility::OnInactive() { - APP_LOGI("MainAbility::OnInactive"); + HILOG_INFO("MainAbility::OnInactive"); Ability::OnInactive(); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, Ability::GetState(), "OnInactive"); } void MainAbility::OnBackground() { - APP_LOGI("MainAbility::OnBackground"); + HILOG_INFO("MainAbility::OnBackground"); Ability::OnBackground(); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, Ability::GetState(), "OnBackground"); } void MainAbility::OnForeground(const Want &want) { - APP_LOGI("MainAbility::OnForeground"); + HILOG_INFO("MainAbility::OnForeground"); Ability::OnForeground(want); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, Ability::GetState(), "OnForeground"); } void MainAbility::OnAbilityResult(int requestCode, int resultCode, const Want &resultData) { - APP_LOGI("MainAbility::OnAbilityResult"); + HILOG_INFO("MainAbility::OnAbilityResult"); Ability::OnAbilityResult(requestCode, resultCode, resultData); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_ON_ABILITY_RESULT, 0, resultData.ToUri()); } void MainAbility::OnBackPressed() { - APP_LOGI("MainAbility::OnBackPressed"); + HILOG_INFO("MainAbility::OnBackPressed"); Ability::OnBackPressed(); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_ON_BACK_PRESSED, 0, ""); } void MainAbility::OnNewWant(const Want &want) { - APP_LOGI("MainAbility::OnNewWant"); + HILOG_INFO("MainAbility::OnNewWant"); Ability::OnNewWant(want); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_ON_NEW_WANT, 0, want.ToUri()); } @@ -111,9 +111,9 @@ void MainAbility::SubscribeEvent() void FirstEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), g_EVENT_REQU_FIRST.c_str()) == 0) { auto target = data.GetData(); @@ -128,14 +128,14 @@ void FirstEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (mapTestFunc_.find(caseInfo[handle]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[handle]](std::stoi(caseInfo[api]), std::stoi(caseInfo[code]), data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } void MainAbility::TestAbility(int apiIndex, int caseIndex, int code) { - APP_LOGI("MainAbility::TestAbility"); + HILOG_INFO("MainAbility::TestAbility"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); @@ -196,14 +196,14 @@ void MainAbility::GetWantCase3(int code) void MainAbility::GetWindowCase1(int code) { - APP_LOGI("MainAbility::GetWindowCase1"); + HILOG_INFO("MainAbility::GetWindowCase1"); bool result = true; TestUtils::PublishEvent(g_EVENT_RESP_FIRST, code, std::to_string(result)); } void MainAbility::DumpCase1(int code) { - APP_LOGI("MainAbility::DumpCase1"); + HILOG_INFO("MainAbility::DumpCase1"); std::string dumpInfo; Ability::Dump(dumpInfo); bool result = true; diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/second_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/second_ability.cpp index eab7fd56f8..2616d1b899 100755 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/second_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/second_ability.cpp @@ -14,7 +14,7 @@ */ #include "second_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ohos/aafwk/base/array_wrapper.h" #include "ohos/aafwk/base/base_types.h" #include "ohos/aafwk/base/bool_wrapper.h" @@ -62,14 +62,14 @@ void SecondAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("SecondAbility::Init"); + HILOG_INFO("SecondAbility::Init"); Ability::Init(abilityInfo, application, handler, token); TestUtils::PublishEvent(g_EVENT_RESP_SECOND, Ability::GetState(), "Init"); } void SecondAbility::OnStart(const Want &want) { - APP_LOGI("SecondAbility::onStart"); + HILOG_INFO("SecondAbility::onStart"); SubscribeEvent(); Ability::OnStart(want); @@ -78,7 +78,7 @@ void SecondAbility::OnStart(const Want &want) void SecondAbility::OnStop() { - APP_LOGI("SecondAbility::onStop"); + HILOG_INFO("SecondAbility::onStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber); TestUtils::PublishEvent(g_EVENT_RESP_SECOND, Ability::GetState(), "OnStop"); @@ -86,49 +86,49 @@ void SecondAbility::OnStop() void SecondAbility::OnActive() { - APP_LOGI("SecondAbility::OnActive"); + HILOG_INFO("SecondAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND, Ability::GetState(), "OnActive"); } void SecondAbility::OnInactive() { - APP_LOGI("SecondAbility::OnInactive"); + HILOG_INFO("SecondAbility::OnInactive"); Ability::OnInactive(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND, Ability::GetState(), "OnInactive"); } void SecondAbility::OnBackground() { - APP_LOGI("SecondAbility::OnBackground"); + HILOG_INFO("SecondAbility::OnBackground"); Ability::OnBackground(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND, Ability::GetState(), "OnBackground"); } void SecondAbility::OnForeground(const Want &want) { - APP_LOGI("SecondAbility::OnForeground"); + HILOG_INFO("SecondAbility::OnForeground"); Ability::OnForeground(want); TestUtils::PublishEvent(g_EVENT_RESP_SECOND, Ability::GetState(), "OnForeground"); } void SecondAbility::OnAbilityResult(int requestCode, int resultCode, const Want &resultData) { - APP_LOGI("SecondAbility::OnAbilityResult"); + HILOG_INFO("SecondAbility::OnAbilityResult"); Ability::OnAbilityResult(requestCode, resultCode, resultData); TestUtils::PublishEvent(g_EVENT_RESP_SECOND, Ability::GetState(), "OnAbilityResult"); } void SecondAbility::OnBackPressed() { - APP_LOGI("SecondAbility::OnBackPressed"); + HILOG_INFO("SecondAbility::OnBackPressed"); Ability::OnBackPressed(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND, Ability::GetState(), "OnBackPressed"); } void SecondAbility::OnNewWant(const Want &want) { - APP_LOGI("SecondAbility::OnNewWant"); + HILOG_INFO("SecondAbility::OnNewWant"); Ability::OnNewWant(want); TestUtils::PublishEvent(g_EVENT_RESP_SECOND, Ability::GetState(), "OnNewWant"); } @@ -150,9 +150,9 @@ void SecondAbility::SubscribeEvent() void SecondEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), g_EVENT_REQU_SECOND.c_str()) == 0) { auto target = data.GetData(); @@ -164,14 +164,14 @@ void SecondEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (mapTestFunc_.find(caseInfo[index_f]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[index_f]](std::stoi(caseInfo[index_s]), std::stoi(caseInfo[index_t]), data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } void SecondAbility::TestWant(int apiIndex, int caseIndex, int code) { - APP_LOGI("SecondAbility::TestWant"); + HILOG_INFO("SecondAbility::TestWant"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); @@ -3947,7 +3947,7 @@ void SecondAbility::WantSetParamCharCase4(int code) bool result = true; for (size_t i = 0; i < value.size(); i++) { result = result && (want.GetCharParam(key + std::to_string(i), '0') == value.at(i)); - APP_LOGI("WantSetParamCharCase4 (%{public}c)", (char)want.GetCharParam(key + std::to_string(i), '0')); + HILOG_INFO("WantSetParamCharCase4 (%{public}c)", (char)want.GetCharParam(key + std::to_string(i), '0')); } TestUtils::PublishEvent(g_EVENT_RESP_SECOND, code, std::to_string(result)); } diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/sixth_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/sixth_ability.cpp index e47f525103..5c23ee7b6e 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/sixth_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/sixth_ability.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -63,12 +63,12 @@ void SixthAbility::SubscribeEvent(const vector_conststr &eventList) void SixthAbility::ApplicationStByCode(int apiIndex, int caseIndex, int code) { - APP_LOGI("SixthAbility::ApplicationStByCode"); + HILOG_INFO("SixthAbility::ApplicationStByCode"); if (mapStKitFunc_.find(apiIndex) != mapStKitFunc_.end() && static_cast(mapStKitFunc_[apiIndex].size()) > caseIndex) { mapStKitFunc_[apiIndex][caseIndex](code); } else { - APP_LOGI("ApplicationStByCode error"); + HILOG_INFO("ApplicationStByCode error"); } } @@ -76,43 +76,43 @@ void SixthAbility::ApplicationStByCode(int apiIndex, int caseIndex, int code) // RegisterAbilityLifecycleCallbacks ST case void SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase1(int code) { - APP_LOGI("SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase1"); + HILOG_INFO("SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase1"); APPREGISTERABILITYLIFECYCALLBACK(OnAbilityStart, GetOnAbilityStartCount, 1, code); } void SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase2(int code) { - APP_LOGI("SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase2"); + HILOG_INFO("SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase2"); APPREGISTERABILITYLIFECYCALLBACK(OnAbilityInactive, GetOnAbilityInactiveCount, 1, code); } void SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase3(int code) { - APP_LOGI("SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase3"); + HILOG_INFO("SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase3"); APPREGISTERABILITYLIFECYCALLBACK(OnAbilityBackground, GetOnAbilityBackgroundCount, 1, code); } void SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase4(int code) { - APP_LOGI("SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase4"); + HILOG_INFO("SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase4"); APPREGISTERABILITYLIFECYCALLBACK(OnAbilityForeground, GetOnAbilityForegroundCount, 1, code); } void SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase5(int code) { - APP_LOGI("SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase5"); + HILOG_INFO("SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase5"); APPREGISTERABILITYLIFECYCALLBACK(OnAbilityActive, GetOnAbilityActiveCount, 1, code); } void SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase6(int code) { - APP_LOGI("SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase5"); + HILOG_INFO("SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase5"); APPREGISTERABILITYLIFECYCALLBACK(OnAbilityStop, GetOnAbilityStopCount, 1, code); } void SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase7(int code) { - APP_LOGI("SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase7"); + HILOG_INFO("SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase7"); auto callback = std::make_shared(); for (int i = 0; i < cycleCount; i++) { Ability::GetApplication()->RegisterAbilityLifecycleCallbacks(callback); @@ -126,7 +126,7 @@ void SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase7(int code) void SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase8(int code) { - APP_LOGI("SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase8"); + HILOG_INFO("SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase8"); auto callback1 = std::make_shared(); auto callback2 = std::make_shared(); Ability::GetApplication()->RegisterAbilityLifecycleCallbacks(callback1); @@ -143,43 +143,43 @@ void SixthAbility::SkillRegisterAbilityLifecycleCallbacksCase8(int code) // UnregisterAbilityLifecycleCallbacks void SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase1(int code) { - APP_LOGI("SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase1"); + HILOG_INFO("SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase1"); APPUNREGISTERABILITYLIFECYCALLBACK(OnAbilityStart, GetOnAbilityStartCount, 0, code); } void SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase2(int code) { - APP_LOGI("SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase2"); + HILOG_INFO("SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase2"); APPUNREGISTERABILITYLIFECYCALLBACK(OnAbilityInactive, GetOnAbilityInactiveCount, 0, code); } void SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase3(int code) { - APP_LOGI("SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase3"); + HILOG_INFO("SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase3"); APPUNREGISTERABILITYLIFECYCALLBACK(OnAbilityBackground, GetOnAbilityBackgroundCount, 0, code); } void SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase4(int code) { - APP_LOGI("SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase4"); + HILOG_INFO("SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase4"); APPUNREGISTERABILITYLIFECYCALLBACK(OnAbilityForeground, GetOnAbilityForegroundCount, 0, code); } void SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase5(int code) { - APP_LOGI("SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase5"); + HILOG_INFO("SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase5"); APPUNREGISTERABILITYLIFECYCALLBACK(OnAbilityActive, GetOnAbilityActiveCount, 0, code); } void SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase6(int code) { - APP_LOGI("SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase6"); + HILOG_INFO("SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase6"); APPUNREGISTERABILITYLIFECYCALLBACK(OnAbilityStop, GetOnAbilityStopCount, 0, code); } void SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase7(int code) { - APP_LOGI("SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase7"); + HILOG_INFO("SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase7"); auto callback = std::make_shared(); Ability::GetApplication()->RegisterAbilityLifecycleCallbacks(callback); for (int i = 0; i < cycleCount; i++) { @@ -193,7 +193,7 @@ void SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase7(int code) void SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase8(int code) { - APP_LOGI("SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase8"); + HILOG_INFO("SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase8"); auto callback1 = std::make_shared(); auto callback2 = std::make_shared(); Ability::GetApplication()->RegisterAbilityLifecycleCallbacks(callback1); @@ -210,7 +210,7 @@ void SixthAbility::SkillUnregisterAbilityLifecycleCallbacksCase8(int code) // DispatchAbilitySavedState ST case void SixthAbility::SkillDispatchAbilitySavedStateCase1(int code) { - APP_LOGI("SixthAbility::SkillDispatchAbilitySavedStateCase1"); + HILOG_INFO("SixthAbility::SkillDispatchAbilitySavedStateCase1"); auto callback = std::make_shared(); Ability::GetApplication()->RegisterAbilityLifecycleCallbacks(callback); PacMap outState; @@ -222,7 +222,7 @@ void SixthAbility::SkillDispatchAbilitySavedStateCase1(int code) void SixthAbility::SkillDispatchAbilitySavedStateCase2(int code) { - APP_LOGI("SixthAbility::SkillDispatchAbilitySavedStateCase2"); + HILOG_INFO("SixthAbility::SkillDispatchAbilitySavedStateCase2"); auto callback = std::make_shared(); for (int i = 0; i < cycleCount; i++) { Ability::GetApplication()->RegisterAbilityLifecycleCallbacks(callback); @@ -237,7 +237,7 @@ void SixthAbility::SkillDispatchAbilitySavedStateCase2(int code) // RegisterElementsCallbacks void SixthAbility::SkillRegisterElementsCallbacksCase1(int code) { - APP_LOGI("SixthAbility::SkillRegisterElementsCallbacksCase1"); + HILOG_INFO("SixthAbility::SkillRegisterElementsCallbacksCase1"); auto callback = std::make_shared(); Ability::GetApplication()->RegisterElementsCallbacks(callback); Configuration configuration; @@ -249,7 +249,7 @@ void SixthAbility::SkillRegisterElementsCallbacksCase1(int code) void SixthAbility::SkillRegisterElementsCallbacksCase2(int code) { - APP_LOGI("SixthAbility::SkillRegisterElementsCallbacksCase2"); + HILOG_INFO("SixthAbility::SkillRegisterElementsCallbacksCase2"); auto callback = std::make_shared(); Ability::GetApplication()->RegisterElementsCallbacks(callback); Ability::GetApplication()->OnMemoryLevel(1); @@ -260,7 +260,7 @@ void SixthAbility::SkillRegisterElementsCallbacksCase2(int code) void SixthAbility::SkillRegisterElementsCallbacksCase3(int code) { - APP_LOGI("SixthAbility::SkillRegisterElementsCallbacksCase3"); + HILOG_INFO("SixthAbility::SkillRegisterElementsCallbacksCase3"); auto callback = std::make_shared(); for (int i = 0; i < cycleCount; i++) { Ability::GetApplication()->RegisterElementsCallbacks(callback); @@ -274,7 +274,7 @@ void SixthAbility::SkillRegisterElementsCallbacksCase3(int code) void SixthAbility::SkillRegisterElementsCallbacksCase4(int code) { - APP_LOGI("SixthAbility::SkillRegisterElementsCallbacksCase4"); + HILOG_INFO("SixthAbility::SkillRegisterElementsCallbacksCase4"); auto callback1 = std::make_shared(); auto callback2 = std::make_shared(); Ability::GetApplication()->RegisterElementsCallbacks(callback1); @@ -290,7 +290,7 @@ void SixthAbility::SkillRegisterElementsCallbacksCase4(int code) // UnregisterElementsCallbacks void SixthAbility::SkillUnregisterElementsCallbacksCase1(int code) { - APP_LOGI("SixthAbility::SkillUnregisterElementsCallbacksCase1"); + HILOG_INFO("SixthAbility::SkillUnregisterElementsCallbacksCase1"); auto callback = std::make_shared(); Ability::GetApplication()->RegisterElementsCallbacks(callback); Ability::GetApplication()->UnregisterElementsCallbacks(callback); @@ -302,7 +302,7 @@ void SixthAbility::SkillUnregisterElementsCallbacksCase1(int code) void SixthAbility::SkillUnregisterElementsCallbacksCase2(int code) { - APP_LOGI("SixthAbility::SkillUnregisterElementsCallbacksCase2"); + HILOG_INFO("SixthAbility::SkillUnregisterElementsCallbacksCase2"); auto callback = std::make_shared(); Ability::GetApplication()->RegisterElementsCallbacks(callback); Ability::GetApplication()->UnregisterElementsCallbacks(callback); @@ -313,7 +313,7 @@ void SixthAbility::SkillUnregisterElementsCallbacksCase2(int code) void SixthAbility::SkillUnregisterElementsCallbacksCase3(int code) { - APP_LOGI("SixthAbility::SkillRegisterElementsCallbacksCase3"); + HILOG_INFO("SixthAbility::SkillRegisterElementsCallbacksCase3"); auto callback = std::make_shared(); Ability::GetApplication()->RegisterElementsCallbacks(callback); for (int i = 0; i < cycleCount; i++) { @@ -327,7 +327,7 @@ void SixthAbility::SkillUnregisterElementsCallbacksCase3(int code) void SixthAbility::SkillUnregisterElementsCallbacksCase4(int code) { - APP_LOGI("SixthAbility::SkillUnregisterElementsCallbacksCase4"); + HILOG_INFO("SixthAbility::SkillUnregisterElementsCallbacksCase4"); auto callback1 = std::make_shared(); auto callback2 = std::make_shared(); Ability::GetApplication()->RegisterElementsCallbacks(callback1); @@ -345,7 +345,7 @@ void SixthAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("SixthAbility::Init"); + HILOG_INFO("SixthAbility::Init"); Ability::Init(abilityInfo, application, handler, token); auto callback = std::make_shared(); Ability::GetApplication()->RegisterAbilityLifecycleCallbacks(callback); @@ -353,7 +353,7 @@ void SixthAbility::Init(const std::shared_ptr &abilityInfo, void SixthAbility::OnStart(const Want &want) { - APP_LOGI("SixthAbility::onStart"); + HILOG_INFO("SixthAbility::onStart"); GetWantInfo(want); Ability::OnStart(want); SubscribeEvent(g_requPageSixthAbilitySTVector); @@ -363,7 +363,7 @@ void SixthAbility::OnStart(const Want &want) void SixthAbility::OnStop() { - APP_LOGI("SixthAbility::onStop"); + HILOG_INFO("SixthAbility::onStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber); std::string eventData = GetAbilityName() + g_abilityStateOnStop; @@ -372,7 +372,7 @@ void SixthAbility::OnStop() void SixthAbility::OnActive() { - APP_LOGI("SixthAbility::OnActive"); + HILOG_INFO("SixthAbility::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle_, ","); std::string startAabilityName = this->Split(targetAbility_, ","); @@ -396,7 +396,7 @@ void SixthAbility::OnActive() void SixthAbility::OnInactive() { - APP_LOGI("SixthAbility::OnInactive"); + HILOG_INFO("SixthAbility::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + g_abilityStateOnInactive; TestUtils::PublishEvent(g_respPageSixthAbilityST, 0, eventData); @@ -404,7 +404,7 @@ void SixthAbility::OnInactive() void SixthAbility::OnBackground() { - APP_LOGI("SixthAbility::OnBackground"); + HILOG_INFO("SixthAbility::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + g_abilityStateOnBackground; TestUtils::PublishEvent(g_respPageSixthAbilityST, 0, eventData); @@ -412,7 +412,7 @@ void SixthAbility::OnBackground() void SixthAbility::OnForeground(const Want &want) { - APP_LOGI("SixthAbility::OnForeground"); + HILOG_INFO("SixthAbility::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + g_abilityStateOnForeground; TestUtils::PublishEvent(g_respPageSixthAbilityST, 0, eventData); @@ -420,7 +420,7 @@ void SixthAbility::OnForeground(const Want &want) void SixthAbility::OnNewWant(const Want &want) { - APP_LOGI("SixthAbility::OnNewWant"); + HILOG_INFO("SixthAbility::OnNewWant"); GetWantInfo(want); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + g_abilityStateOnNewWant; @@ -460,9 +460,9 @@ std::string SixthAbility::Split(std::string &str, std::string delim) void KitTestSixEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (g_requPageSixthAbilityST == eventName) { auto target = data.GetData(); @@ -476,7 +476,7 @@ void KitTestSixEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (keyMap == "TerminateAbility") { KitTerminateAbility(); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } @@ -590,43 +590,43 @@ void CallbackCount::SetOnMemoryLevelCount() // The Lifecycle callback function class (First) void KitTestFirstLifecycleCallbacks::OnAbilityStart(const std::shared_ptr &ability) { - APP_LOGI("KitTestFirstLifecycleCallbacks::OnAbilityStart"); + HILOG_INFO("KitTestFirstLifecycleCallbacks::OnAbilityStart"); callbackCount_.SetOnAbilityStartCount(); } void KitTestFirstLifecycleCallbacks::OnAbilityInactive(const std::shared_ptr &ability) { - APP_LOGI("KitTestFirstLifecycleCallbacks::OnAbilityInactive"); + HILOG_INFO("KitTestFirstLifecycleCallbacks::OnAbilityInactive"); callbackCount_.SetOnAbilityInactiveCount(); } void KitTestFirstLifecycleCallbacks::OnAbilityBackground(const std::shared_ptr &ability) { - APP_LOGI("KitTestFirstLifecycleCallbacks::OnAbilityBackground"); + HILOG_INFO("KitTestFirstLifecycleCallbacks::OnAbilityBackground"); callbackCount_.SetOnAbilityBackgroundCount(); } void KitTestFirstLifecycleCallbacks::OnAbilityForeground(const std::shared_ptr &ability) { - APP_LOGI("KitTestFirstLifecycleCallbacks::OnAbilityForeground"); + HILOG_INFO("KitTestFirstLifecycleCallbacks::OnAbilityForeground"); callbackCount_.SetOnAbilityForegroundCount(); } void KitTestFirstLifecycleCallbacks::OnAbilityActive(const std::shared_ptr &ability) { - APP_LOGI("KitTestFirstLifecycleCallbacks::OnAbilityActive"); + HILOG_INFO("KitTestFirstLifecycleCallbacks::OnAbilityActive"); callbackCount_.SetOnAbilityActiveCount(); } void KitTestFirstLifecycleCallbacks::OnAbilityStop(const std::shared_ptr &ability) { - APP_LOGI("KitTestFirstLifecycleCallbacks::OnAbilityStop"); + HILOG_INFO("KitTestFirstLifecycleCallbacks::OnAbilityStop"); callbackCount_.SetOnAbilityStopCount(); } void KitTestFirstLifecycleCallbacks::OnAbilitySaveState(const PacMap &outState) { - APP_LOGI("KitTestFirstLifecycleCallbacks::OnAbilitySaveState"); + HILOG_INFO("KitTestFirstLifecycleCallbacks::OnAbilitySaveState"); callbackCount_.SetOnAbilitySaveStateCount(); } @@ -638,43 +638,43 @@ CallbackCount KitTestFirstLifecycleCallbacks::GetCallbackCount() // The Lifecycle callback function class (Second) void KitTestSecondLifecycleCallbacks::OnAbilityStart(const std::shared_ptr &ability) { - APP_LOGI("KitTestSecondLifecycleCallbacks::OnAbilityStart"); + HILOG_INFO("KitTestSecondLifecycleCallbacks::OnAbilityStart"); callbackCount_.SetOnAbilityStartCount(); } void KitTestSecondLifecycleCallbacks::OnAbilityInactive(const std::shared_ptr &ability) { - APP_LOGI("KitTestSecondLifecycleCallbacks::OnAbilityInactive"); + HILOG_INFO("KitTestSecondLifecycleCallbacks::OnAbilityInactive"); callbackCount_.SetOnAbilityInactiveCount(); } void KitTestSecondLifecycleCallbacks::OnAbilityBackground(const std::shared_ptr &ability) { - APP_LOGI("KitTestSecondLifecycleCallbacks::OnAbilityBackground"); + HILOG_INFO("KitTestSecondLifecycleCallbacks::OnAbilityBackground"); callbackCount_.SetOnAbilityBackgroundCount(); } void KitTestSecondLifecycleCallbacks::OnAbilityForeground(const std::shared_ptr &ability) { - APP_LOGI("KitTestSecondLifecycleCallbacks::OnAbilityForeground"); + HILOG_INFO("KitTestSecondLifecycleCallbacks::OnAbilityForeground"); callbackCount_.SetOnAbilityForegroundCount(); } void KitTestSecondLifecycleCallbacks::OnAbilityActive(const std::shared_ptr &ability) { - APP_LOGI("KitTestSecondLifecycleCallbacks::OnAbilityActive"); + HILOG_INFO("KitTestSecondLifecycleCallbacks::OnAbilityActive"); callbackCount_.SetOnAbilityActiveCount(); } void KitTestSecondLifecycleCallbacks::OnAbilityStop(const std::shared_ptr &ability) { - APP_LOGI("KitTestSecondLifecycleCallbacks::OnAbilityStop"); + HILOG_INFO("KitTestSecondLifecycleCallbacks::OnAbilityStop"); callbackCount_.SetOnAbilityStopCount(); } void KitTestSecondLifecycleCallbacks::OnAbilitySaveState(const PacMap &outState) { - APP_LOGI("KitTestSecondLifecycleCallbacks::OnAbilitySaveState"); + HILOG_INFO("KitTestSecondLifecycleCallbacks::OnAbilitySaveState"); callbackCount_.SetOnAbilitySaveStateCount(); } @@ -686,49 +686,49 @@ CallbackCount KitTestSecondLifecycleCallbacks::GetCallbackCount() // The Lifecycle callback function class (Third) void KitTestThirdLifecycleCallbacks::OnAbilityStart(const std::shared_ptr &ability) { - APP_LOGI("KitTestThirdLifecycleCallbacks::OnAbilityStart"); + HILOG_INFO("KitTestThirdLifecycleCallbacks::OnAbilityStart"); std::string eventData = ability->GetAbilityName() + g_onAbilityStart; TestUtils::PublishEvent(g_respPageSixthAbilityLifecycleCallbacks, 0, eventData); } void KitTestThirdLifecycleCallbacks::OnAbilityInactive(const std::shared_ptr &ability) { - APP_LOGI("KitTestThirdLifecycleCallbacks::OnAbilityInactive"); + HILOG_INFO("KitTestThirdLifecycleCallbacks::OnAbilityInactive"); std::string eventData = ability->GetAbilityName() + g_onAbilityInactive; TestUtils::PublishEvent(g_respPageSixthAbilityLifecycleCallbacks, 0, eventData); } void KitTestThirdLifecycleCallbacks::OnAbilityBackground(const std::shared_ptr &ability) { - APP_LOGI("KitTestThirdLifecycleCallbacks::OnAbilityBackground"); + HILOG_INFO("KitTestThirdLifecycleCallbacks::OnAbilityBackground"); std::string eventData = ability->GetAbilityName() + g_onAbilityBackground; TestUtils::PublishEvent(g_respPageSixthAbilityLifecycleCallbacks, 0, eventData); } void KitTestThirdLifecycleCallbacks::OnAbilityForeground(const std::shared_ptr &ability) { - APP_LOGI("KitTestThirdLifecycleCallbacks::OnAbilityForeground"); + HILOG_INFO("KitTestThirdLifecycleCallbacks::OnAbilityForeground"); std::string eventData = ability->GetAbilityName() + g_onAbilityForeground; TestUtils::PublishEvent(g_respPageSixthAbilityLifecycleCallbacks, 0, eventData); } void KitTestThirdLifecycleCallbacks::OnAbilityActive(const std::shared_ptr &ability) { - APP_LOGI("KitTestThirdLifecycleCallbacks::OnAbilityActive"); + HILOG_INFO("KitTestThirdLifecycleCallbacks::OnAbilityActive"); std::string eventData = ability->GetAbilityName() + g_onAbilityActive; TestUtils::PublishEvent(g_respPageSixthAbilityLifecycleCallbacks, 0, eventData); } void KitTestThirdLifecycleCallbacks::OnAbilityStop(const std::shared_ptr &ability) { - APP_LOGI("KitTestThirdLifecycleCallbacks::OnAbilityStop"); + HILOG_INFO("KitTestThirdLifecycleCallbacks::OnAbilityStop"); std::string eventData = ability->GetAbilityName() + g_onAbilityStop; TestUtils::PublishEvent(g_respPageSixthAbilityLifecycleCallbacks, 0, eventData); } void KitTestThirdLifecycleCallbacks::OnAbilitySaveState(const PacMap &outState) { - APP_LOGI("KitTestThirdLifecycleCallbacks::OnAbilitySaveState"); + HILOG_INFO("KitTestThirdLifecycleCallbacks::OnAbilitySaveState"); std::string eventData = g_onAbilitySaveState; TestUtils::PublishEvent(g_respPageSixthAbilityLifecycleCallbacks, 0, eventData); } @@ -742,13 +742,13 @@ CallbackCount KitTestThirdLifecycleCallbacks::GetCallbackCount() void KitTestFirstElementsCallback::OnConfigurationUpdated( const std::shared_ptr &ability, const Configuration &config) { - APP_LOGI("KitTestFirstElementsCallback::OnConfigurationUpdated"); + HILOG_INFO("KitTestFirstElementsCallback::OnConfigurationUpdated"); callbackCount_.SetOnConfigurationCount(); } void KitTestFirstElementsCallback::OnMemoryLevel(int level) { - APP_LOGI("KitTestFirstElementsCallback::OnMemoryLevel"); + HILOG_INFO("KitTestFirstElementsCallback::OnMemoryLevel"); callbackCount_.SetOnMemoryLevelCount(); } @@ -761,13 +761,13 @@ CallbackCount KitTestFirstElementsCallback::GetCallbackCount() void KitTestSecondElementsCallback::OnConfigurationUpdated( const std::shared_ptr &ability, const Configuration &config) { - APP_LOGI("KitTestSecondElementsCallback::OnConfigurationUpdated"); + HILOG_INFO("KitTestSecondElementsCallback::OnConfigurationUpdated"); callbackCount_.SetOnConfigurationCount(); } void KitTestSecondElementsCallback::OnMemoryLevel(int level) { - APP_LOGI("KitTestSecondElementsCallback::OnMemoryLevel"); + HILOG_INFO("KitTestSecondElementsCallback::OnMemoryLevel"); callbackCount_.SetOnMemoryLevelCount(); } diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/third_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/third_ability.cpp index f3cf209df3..eb827c66e1 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/third_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTest/src/third_ability.cpp @@ -17,7 +17,7 @@ #include #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -44,12 +44,12 @@ void ThirdAbility::SubscribeEvent(const vector_conststr &eventList) void ThirdAbility::ProcessInfoStByCode(int apiIndex, int caseIndex, int code) { - APP_LOGI("ThirdAbility::ProcessInfoStByCode"); + HILOG_INFO("ThirdAbility::ProcessInfoStByCode"); if (mapStKitFunc_.find(apiIndex) != mapStKitFunc_.end() && static_cast(mapStKitFunc_[apiIndex].size()) > caseIndex) { mapStKitFunc_[apiIndex][caseIndex](code); } else { - APP_LOGI("ProcessInfoStByCode error"); + HILOG_INFO("ProcessInfoStByCode error"); } } @@ -349,7 +349,7 @@ void ThirdAbility::ProcessInfoProcessInfoStringintCase6(int code) void ThirdAbility::OnStart(const Want &want) { - APP_LOGI("ThirdAbility::onStart"); + HILOG_INFO("ThirdAbility::onStart"); GetWantInfo(want); Ability::OnStart(want); SubscribeEvent(g_requPageThirdAbilitySTVector); @@ -359,7 +359,7 @@ void ThirdAbility::OnStart(const Want &want) void ThirdAbility::OnStop() { - APP_LOGI("ThirdAbility::onStop"); + HILOG_INFO("ThirdAbility::onStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber); std::string eventData = GetAbilityName() + g_abilityStateOnStop; @@ -368,7 +368,7 @@ void ThirdAbility::OnStop() void ThirdAbility::OnActive() { - APP_LOGI("ThirdAbility::OnActive"); + HILOG_INFO("ThirdAbility::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle_, ","); std::string startAabilityName = this->Split(targetAbility_, ","); @@ -392,7 +392,7 @@ void ThirdAbility::OnActive() void ThirdAbility::OnInactive() { - APP_LOGI("ThirdAbility::OnInactive"); + HILOG_INFO("ThirdAbility::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + g_abilityStateOnInactive; TestUtils::PublishEvent(g_respPageThirdAbilityST, 0, eventData); @@ -400,7 +400,7 @@ void ThirdAbility::OnInactive() void ThirdAbility::OnBackground() { - APP_LOGI("ThirdAbility::OnBackground"); + HILOG_INFO("ThirdAbility::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + g_abilityStateOnBackground; TestUtils::PublishEvent(g_respPageThirdAbilityST, 0, eventData); @@ -408,7 +408,7 @@ void ThirdAbility::OnBackground() void ThirdAbility::OnForeground(const Want &want) { - APP_LOGI("ThirdAbility::OnForeground"); + HILOG_INFO("ThirdAbility::OnForeground"); GetWantInfo(want); Ability::OnForeground(want); std::string eventData = GetAbilityName() + g_abilityStateOnForeground; @@ -417,7 +417,7 @@ void ThirdAbility::OnForeground(const Want &want) void ThirdAbility::OnNewWant(const Want &want) { - APP_LOGI("ThirdAbility::OnNewWant"); + HILOG_INFO("ThirdAbility::OnNewWant"); GetWantInfo(want); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + g_abilityStateOnNewWant; @@ -457,9 +457,9 @@ std::string ThirdAbility::Split(std::string &str, std::string delim) void KitTestThirdEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (g_requPageThirdAbilityST == eventName) { auto target = data.GetData(); @@ -478,7 +478,7 @@ void KitTestThirdEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (keyMap == "TerminateAbility") { KitTerminateAbility(); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestA/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestA/BUILD.gn index cb9860ed5d..28e1e0bd03 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestA/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestA/BUILD.gn @@ -32,8 +32,8 @@ config("amsKitSystemTestAConfig") { "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsKitSystemTestA\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsKitSystemTestA\"", + "AMS_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestA/src/main_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestA/src/main_ability.cpp index 241f5a44d2..b67e6e482e 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestA/src/main_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestA/src/main_ability.cpp @@ -14,7 +14,7 @@ */ #include "main_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -32,7 +32,7 @@ void MainAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("MainAbility::Init"); + HILOG_INFO("MainAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } @@ -43,7 +43,7 @@ MainAbility::~MainAbility() void MainAbility::OnStart(const Want &want) { - APP_LOGI("MainAbility::onStart"); + HILOG_INFO("MainAbility::onStart"); SubscribeEvent(); Ability::OnStart(want); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, MainAbilityACode, "onStart"); @@ -51,7 +51,7 @@ void MainAbility::OnStart(const Want &want) void MainAbility::OnStop() { - APP_LOGI("MainAbility::OnStop"); + HILOG_INFO("MainAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, MainAbilityACode, "OnStop"); @@ -59,49 +59,49 @@ void MainAbility::OnStop() void MainAbility::OnActive() { - APP_LOGI("MainAbility::OnActive"); + HILOG_INFO("MainAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, MainAbilityACode, "OnActive"); } void MainAbility::OnInactive() { - APP_LOGI("MainAbility::OnInactive"); + HILOG_INFO("MainAbility::OnInactive"); Ability::OnInactive(); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, MainAbilityACode, "OnInactive"); } void MainAbility::OnBackground() { - APP_LOGI("MainAbility::OnBackground"); + HILOG_INFO("MainAbility::OnBackground"); Ability::OnBackground(); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, MainAbilityACode, "OnBackground"); } void MainAbility::OnForeground(const Want &want) { - APP_LOGI("MainAbility::OnForeground"); + HILOG_INFO("MainAbility::OnForeground"); Ability::OnForeground(want); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_LIFECYCLE, MainAbilityACode, "OnForeground"); } void MainAbility::OnAbilityResult(int requestCode, int resultCode, const Want &resultData) { - APP_LOGI("MainAbility::OnAbilityResult"); + HILOG_INFO("MainAbility::OnAbilityResult"); Ability::OnAbilityResult(requestCode, resultCode, resultData); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_ON_ABILITY_RESULT, 0, resultData.ToUri()); } void MainAbility::OnBackPressed() { - APP_LOGI("MainAbility::OnBackPressed"); + HILOG_INFO("MainAbility::OnBackPressed"); Ability::OnBackPressed(); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_ON_BACK_PRESSED, 0, ""); } void MainAbility::OnNewWant(const Want &want) { - APP_LOGI("MainAbility::OnNewWant"); + HILOG_INFO("MainAbility::OnNewWant"); Ability::OnNewWant(want); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_ON_NEW_WANT, 0, want.ToUri()); } @@ -124,9 +124,9 @@ void MainAbility::SubscribeEvent() void FirstEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), g_EVENT_REQU_FIRST.c_str()) == 0) { auto target = data.GetData(); @@ -137,14 +137,14 @@ void FirstEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (mapTestFunc_.find(caseInfo[index_f]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[index_f]](std::stoi(caseInfo[index_s]), std::stoi(caseInfo[index_t]), data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } void MainAbility::TestAbility(int apiIndex, int caseIndex, int code) { - APP_LOGI("MainAbility::TestAbility"); + HILOG_INFO("MainAbility::TestAbility"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestA/src/second_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestA/src/second_ability.cpp index 70aa48177e..b941334fa9 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestA/src/second_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestA/src/second_ability.cpp @@ -14,7 +14,7 @@ */ #include "second_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -32,7 +32,7 @@ void SecondAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("SecondAbility::Init"); + HILOG_INFO("SecondAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } @@ -43,7 +43,7 @@ SecondAbility::~SecondAbility() void SecondAbility::OnStart(const Want &want) { - APP_LOGI("SecondAbility::onStart"); + HILOG_INFO("SecondAbility::onStart"); SubscribeEvent(); Ability::OnStart(want); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SecondAbilityACode, "onStart"); @@ -51,7 +51,7 @@ void SecondAbility::OnStart(const Want &want) void SecondAbility::OnStop() { - APP_LOGI("SecondAbility::OnStop"); + HILOG_INFO("SecondAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SecondAbilityACode, "OnStop"); @@ -59,49 +59,49 @@ void SecondAbility::OnStop() void SecondAbility::OnActive() { - APP_LOGI("SecondAbility::OnActive"); + HILOG_INFO("SecondAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SecondAbilityACode, "OnActive"); } void SecondAbility::OnInactive() { - APP_LOGI("SecondAbility::OnInactive"); + HILOG_INFO("SecondAbility::OnInactive"); Ability::OnInactive(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SecondAbilityACode, "OnInactive"); } void SecondAbility::OnBackground() { - APP_LOGI("SecondAbility::OnBackground"); + HILOG_INFO("SecondAbility::OnBackground"); Ability::OnBackground(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SecondAbilityACode, "OnBackground"); } void SecondAbility::OnForeground(const Want &want) { - APP_LOGI("SecondAbility::OnForeground"); + HILOG_INFO("SecondAbility::OnForeground"); Ability::OnForeground(want); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SecondAbilityACode, "OnForeground"); } void SecondAbility::OnAbilityResult(int requestCode, int resultCode, const Want &resultData) { - APP_LOGI("SecondAbility::OnAbilityResult"); + HILOG_INFO("SecondAbility::OnAbilityResult"); Ability::OnAbilityResult(requestCode, resultCode, resultData); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, 0, resultData.ToUri()); } void SecondAbility::OnBackPressed() { - APP_LOGI("SecondAbility::OnBackPressed"); + HILOG_INFO("SecondAbility::OnBackPressed"); Ability::OnBackPressed(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, 0, ""); } void SecondAbility::OnNewWant(const Want &want) { - APP_LOGI("SecondAbility::OnNewWant"); + HILOG_INFO("SecondAbility::OnNewWant"); Ability::OnNewWant(want); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, 0, want.ToUri()); } @@ -124,9 +124,9 @@ void SecondAbility::SubscribeEvent() void SecondEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), g_EVENT_REQU_SECOND.c_str()) == 0) { auto target = data.GetData(); @@ -137,14 +137,14 @@ void SecondEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (mapTestFunc_.find(caseInfo[index_f]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[index_f]](std::stoi(caseInfo[index_s]), std::stoi(caseInfo[index_t]), data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } void SecondAbility::TestAbility(int apiIndex, int caseIndex, int code) { - APP_LOGI("SecondAbility::TestAbility"); + HILOG_INFO("SecondAbility::TestAbility"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestB/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestB/BUILD.gn index e053dd9c09..01994d35f4 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestB/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestB/BUILD.gn @@ -32,8 +32,8 @@ config("amsKitSystemTestBConfig") { "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsKitSystemTestB\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsKitSystemTestB\"", + "AMS_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestB/src/main_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestB/src/main_ability.cpp index c2411fd614..79f0e640e8 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestB/src/main_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestB/src/main_ability.cpp @@ -14,7 +14,7 @@ */ #include "main_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -32,13 +32,13 @@ void MainAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("MainAbility::Init"); + HILOG_INFO("MainAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } void MainAbility::OnStart(const Want &want) { - APP_LOGI("MainAbility::onStart"); + HILOG_INFO("MainAbility::onStart"); SubscribeEvent(); Ability::OnStart(want); TestUtils::PublishEvent(g_EVENT_RESP_FIRSTB_LIFECYCLE, MainAbilityBCode, "onStart"); @@ -46,7 +46,7 @@ void MainAbility::OnStart(const Want &want) void MainAbility::OnStop() { - APP_LOGI("MainAbility::OnStop"); + HILOG_INFO("MainAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); TestUtils::PublishEvent(g_EVENT_RESP_FIRSTB_LIFECYCLE, MainAbilityBCode, "OnStop"); @@ -54,49 +54,49 @@ void MainAbility::OnStop() void MainAbility::OnActive() { - APP_LOGI("MainAbility::OnActive"); + HILOG_INFO("MainAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent(g_EVENT_RESP_FIRSTB_LIFECYCLE, MainAbilityBCode, "OnActive"); } void MainAbility::OnInactive() { - APP_LOGI("MainAbility::OnInactive"); + HILOG_INFO("MainAbility::OnInactive"); Ability::OnInactive(); TestUtils::PublishEvent(g_EVENT_RESP_FIRSTB_LIFECYCLE, MainAbilityBCode, "OnInactive"); } void MainAbility::OnBackground() { - APP_LOGI("MainAbility::OnBackground"); + HILOG_INFO("MainAbility::OnBackground"); Ability::OnBackground(); TestUtils::PublishEvent(g_EVENT_RESP_FIRSTB_LIFECYCLE, MainAbilityBCode, "OnBackground"); } void MainAbility::OnForeground(const Want &want) { - APP_LOGI("MainAbility::OnForeground"); + HILOG_INFO("MainAbility::OnForeground"); Ability::OnForeground(want); TestUtils::PublishEvent(g_EVENT_RESP_FIRSTB_LIFECYCLE, MainAbilityBCode, "OnForeground"); } void MainAbility::OnAbilityResult(int requestCode, int resultCode, const Want &resultData) { - APP_LOGI("MainAbility::OnAbilityResult"); + HILOG_INFO("MainAbility::OnAbilityResult"); Ability::OnAbilityResult(requestCode, resultCode, resultData); TestUtils::PublishEvent(g_EVENT_RESP_FIRSTB_LIFECYCLE, 0, resultData.ToUri()); } void MainAbility::OnBackPressed() { - APP_LOGI("MainAbility::OnBackPressed"); + HILOG_INFO("MainAbility::OnBackPressed"); Ability::OnBackPressed(); TestUtils::PublishEvent(g_EVENT_RESP_FIRSTB_LIFECYCLE, 0, ""); } void MainAbility::OnNewWant(const Want &want) { - APP_LOGI("MainAbility::OnNewWant"); + HILOG_INFO("MainAbility::OnNewWant"); Ability::OnNewWant(want); TestUtils::PublishEvent(g_EVENT_RESP_FIRSTB_LIFECYCLE, 0, want.ToUri()); } @@ -124,9 +124,9 @@ void MainAbility::SubscribeEvent() void FirstEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), g_EVENT_REQU_FIRSTB.c_str()) == 0) { auto target = data.GetData(); @@ -137,14 +137,14 @@ void FirstEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (mapTestFunc_.find(caseInfo[index_f]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[index_f]](std::stoi(caseInfo[index_s]), std::stoi(caseInfo[index_t]), data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } void MainAbility::TestAbility(int apiIndex, int caseIndex, int code) { - APP_LOGI("MainAbility::TestAbility"); + HILOG_INFO("MainAbility::TestAbility"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/BUILD.gn index ecd0116467..6089e09b66 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/BUILD.gn @@ -32,8 +32,8 @@ config("amsKitSystemTestDataAConfig") { "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsKitDataSystemTestA\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsKitDataSystemTestA\"", + "AMS_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_data_a1.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_data_a1.cpp index 298ad5f76c..ba23eb567c 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_data_a1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_data_a1.cpp @@ -18,7 +18,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "data_ability_helper.h" namespace OHOS { @@ -46,7 +46,7 @@ constexpr int charCnt = 5; void AmsStKitDataAbilityDataA1LifecycleCallbacks::OnAbilityStart(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA1LifecycleCallbacks OnAbilityStart"); + HILOG_INFO("AmsStKitDataAbilityDataA1LifecycleCallbacks OnAbilityStart"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnStart"); @@ -55,7 +55,7 @@ void AmsStKitDataAbilityDataA1LifecycleCallbacks::OnAbilityStart(const std::shar void AmsStKitDataAbilityDataA1LifecycleCallbacks::OnAbilityInactive(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA1LifecycleCallbacks OnAbilityInactive"); + HILOG_INFO("AmsStKitDataAbilityDataA1LifecycleCallbacks OnAbilityInactive"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnInactive"); @@ -64,7 +64,7 @@ void AmsStKitDataAbilityDataA1LifecycleCallbacks::OnAbilityInactive(const std::s void AmsStKitDataAbilityDataA1LifecycleCallbacks::OnAbilityBackground(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA1LifecycleCallbacks OnAbilityBackground"); + HILOG_INFO("AmsStKitDataAbilityDataA1LifecycleCallbacks OnAbilityBackground"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnBackground"); @@ -73,7 +73,7 @@ void AmsStKitDataAbilityDataA1LifecycleCallbacks::OnAbilityBackground(const std: void AmsStKitDataAbilityDataA1LifecycleCallbacks::OnAbilityForeground(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA1LifecycleCallbacks OnAbilityForeground"); + HILOG_INFO("AmsStKitDataAbilityDataA1LifecycleCallbacks OnAbilityForeground"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnForeground"); @@ -82,7 +82,7 @@ void AmsStKitDataAbilityDataA1LifecycleCallbacks::OnAbilityForeground(const std: void AmsStKitDataAbilityDataA1LifecycleCallbacks::OnAbilityActive(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA1LifecycleCallbacks OnAbilityActive"); + HILOG_INFO("AmsStKitDataAbilityDataA1LifecycleCallbacks OnAbilityActive"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnActive"); @@ -91,7 +91,7 @@ void AmsStKitDataAbilityDataA1LifecycleCallbacks::OnAbilityActive(const std::sha void AmsStKitDataAbilityDataA1LifecycleCallbacks::OnAbilityStop(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA1LifecycleCallbacks OnAbilityStop"); + HILOG_INFO("AmsStKitDataAbilityDataA1LifecycleCallbacks OnAbilityStop"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnStop"); @@ -100,55 +100,55 @@ void AmsStKitDataAbilityDataA1LifecycleCallbacks::OnAbilityStop(const std::share void AmsStKitDataAbilityDataA1LifecycleCallbacks::OnAbilitySaveState(const PacMap &outState) { - APP_LOGI("AmsStKitDataAbilityDataA1LifecycleCallbacks OnAbilitySaveState"); + HILOG_INFO("AmsStKitDataAbilityDataA1LifecycleCallbacks OnAbilitySaveState"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnSaveState"); } void AmsStKitDataAbilityDataA1LifecycleObserver::OnActive() { - APP_LOGI("AmsStKitDataAbilityDataA1LifecycleObserver OnActive"); + HILOG_INFO("AmsStKitDataAbilityDataA1LifecycleObserver OnActive"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnActive"); } void AmsStKitDataAbilityDataA1LifecycleObserver::OnBackground() { - APP_LOGI("AmsStKitDataAbilityDataA1LifecycleObserver OnBackground"); + HILOG_INFO("AmsStKitDataAbilityDataA1LifecycleObserver OnBackground"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnBackground"); } void AmsStKitDataAbilityDataA1LifecycleObserver::OnForeground(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA1LifecycleObserver OnForeground"); + HILOG_INFO("AmsStKitDataAbilityDataA1LifecycleObserver OnForeground"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnForeground"); } void AmsStKitDataAbilityDataA1LifecycleObserver::OnInactive() { - APP_LOGI("AmsStKitDataAbilityDataA1LifecycleObserver OnInactive"); + HILOG_INFO("AmsStKitDataAbilityDataA1LifecycleObserver OnInactive"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnInactive"); } void AmsStKitDataAbilityDataA1LifecycleObserver::OnStart(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA1LifecycleObserver OnStart"); + HILOG_INFO("AmsStKitDataAbilityDataA1LifecycleObserver OnStart"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnStart"); } void AmsStKitDataAbilityDataA1LifecycleObserver::OnStop() { - APP_LOGI("AmsStKitDataAbilityDataA1LifecycleObserver OnStop"); + HILOG_INFO("AmsStKitDataAbilityDataA1LifecycleObserver OnStop"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnStop"); } void AmsStKitDataAbilityDataA1LifecycleObserver::OnStateChanged(LifeCycle::Event event, const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA1LifecycleObserver OnStateChanged"); + HILOG_INFO("AmsStKitDataAbilityDataA1LifecycleObserver OnStateChanged"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnStateChanged"); } void AmsStKitDataAbilityDataA1LifecycleObserver::OnStateChanged(LifeCycle::Event event) { - APP_LOGI("AmsStKitDataAbilityDataA1LifecycleObserver OnStateChanged"); + HILOG_INFO("AmsStKitDataAbilityDataA1LifecycleObserver OnStateChanged"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnStateChanged"); } @@ -165,9 +165,9 @@ bool AmsStKitDataAbilityDataA1::PublishEvent(const std::string &eventName, const void KitTestDataA1EventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("KitTestDataA1EventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestDataA1EventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("KitTestDataA1EventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("KitTestDataA1EventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestDataA1EventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("KitTestDataA1EventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (eventName.compare(testEventName) == 0 && ABILITY_DATA_CODE == data.GetCode()) { std::string target = data.GetData(); @@ -179,7 +179,7 @@ void AmsStKitDataAbilityDataA1::Init(const std::shared_ptr &ability const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AmsStKitDataAbilityDataA1::Init called."); + HILOG_INFO("AmsStKitDataAbilityDataA1::Init called."); Ability::Init(abilityInfo, application, handler, token); auto callback = std::make_shared(); callback->mainAbility_ = this; @@ -216,7 +216,7 @@ void AmsStKitDataAbilityDataA1::SubscribeEvent(const Want &want) void AmsStKitDataAbilityDataA1::OnStart(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA1 OnStart"); + HILOG_INFO("AmsStKitDataAbilityDataA1 OnStart"); SubscribeEvent(want); originWant_ = want; Ability::OnStart(want); @@ -225,42 +225,42 @@ void AmsStKitDataAbilityDataA1::OnStart(const Want &want) void AmsStKitDataAbilityDataA1::OnStop() { - APP_LOGI("AmsStKitDataAbilityDataA1 OnStop"); + HILOG_INFO("AmsStKitDataAbilityDataA1 OnStop"); Ability::OnStop(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnStop"); } void AmsStKitDataAbilityDataA1::OnActive() { - APP_LOGI("AmsStKitDataAbilityDataA1 OnActive"); + HILOG_INFO("AmsStKitDataAbilityDataA1 OnActive"); Ability::OnActive(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnActive"); } void AmsStKitDataAbilityDataA1::OnInactive() { - APP_LOGI("AmsStKitDataAbilityDataA1 OnInactive"); + HILOG_INFO("AmsStKitDataAbilityDataA1 OnInactive"); Ability::OnInactive(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnInactive"); } void AmsStKitDataAbilityDataA1::OnForeground(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA1 OnForeground"); + HILOG_INFO("AmsStKitDataAbilityDataA1 OnForeground"); Ability::OnForeground(want); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnForeground"); } void AmsStKitDataAbilityDataA1::OnBackground() { - APP_LOGI("AmsStKitDataAbilityDataA1 OnBackground"); + HILOG_INFO("AmsStKitDataAbilityDataA1 OnBackground"); Ability::OnBackground(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnBackground"); } void AmsStKitDataAbilityDataA1::OnNewWant(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA1::OnNewWant"); + HILOG_INFO("AmsStKitDataAbilityDataA1::OnNewWant"); originWant_ = want; Ability::OnNewWant(want); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnNewWant"); @@ -268,14 +268,14 @@ void AmsStKitDataAbilityDataA1::OnNewWant(const Want &want) int AmsStKitDataAbilityDataA1::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) { - APP_LOGI("AmsStKitDataAbilityDataA1 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA1 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "Insert"); return DEFAULT_INSERT_RESULT; } int AmsStKitDataAbilityDataA1::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsStKitDataAbilityDataA1 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA1 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "Delete"); return DEFAULT_DELETE_RESULT; } @@ -283,7 +283,7 @@ int AmsStKitDataAbilityDataA1::Delete(const Uri &uri, const NativeRdb::DataAbili int AmsStKitDataAbilityDataA1::Update( const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsStKitDataAbilityDataA1 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA1 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "Update"); return DEFAULT_UPDATE_RESULT; } @@ -292,7 +292,7 @@ std::shared_ptr AmsStKitDataAbilityDataA1::Query( const Uri &uri, const std::vector &columns, const NativeRdb::DataAbilityPredicates &predicates) { subscriber_->vectorOperator_ = columns; - APP_LOGI("AmsStKitDataAbilityDataA1 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA1 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, OPERATOR_QUERY); STtools::WaitCompleted(event, OPERATOR_QUERY, ABILITY_DATA_CODE); @@ -308,7 +308,7 @@ std::shared_ptr AmsStKitDataAbilityDataA1::Query( std::vector AmsStKitDataAbilityDataA1::GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) { - APP_LOGI("AmsStKitDataAbilityDataA1 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA1 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "GetFileTypes"); std::vector fileType {"filetypes"}; return fileType; @@ -316,7 +316,7 @@ std::vector AmsStKitDataAbilityDataA1::GetFileTypes(const Uri &uri, int AmsStKitDataAbilityDataA1::OpenFile(const Uri &uri, const std::string &mode) { - APP_LOGI("AmsStKitDataAbilityDataA1 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA1 <<<>>>"); if (fd1 != nullptr) { fclose(fd1); fd1 = nullptr; @@ -325,14 +325,14 @@ int AmsStKitDataAbilityDataA1::OpenFile(const Uri &uri, const std::string &mode) if (fd1 == nullptr) return -1; int fd = fileno(fd1); - APP_LOGI("AmsStKitDataAbilityDataA1 fd: %{public}d", fd); + HILOG_INFO("AmsStKitDataAbilityDataA1 fd: %{public}d", fd); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OpenFile"); return fd; } void AmsStKitDataAbilityDataA1::TestLifeCycle() { - APP_LOGI("AmsStKitDataAbilityDataA1::TestLifeCycle"); + HILOG_INFO("AmsStKitDataAbilityDataA1::TestLifeCycle"); // ability_lifecycle.h auto lifecycle = Ability::GetLifecycle(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "GetLifecycle"); diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_data_a2.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_data_a2.cpp index 78538dfb51..97c5e3c74f 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_data_a2.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_data_a2.cpp @@ -18,7 +18,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "data_ability_helper.h" namespace OHOS { @@ -44,7 +44,7 @@ constexpr int charCnt = 5; void AmsStKitDataAbilityDataA2LifecycleCallbacks::OnAbilityStart(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA2LifecycleCallbacks OnAbilityStart"); + HILOG_INFO("AmsStKitDataAbilityDataA2LifecycleCallbacks OnAbilityStart"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnStart"); @@ -53,7 +53,7 @@ void AmsStKitDataAbilityDataA2LifecycleCallbacks::OnAbilityStart(const std::shar void AmsStKitDataAbilityDataA2LifecycleCallbacks::OnAbilityInactive(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA2LifecycleCallbacks OnAbilityInactive"); + HILOG_INFO("AmsStKitDataAbilityDataA2LifecycleCallbacks OnAbilityInactive"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnInactive"); @@ -62,7 +62,7 @@ void AmsStKitDataAbilityDataA2LifecycleCallbacks::OnAbilityInactive(const std::s void AmsStKitDataAbilityDataA2LifecycleCallbacks::OnAbilityBackground(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA2LifecycleCallbacks OnAbilityBackground"); + HILOG_INFO("AmsStKitDataAbilityDataA2LifecycleCallbacks OnAbilityBackground"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnBackground"); @@ -71,7 +71,7 @@ void AmsStKitDataAbilityDataA2LifecycleCallbacks::OnAbilityBackground(const std: void AmsStKitDataAbilityDataA2LifecycleCallbacks::OnAbilityForeground(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA2LifecycleCallbacks OnAbilityForeground"); + HILOG_INFO("AmsStKitDataAbilityDataA2LifecycleCallbacks OnAbilityForeground"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnForeground"); @@ -80,7 +80,7 @@ void AmsStKitDataAbilityDataA2LifecycleCallbacks::OnAbilityForeground(const std: void AmsStKitDataAbilityDataA2LifecycleCallbacks::OnAbilityActive(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA2LifecycleCallbacks OnAbilityActive"); + HILOG_INFO("AmsStKitDataAbilityDataA2LifecycleCallbacks OnAbilityActive"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnActive"); @@ -89,7 +89,7 @@ void AmsStKitDataAbilityDataA2LifecycleCallbacks::OnAbilityActive(const std::sha void AmsStKitDataAbilityDataA2LifecycleCallbacks::OnAbilityStop(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA2LifecycleCallbacks OnAbilityStop"); + HILOG_INFO("AmsStKitDataAbilityDataA2LifecycleCallbacks OnAbilityStop"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnStop"); @@ -98,55 +98,55 @@ void AmsStKitDataAbilityDataA2LifecycleCallbacks::OnAbilityStop(const std::share void AmsStKitDataAbilityDataA2LifecycleCallbacks::OnAbilitySaveState(const PacMap &outState) { - APP_LOGI("AmsStKitDataAbilityDataA2LifecycleCallbacks OnAbilitySaveState"); + HILOG_INFO("AmsStKitDataAbilityDataA2LifecycleCallbacks OnAbilitySaveState"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnSaveState"); } void AmsStKitDataAbilityDataA2LifecycleObserver::OnActive() { - APP_LOGI("AmsStKitDataAbilityDataA2LifecycleObserver OnActive"); + HILOG_INFO("AmsStKitDataAbilityDataA2LifecycleObserver OnActive"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnActive"); } void AmsStKitDataAbilityDataA2LifecycleObserver::OnBackground() { - APP_LOGI("AmsStKitDataAbilityDataA2LifecycleObserver OnBackground"); + HILOG_INFO("AmsStKitDataAbilityDataA2LifecycleObserver OnBackground"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnBackground"); } void AmsStKitDataAbilityDataA2LifecycleObserver::OnForeground(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA2LifecycleObserver OnForeground"); + HILOG_INFO("AmsStKitDataAbilityDataA2LifecycleObserver OnForeground"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnForeground"); } void AmsStKitDataAbilityDataA2LifecycleObserver::OnInactive() { - APP_LOGI("AmsStKitDataAbilityDataA2LifecycleObserver OnInactive"); + HILOG_INFO("AmsStKitDataAbilityDataA2LifecycleObserver OnInactive"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnInactive"); } void AmsStKitDataAbilityDataA2LifecycleObserver::OnStart(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA2LifecycleObserver OnStart"); + HILOG_INFO("AmsStKitDataAbilityDataA2LifecycleObserver OnStart"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnStart"); } void AmsStKitDataAbilityDataA2LifecycleObserver::OnStop() { - APP_LOGI("AmsStKitDataAbilityDataA2LifecycleObserver OnStop"); + HILOG_INFO("AmsStKitDataAbilityDataA2LifecycleObserver OnStop"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnStop"); } void AmsStKitDataAbilityDataA2LifecycleObserver::OnStateChanged(LifeCycle::Event event, const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA2LifecycleObserver OnStateChanged"); + HILOG_INFO("AmsStKitDataAbilityDataA2LifecycleObserver OnStateChanged"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnStateChanged"); } void AmsStKitDataAbilityDataA2LifecycleObserver::OnStateChanged(LifeCycle::Event event) { - APP_LOGI("AmsStKitDataAbilityDataA2LifecycleObserver OnStateChanged"); + HILOG_INFO("AmsStKitDataAbilityDataA2LifecycleObserver OnStateChanged"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnStateChanged"); } @@ -163,9 +163,9 @@ bool AmsStKitDataAbilityDataA2::PublishEvent(const std::string &eventName, const void KitTestDataA2EventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("KitTestDataA2EventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestDataA2EventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("KitTestDataA2EventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("KitTestDataA2EventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestDataA2EventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("KitTestDataA2EventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (eventName.compare(testEventName) == 0 && ABILITY_DATA_CODE == data.GetCode()) { std::string target = data.GetData(); @@ -177,7 +177,7 @@ void AmsStKitDataAbilityDataA2::Init(const std::shared_ptr &ability const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AmsStKitDataAbilityDataA2::Init called."); + HILOG_INFO("AmsStKitDataAbilityDataA2::Init called."); Ability::Init(abilityInfo, application, handler, token); auto callback = std::make_shared(); callback->mainAbility_ = this; @@ -213,7 +213,7 @@ void AmsStKitDataAbilityDataA2::SubscribeEvent(const Want &want) void AmsStKitDataAbilityDataA2::OnStart(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA2 OnStart"); + HILOG_INFO("AmsStKitDataAbilityDataA2 OnStart"); SubscribeEvent(want); originWant_ = want; Ability::OnStart(want); @@ -222,42 +222,42 @@ void AmsStKitDataAbilityDataA2::OnStart(const Want &want) void AmsStKitDataAbilityDataA2::OnStop() { - APP_LOGI("AmsStKitDataAbilityDataA2 OnStop"); + HILOG_INFO("AmsStKitDataAbilityDataA2 OnStop"); Ability::OnStop(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnStop"); } void AmsStKitDataAbilityDataA2::OnActive() { - APP_LOGI("AmsStKitDataAbilityDataA2 OnActive"); + HILOG_INFO("AmsStKitDataAbilityDataA2 OnActive"); Ability::OnActive(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnActive"); } void AmsStKitDataAbilityDataA2::OnInactive() { - APP_LOGI("AmsStKitDataAbilityDataA2 OnInactive"); + HILOG_INFO("AmsStKitDataAbilityDataA2 OnInactive"); Ability::OnInactive(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnInactive"); } void AmsStKitDataAbilityDataA2::OnForeground(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA2 OnForeground"); + HILOG_INFO("AmsStKitDataAbilityDataA2 OnForeground"); Ability::OnForeground(want); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnForeground"); } void AmsStKitDataAbilityDataA2::OnBackground() { - APP_LOGI("AmsStKitDataAbilityDataA2 OnBackground"); + HILOG_INFO("AmsStKitDataAbilityDataA2 OnBackground"); Ability::OnBackground(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnBackground"); } void AmsStKitDataAbilityDataA2::OnNewWant(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA2::OnNewWant"); + HILOG_INFO("AmsStKitDataAbilityDataA2::OnNewWant"); originWant_ = want; Ability::OnNewWant(want); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnNewWant"); @@ -265,14 +265,14 @@ void AmsStKitDataAbilityDataA2::OnNewWant(const Want &want) int AmsStKitDataAbilityDataA2::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) { - APP_LOGI("AmsStKitDataAbilityDataA2 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA2 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "Insert"); return DEFAULT_INSERT_RESULT; } int AmsStKitDataAbilityDataA2::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsStKitDataAbilityDataA2 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA2 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "Delete"); return DEFAULT_DELETE_RESULT; } @@ -280,7 +280,7 @@ int AmsStKitDataAbilityDataA2::Delete(const Uri &uri, const NativeRdb::DataAbili int AmsStKitDataAbilityDataA2::Update( const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsStKitDataAbilityDataA2 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA2 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "Update"); return DEFAULT_UPDATE_RESULT; } @@ -289,7 +289,7 @@ std::shared_ptr AmsStKitDataAbilityDataA2::Query( const Uri &uri, const std::vector &columns, const NativeRdb::DataAbilityPredicates &predicates) { subscriber_->vectorOperator_ = columns; - APP_LOGI("AmsStKitDataAbilityDataA2 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA2 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, OPERATOR_QUERY); STtools::WaitCompleted(event, OPERATOR_QUERY, ABILITY_DATA_CODE); @@ -305,7 +305,7 @@ std::shared_ptr AmsStKitDataAbilityDataA2::Query( std::vector AmsStKitDataAbilityDataA2::GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) { - APP_LOGI("AmsStKitDataAbilityDataA2 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA2 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "GetFileTypes"); std::vector fileType {"filetypes"}; return fileType; @@ -313,7 +313,7 @@ std::vector AmsStKitDataAbilityDataA2::GetFileTypes(const Uri &uri, int AmsStKitDataAbilityDataA2::OpenFile(const Uri &uri, const std::string &mode) { - APP_LOGI("AmsStKitDataAbilityDataA2 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA2 <<<>>>"); if (fd1 != nullptr) { fclose(fd1); fd1 = nullptr; @@ -322,7 +322,7 @@ int AmsStKitDataAbilityDataA2::OpenFile(const Uri &uri, const std::string &mode) if (fd1 == nullptr) return -1; int fd = fileno(fd1); - APP_LOGI("AmsStKitDataAbilityDataA2 fd: %{public}d", fd); + HILOG_INFO("AmsStKitDataAbilityDataA2 fd: %{public}d", fd); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OpenFile"); return fd; @@ -330,7 +330,7 @@ int AmsStKitDataAbilityDataA2::OpenFile(const Uri &uri, const std::string &mode) void AmsStKitDataAbilityDataA2::TestLifeCycle() { - APP_LOGI("AmsStKitDataAbilityDataA2::TestLifeCycle"); + HILOG_INFO("AmsStKitDataAbilityDataA2::TestLifeCycle"); // ability_lifecycle.h auto lifecycle = Ability::GetLifecycle(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "GetLifecycle"); diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_data_a3.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_data_a3.cpp index 737e21bb36..a120966097 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_data_a3.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_data_a3.cpp @@ -18,7 +18,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "data_ability_helper.h" namespace OHOS { @@ -44,7 +44,7 @@ constexpr int charCnt = 5; void AmsStKitDataAbilityDataA3LifecycleCallbacks::OnAbilityStart(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA3LifecycleCallbacks OnAbilityStart"); + HILOG_INFO("AmsStKitDataAbilityDataA3LifecycleCallbacks OnAbilityStart"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnStart"); @@ -53,7 +53,7 @@ void AmsStKitDataAbilityDataA3LifecycleCallbacks::OnAbilityStart(const std::shar void AmsStKitDataAbilityDataA3LifecycleCallbacks::OnAbilityInactive(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA3LifecycleCallbacks OnAbilityInactive"); + HILOG_INFO("AmsStKitDataAbilityDataA3LifecycleCallbacks OnAbilityInactive"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnInactive"); @@ -62,7 +62,7 @@ void AmsStKitDataAbilityDataA3LifecycleCallbacks::OnAbilityInactive(const std::s void AmsStKitDataAbilityDataA3LifecycleCallbacks::OnAbilityBackground(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA3LifecycleCallbacks OnAbilityBackground"); + HILOG_INFO("AmsStKitDataAbilityDataA3LifecycleCallbacks OnAbilityBackground"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnBackground"); @@ -71,7 +71,7 @@ void AmsStKitDataAbilityDataA3LifecycleCallbacks::OnAbilityBackground(const std: void AmsStKitDataAbilityDataA3LifecycleCallbacks::OnAbilityForeground(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA3LifecycleCallbacks OnAbilityForeground"); + HILOG_INFO("AmsStKitDataAbilityDataA3LifecycleCallbacks OnAbilityForeground"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnForeground"); @@ -80,7 +80,7 @@ void AmsStKitDataAbilityDataA3LifecycleCallbacks::OnAbilityForeground(const std: void AmsStKitDataAbilityDataA3LifecycleCallbacks::OnAbilityActive(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA3LifecycleCallbacks OnAbilityActive"); + HILOG_INFO("AmsStKitDataAbilityDataA3LifecycleCallbacks OnAbilityActive"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnActive"); @@ -89,7 +89,7 @@ void AmsStKitDataAbilityDataA3LifecycleCallbacks::OnAbilityActive(const std::sha void AmsStKitDataAbilityDataA3LifecycleCallbacks::OnAbilityStop(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA3LifecycleCallbacks OnAbilityStop"); + HILOG_INFO("AmsStKitDataAbilityDataA3LifecycleCallbacks OnAbilityStop"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnStop"); @@ -98,55 +98,55 @@ void AmsStKitDataAbilityDataA3LifecycleCallbacks::OnAbilityStop(const std::share void AmsStKitDataAbilityDataA3LifecycleCallbacks::OnAbilitySaveState(const PacMap &outState) { - APP_LOGI("AmsStKitDataAbilityDataA3LifecycleCallbacks OnAbilitySaveState"); + HILOG_INFO("AmsStKitDataAbilityDataA3LifecycleCallbacks OnAbilitySaveState"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnSaveState"); } void AmsStKitDataAbilityDataA3LifecycleObserver::OnActive() { - APP_LOGI("AmsStKitDataAbilityDataA3LifecycleObserver OnActive"); + HILOG_INFO("AmsStKitDataAbilityDataA3LifecycleObserver OnActive"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnActive"); } void AmsStKitDataAbilityDataA3LifecycleObserver::OnBackground() { - APP_LOGI("AmsStKitDataAbilityDataA3LifecycleObserver OnBackground"); + HILOG_INFO("AmsStKitDataAbilityDataA3LifecycleObserver OnBackground"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnBackground"); } void AmsStKitDataAbilityDataA3LifecycleObserver::OnForeground(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA3LifecycleObserver OnForeground"); + HILOG_INFO("AmsStKitDataAbilityDataA3LifecycleObserver OnForeground"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnForeground"); } void AmsStKitDataAbilityDataA3LifecycleObserver::OnInactive() { - APP_LOGI("AmsStKitDataAbilityDataA3LifecycleObserver OnInactive"); + HILOG_INFO("AmsStKitDataAbilityDataA3LifecycleObserver OnInactive"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnInactive"); } void AmsStKitDataAbilityDataA3LifecycleObserver::OnStart(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA3LifecycleObserver OnStart"); + HILOG_INFO("AmsStKitDataAbilityDataA3LifecycleObserver OnStart"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnStart"); } void AmsStKitDataAbilityDataA3LifecycleObserver::OnStop() { - APP_LOGI("AmsStKitDataAbilityDataA3LifecycleObserver OnStop"); + HILOG_INFO("AmsStKitDataAbilityDataA3LifecycleObserver OnStop"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnStop"); } void AmsStKitDataAbilityDataA3LifecycleObserver::OnStateChanged(LifeCycle::Event event, const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA3LifecycleObserver OnStateChanged"); + HILOG_INFO("AmsStKitDataAbilityDataA3LifecycleObserver OnStateChanged"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnStateChanged"); } void AmsStKitDataAbilityDataA3LifecycleObserver::OnStateChanged(LifeCycle::Event event) { - APP_LOGI("AmsStKitDataAbilityDataA3LifecycleObserver OnStateChanged"); + HILOG_INFO("AmsStKitDataAbilityDataA3LifecycleObserver OnStateChanged"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnStateChanged"); } @@ -163,9 +163,9 @@ bool AmsStKitDataAbilityDataA3::PublishEvent(const std::string &eventName, const void KitTestDataA3EventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("KitTestDataA3EventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestDataA3EventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("KitTestDataA3EventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("KitTestDataA3EventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestDataA3EventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("KitTestDataA3EventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (eventName.compare(testEventName) == 0 && ABILITY_DATA_CODE == data.GetCode()) { std::string target = data.GetData(); @@ -177,7 +177,7 @@ void AmsStKitDataAbilityDataA3::Init(const std::shared_ptr &ability const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AmsStKitDataAbilityDataA3::Init called."); + HILOG_INFO("AmsStKitDataAbilityDataA3::Init called."); Ability::Init(abilityInfo, application, handler, token); auto callback = std::make_shared(); callback->mainAbility_ = this; @@ -216,7 +216,7 @@ void AmsStKitDataAbilityDataA3::SubscribeEvent(const Want &want) void AmsStKitDataAbilityDataA3::OnStart(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA3 OnStart"); + HILOG_INFO("AmsStKitDataAbilityDataA3 OnStart"); SubscribeEvent(want); originWant_ = want; Ability::OnStart(want); @@ -225,42 +225,42 @@ void AmsStKitDataAbilityDataA3::OnStart(const Want &want) void AmsStKitDataAbilityDataA3::OnStop() { - APP_LOGI("AmsStKitDataAbilityDataA3 OnStop"); + HILOG_INFO("AmsStKitDataAbilityDataA3 OnStop"); Ability::OnStop(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnStop"); } void AmsStKitDataAbilityDataA3::OnActive() { - APP_LOGI("AmsStKitDataAbilityDataA3 OnActive"); + HILOG_INFO("AmsStKitDataAbilityDataA3 OnActive"); Ability::OnActive(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnActive"); } void AmsStKitDataAbilityDataA3::OnInactive() { - APP_LOGI("AmsStKitDataAbilityDataA3 OnInactive"); + HILOG_INFO("AmsStKitDataAbilityDataA3 OnInactive"); Ability::OnInactive(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnInactive"); } void AmsStKitDataAbilityDataA3::OnForeground(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA3 OnForeground"); + HILOG_INFO("AmsStKitDataAbilityDataA3 OnForeground"); Ability::OnForeground(want); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnForeground"); } void AmsStKitDataAbilityDataA3::OnBackground() { - APP_LOGI("AmsStKitDataAbilityDataA3 OnBackground"); + HILOG_INFO("AmsStKitDataAbilityDataA3 OnBackground"); Ability::OnBackground(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnBackground"); } void AmsStKitDataAbilityDataA3::OnNewWant(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataA3::OnNewWant"); + HILOG_INFO("AmsStKitDataAbilityDataA3::OnNewWant"); originWant_ = want; Ability::OnNewWant(want); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnNewWant"); @@ -268,14 +268,14 @@ void AmsStKitDataAbilityDataA3::OnNewWant(const Want &want) int AmsStKitDataAbilityDataA3::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) { - APP_LOGI("AmsStKitDataAbilityDataA3 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA3 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "Insert"); return DEFAULT_INSERT_RESULT; } int AmsStKitDataAbilityDataA3::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsStKitDataAbilityDataA3 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA3 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "Delete"); return DEFAULT_DELETE_RESULT; } @@ -283,7 +283,7 @@ int AmsStKitDataAbilityDataA3::Delete(const Uri &uri, const NativeRdb::DataAbili int AmsStKitDataAbilityDataA3::Update( const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsStKitDataAbilityDataA3 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA3 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "Update"); return DEFAULT_UPDATE_RESULT; } @@ -292,7 +292,7 @@ std::shared_ptr AmsStKitDataAbilityDataA3::Query( const Uri &uri, const std::vector &columns, const NativeRdb::DataAbilityPredicates &predicates) { subscriber_->vectorOperator_ = columns; - APP_LOGI("AmsStKitDataAbilityDataA3 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA3 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, OPERATOR_QUERY); STtools::WaitCompleted(event, OPERATOR_QUERY, ABILITY_DATA_CODE); @@ -308,7 +308,7 @@ std::shared_ptr AmsStKitDataAbilityDataA3::Query( std::vector AmsStKitDataAbilityDataA3::GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) { - APP_LOGI("AmsStKitDataAbilityDataA3 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA3 <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "GetFileTypes"); std::vector fileType {"filetypes"}; return fileType; @@ -316,7 +316,7 @@ std::vector AmsStKitDataAbilityDataA3::GetFileTypes(const Uri &uri, int AmsStKitDataAbilityDataA3::OpenFile(const Uri &uri, const std::string &mode) { - APP_LOGI("AmsStKitDataAbilityDataA3 <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataA3 <<<>>>"); if (fd1 != nullptr) { fclose(fd1); fd1 = nullptr; @@ -325,7 +325,7 @@ int AmsStKitDataAbilityDataA3::OpenFile(const Uri &uri, const std::string &mode) if (fd1 == nullptr) return -1; int fd = fileno(fd1); - APP_LOGI("AmsStKitDataAbilityDataA3 fd: %{public}d", fd); + HILOG_INFO("AmsStKitDataAbilityDataA3 fd: %{public}d", fd); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OpenFile"); return fd; @@ -333,7 +333,7 @@ int AmsStKitDataAbilityDataA3::OpenFile(const Uri &uri, const std::string &mode) void AmsStKitDataAbilityDataA3::TestLifeCycle() { - APP_LOGI("AmsStKitDataAbilityDataA3::TestLifeCycle"); + HILOG_INFO("AmsStKitDataAbilityDataA3::TestLifeCycle"); // ability_lifecycle.h auto lifecycle = Ability::GetLifecycle(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "GetLifecycle"); diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_page_a.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_page_a.cpp index f9f65930b9..7d31942912 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_page_a.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_page_a.cpp @@ -19,7 +19,7 @@ #include #include "abs_shared_result_set.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "data_ability_helper.h" #include "data_ability_predicates.h" #include "values_bucket.h" @@ -51,9 +51,9 @@ bool AmsStKitDataAbilityPageA::PublishEvent(const std::string &eventName, const void KitTestPageAEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("KitTestPageAEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestPageAEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("KitTestPageAEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("KitTestPageAEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestPageAEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("KitTestPageAEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (eventName.compare("event_data_test_action") == 0 && ABILITY_PAGE_CODE == data.GetCode()) { auto target = data.GetData(); @@ -61,7 +61,7 @@ void KitTestPageAEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (func != mapTestFunc_.end()) { func->second(); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } @@ -91,7 +91,7 @@ void AmsStKitDataAbilityPageA::SubscribeEvent(const Want &want) void AmsStKitDataAbilityPageA::OnStart(const Want &want) { - APP_LOGI("AmsStKitDataAbilityPageA::onStart"); + HILOG_INFO("AmsStKitDataAbilityPageA::onStart"); originWant_ = want; SubscribeEvent(want); Ability::OnStart(want); @@ -100,35 +100,35 @@ void AmsStKitDataAbilityPageA::OnStart(const Want &want) void AmsStKitDataAbilityPageA::OnNewWant(const Want &want) { - APP_LOGI("AmsStKitDataAbilityPageA::OnNewWant"); + HILOG_INFO("AmsStKitDataAbilityPageA::OnNewWant"); originWant_ = want; Ability::OnNewWant(want); } void AmsStKitDataAbilityPageA::OnStop() { - APP_LOGI("AmsStKitDataAbilityPageA::onStop"); + HILOG_INFO("AmsStKitDataAbilityPageA::onStop"); Ability::OnStop(); PublishEvent(abilityEventName, ABILITY_PAGE_CODE, "OnStop"); } void AmsStKitDataAbilityPageA::OnActive() { - APP_LOGI("AmsStKitDataAbilityPageA::OnActive"); + HILOG_INFO("AmsStKitDataAbilityPageA::OnActive"); Ability::OnActive(); PublishEvent(abilityEventName, ABILITY_PAGE_CODE, "OnActive"); } void AmsStKitDataAbilityPageA::OnInactive() { - APP_LOGI("AmsStKitDataAbilityPageA::OnInactive"); + HILOG_INFO("AmsStKitDataAbilityPageA::OnInactive"); Ability::OnInactive(); PublishEvent(abilityEventName, ABILITY_PAGE_CODE, "OnInactive"); } void AmsStKitDataAbilityPageA::OnBackground() { - APP_LOGI("AmsStKitDataAbilityPageA::OnBackground"); + HILOG_INFO("AmsStKitDataAbilityPageA::OnBackground"); Ability::OnBackground(); PublishEvent(abilityEventName, ABILITY_PAGE_CODE, "OnBackground"); } @@ -141,11 +141,11 @@ void AmsStKitDataAbilityPageA::GetWantInfo(const Want &want) STtools::DeserializationStOperatorFromVector(allOperator, vectorOperator); for (auto child : allOperator.GetChildOperator()) { - APP_LOGI("-----------------targetBundle:%{public}s", child->GetBundleName().c_str()); - APP_LOGI("-----------------targetAbility:%{public}s", child->GetAbilityName().c_str()); - APP_LOGI("-----------------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); - APP_LOGI("-----------------operatorName:%{public}s", child->GetOperatorName().c_str()); - APP_LOGI("-----------------childOperatorNum:%{public}zu", child->GetChildOperator().size()); + HILOG_INFO("-----------------targetBundle:%{public}s", child->GetBundleName().c_str()); + HILOG_INFO("-----------------targetAbility:%{public}s", child->GetAbilityName().c_str()); + HILOG_INFO("-----------------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); + HILOG_INFO("-----------------operatorName:%{public}s", child->GetOperatorName().c_str()); + HILOG_INFO("-----------------childOperatorNum:%{public}zu", child->GetChildOperator().size()); } } @@ -196,31 +196,31 @@ static void GetResult(std::shared_ptr child, std::shared_pt void KitTestPageAEventSubscriber::TestPost(const std::string funName) { - APP_LOGI("KitTestPageAEventSubscriber::TestPost %{public}s", funName.c_str()); + HILOG_INFO("KitTestPageAEventSubscriber::TestPost %{public}s", funName.c_str()); STtools::StOperator allOperator {}; STtools::DeserializationStOperatorFromVector(allOperator, vectorOperator_); for (auto child : allOperator.GetChildOperator()) { - APP_LOGI("-----------------targetBundle:%{public}s", child->GetBundleName().c_str()); - APP_LOGI("-----------------targetAbility:%{public}s", child->GetAbilityName().c_str()); - APP_LOGI("-----------------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); - APP_LOGI("-----------------operatorName:%{public}s", child->GetOperatorName().c_str()); - APP_LOGI("-----------------childOperatorNum:%{public}zu", child->GetChildOperator().size()); + HILOG_INFO("-----------------targetBundle:%{public}s", child->GetBundleName().c_str()); + HILOG_INFO("-----------------targetAbility:%{public}s", child->GetAbilityName().c_str()); + HILOG_INFO("-----------------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); + HILOG_INFO("-----------------operatorName:%{public}s", child->GetOperatorName().c_str()); + HILOG_INFO("-----------------childOperatorNum:%{public}zu", child->GetChildOperator().size()); } std::shared_ptr helper = DataAbilityHelper::Creator(mainAbility_->GetContext()); for (auto child : allOperator.GetChildOperator()) { /// data ability if (child->GetAbilityType() == "2") { - APP_LOGI("---------------------targetAbility_--------------------"); + HILOG_INFO("---------------------targetAbility_--------------------"); Uri dataAbilityUri("dataability:///" + child->GetBundleName() + "." + child->GetAbilityName()); std::string result; if (helper != nullptr) { - APP_LOGI("---------------------helper--------------------"); + HILOG_INFO("---------------------helper--------------------"); GetResult(child, helper, *mainAbility_, dataAbilityUri, result); } mainAbility_->PublishEvent(abilityEventName, ABILITY_PAGE_CODE, child->GetOperatorName() + " " + result); } else if (child->GetAbilityType() == "0") { - APP_LOGI("---------------------StartPageAbility--------------------"); + HILOG_INFO("---------------------StartPageAbility--------------------"); std::vector vectoroperator; if (child->GetChildOperator().size() != 0) { vectoroperator = STtools::SerializationStOperatorToVector(*child); diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_service_a.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_service_a.cpp index 864903fef3..a51b8c559d 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_service_a.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataA/src/ams_st_kit_data_ability_service_a.cpp @@ -18,7 +18,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "data_ability_helper.h" #include "abs_shared_result_set.h" #include "data_ability_predicates.h" @@ -51,9 +51,9 @@ bool AmsStKitDataAbilityServiceA::PublishEvent(const std::string &eventName, con void KitTestServiceAEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("KitTestServiceAEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestServiceAEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("KitTestServiceAEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("KitTestServiceAEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestServiceAEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("KitTestServiceAEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (eventName.compare("event_data_test_action") == 0 && ABILITY_SERVICE_CODE == data.GetCode()) { auto target = data.GetData(); @@ -61,7 +61,7 @@ void KitTestServiceAEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (func != mapTestFunc_.end()) { func->second(); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } @@ -92,7 +92,7 @@ void AmsStKitDataAbilityServiceA::SubscribeEvent(const Want &want) void AmsStKitDataAbilityServiceA::OnStart(const Want &want) { - APP_LOGI("AmsStKitDataAbilityServiceA::onStart"); + HILOG_INFO("AmsStKitDataAbilityServiceA::onStart"); originWant_ = want; SubscribeEvent(want); Ability::OnStart(want); @@ -101,42 +101,42 @@ void AmsStKitDataAbilityServiceA::OnStart(const Want &want) void AmsStKitDataAbilityServiceA::OnNewWant(const Want &want) { - APP_LOGI("AmsStKitDataAbilityServiceA::OnNewWant"); + HILOG_INFO("AmsStKitDataAbilityServiceA::OnNewWant"); originWant_ = want; Ability::OnNewWant(want); } void AmsStKitDataAbilityServiceA::OnStop() { - APP_LOGI("AmsStKitDataAbilityServiceA::onStop"); + HILOG_INFO("AmsStKitDataAbilityServiceA::onStop"); Ability::OnStop(); PublishEvent(abilityEventName, ABILITY_SERVICE_CODE, "OnStop"); } void AmsStKitDataAbilityServiceA::OnActive() { - APP_LOGI("AmsStKitDataAbilityServiceA::OnActive"); + HILOG_INFO("AmsStKitDataAbilityServiceA::OnActive"); Ability::OnActive(); PublishEvent(abilityEventName, ABILITY_SERVICE_CODE, "OnActive"); } void AmsStKitDataAbilityServiceA::OnInactive() { - APP_LOGI("AmsStKitDataAbilityServiceA::OnInactive"); + HILOG_INFO("AmsStKitDataAbilityServiceA::OnInactive"); Ability::OnInactive(); PublishEvent(abilityEventName, ABILITY_SERVICE_CODE, "OnInactive"); } void AmsStKitDataAbilityServiceA::OnBackground() { - APP_LOGI("AmsStKitDataAbilityServiceA::OnBackground"); + HILOG_INFO("AmsStKitDataAbilityServiceA::OnBackground"); Ability::OnBackground(); PublishEvent(abilityEventName, ABILITY_SERVICE_CODE, "OnBackground"); } void AmsStKitDataAbilityServiceA::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("AmsStServiceAbilityA1::OnCommand"); + HILOG_INFO("AmsStServiceAbilityA1::OnCommand"); GetWantInfo(want); Ability::OnCommand(want, restart, startId); @@ -145,7 +145,7 @@ void AmsStKitDataAbilityServiceA::OnCommand(const AAFwk::Want &want, bool restar sptr AmsStKitDataAbilityServiceA::OnConnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityA1::OnConnect"); + HILOG_INFO("AmsStServiceAbilityA1::OnConnect"); sptr ret = Ability::OnConnect(want); PublishEvent(abilityEventName, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnConnect"); @@ -153,7 +153,7 @@ sptr AmsStKitDataAbilityServiceA::OnConnect(const Want &want) } void AmsStKitDataAbilityServiceA::OnDisconnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityA1::OnDisconnect"); + HILOG_INFO("AmsStServiceAbilityA1::OnDisconnect"); Ability::OnDisconnect(want); PublishEvent(abilityEventName, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnDisconnect"); @@ -167,11 +167,11 @@ void AmsStKitDataAbilityServiceA::GetWantInfo(const Want &want) STtools::DeserializationStOperatorFromVector(allOperator, vectorOperator); for (auto child : allOperator.GetChildOperator()) { - APP_LOGI("-----------------targetBundle:%{public}s", child->GetBundleName().c_str()); - APP_LOGI("-----------------targetAbility:%{public}s", child->GetAbilityName().c_str()); - APP_LOGI("-----------------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); - APP_LOGI("-----------------operatorName:%{public}s", child->GetOperatorName().c_str()); - APP_LOGI("-----------------childOperatorNum:%{public}zu", child->GetChildOperator().size()); + HILOG_INFO("-----------------targetBundle:%{public}s", child->GetBundleName().c_str()); + HILOG_INFO("-----------------targetAbility:%{public}s", child->GetAbilityName().c_str()); + HILOG_INFO("-----------------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); + HILOG_INFO("-----------------operatorName:%{public}s", child->GetOperatorName().c_str()); + HILOG_INFO("-----------------childOperatorNum:%{public}zu", child->GetChildOperator().size()); } } @@ -222,23 +222,23 @@ static void GetResult(std::shared_ptr child, std::shared_pt void KitTestServiceAEventSubscriber::TestPost(const std::string funName) { - APP_LOGI("KitTestServiceAEventSubscriber::TestPost %{public}s", funName.c_str()); + HILOG_INFO("KitTestServiceAEventSubscriber::TestPost %{public}s", funName.c_str()); STtools::StOperator allOperator {}; STtools::DeserializationStOperatorFromVector(allOperator, vectorOperator_); std::shared_ptr helper = DataAbilityHelper::Creator(mainAbility_->GetContext()); for (auto child : allOperator.GetChildOperator()) { /// data ability if (child->GetAbilityType() == "2") { - APP_LOGI("---------------------targetAbility_--------------------"); + HILOG_INFO("---------------------targetAbility_--------------------"); Uri dataAbilityUri("dataability:///" + child->GetBundleName() + "." + child->GetAbilityName()); std::string result; if (helper != nullptr) { - APP_LOGI("---------------------helper--------------------"); + HILOG_INFO("---------------------helper--------------------"); GetResult(child, helper, *mainAbility_, dataAbilityUri, result); } mainAbility_->PublishEvent(abilityEventName, ABILITY_SERVICE_CODE, child->GetOperatorName() + " " + result); } else if (child->GetAbilityType() == "0") { - APP_LOGI("---------------------StartPageAbility--------------------"); + HILOG_INFO("---------------------StartPageAbility--------------------"); std::vector vectoroperator; if (child->GetChildOperator().size() != 0) { vectoroperator = STtools::SerializationStOperatorToVector(*child); diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataB/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataB/BUILD.gn index 024fa0374f..fa37fc68bd 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataB/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataB/BUILD.gn @@ -32,8 +32,8 @@ config("amsKitSystemTestDataBConfig") { "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsKitDataSystemTestB\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsKitDataSystemTestB\"", + "AMS_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataB/src/ams_st_kit_data_ability_data_b.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataB/src/ams_st_kit_data_ability_data_b.cpp index af63a275ec..f929eaf37c 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataB/src/ams_st_kit_data_ability_data_b.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataB/src/ams_st_kit_data_ability_data_b.cpp @@ -18,7 +18,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "data_ability_helper.h" namespace OHOS { @@ -44,7 +44,7 @@ constexpr int charCnt = 5; void AmsStKitDataAbilityDataBLifecycleCallbacks::OnAbilityStart(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataBLifecycleCallbacks OnAbilityStart"); + HILOG_INFO("AmsStKitDataAbilityDataBLifecycleCallbacks OnAbilityStart"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnStart"); @@ -53,7 +53,7 @@ void AmsStKitDataAbilityDataBLifecycleCallbacks::OnAbilityStart(const std::share void AmsStKitDataAbilityDataBLifecycleCallbacks::OnAbilityInactive(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataBLifecycleCallbacks OnAbilityInactive"); + HILOG_INFO("AmsStKitDataAbilityDataBLifecycleCallbacks OnAbilityInactive"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnInactive"); @@ -62,7 +62,7 @@ void AmsStKitDataAbilityDataBLifecycleCallbacks::OnAbilityInactive(const std::sh void AmsStKitDataAbilityDataBLifecycleCallbacks::OnAbilityBackground(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataBLifecycleCallbacks OnAbilityBackground"); + HILOG_INFO("AmsStKitDataAbilityDataBLifecycleCallbacks OnAbilityBackground"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnBackground"); @@ -71,7 +71,7 @@ void AmsStKitDataAbilityDataBLifecycleCallbacks::OnAbilityBackground(const std:: void AmsStKitDataAbilityDataBLifecycleCallbacks::OnAbilityForeground(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataA1LifecycleCallbacks OnAbilityForeground"); + HILOG_INFO("AmsStKitDataAbilityDataA1LifecycleCallbacks OnAbilityForeground"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnForeground"); @@ -80,7 +80,7 @@ void AmsStKitDataAbilityDataBLifecycleCallbacks::OnAbilityForeground(const std:: void AmsStKitDataAbilityDataBLifecycleCallbacks::OnAbilityActive(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataBLifecycleCallbacks OnAbilityActive"); + HILOG_INFO("AmsStKitDataAbilityDataBLifecycleCallbacks OnAbilityActive"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnActive"); @@ -89,7 +89,7 @@ void AmsStKitDataAbilityDataBLifecycleCallbacks::OnAbilityActive(const std::shar void AmsStKitDataAbilityDataBLifecycleCallbacks::OnAbilityStop(const std::shared_ptr &ability) { - APP_LOGI("AmsStKitDataAbilityDataBLifecycleCallbacks OnAbilityStop"); + HILOG_INFO("AmsStKitDataAbilityDataBLifecycleCallbacks OnAbilityStop"); std::string abilityName = ability->GetAbilityName(); if (abilityName == mainAbility_->GetAbilityName()) { mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnStop"); @@ -98,55 +98,55 @@ void AmsStKitDataAbilityDataBLifecycleCallbacks::OnAbilityStop(const std::shared void AmsStKitDataAbilityDataBLifecycleCallbacks::OnAbilitySaveState(const PacMap &outState) { - APP_LOGI("AmsStKitDataAbilityDataBLifecycleCallbacks OnAbilitySaveState"); + HILOG_INFO("AmsStKitDataAbilityDataBLifecycleCallbacks OnAbilitySaveState"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_CALLBACKS, "OnSaveState"); } void AmsStKitDataAbilityDataBLifecycleObserver::OnActive() { - APP_LOGI("AmsStKitDataAbilityDataBLifecycleObserver OnActive"); + HILOG_INFO("AmsStKitDataAbilityDataBLifecycleObserver OnActive"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnActive"); } void AmsStKitDataAbilityDataBLifecycleObserver::OnBackground() { - APP_LOGI("AmsStKitDataAbilityDataBLifecycleObserver OnBackground"); + HILOG_INFO("AmsStKitDataAbilityDataBLifecycleObserver OnBackground"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnBackground"); } void AmsStKitDataAbilityDataBLifecycleObserver::OnForeground(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataBLifecycleObserver OnForeground"); + HILOG_INFO("AmsStKitDataAbilityDataBLifecycleObserver OnForeground"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnForeground"); } void AmsStKitDataAbilityDataBLifecycleObserver::OnInactive() { - APP_LOGI("AmsStKitDataAbilityDataBLifecycleObserver OnInactive"); + HILOG_INFO("AmsStKitDataAbilityDataBLifecycleObserver OnInactive"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnInactive"); } void AmsStKitDataAbilityDataBLifecycleObserver::OnStart(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataBLifecycleObserver OnStart"); + HILOG_INFO("AmsStKitDataAbilityDataBLifecycleObserver OnStart"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnStart"); } void AmsStKitDataAbilityDataBLifecycleObserver::OnStop() { - APP_LOGI("AmsStKitDataAbilityDataBLifecycleObserver OnStop"); + HILOG_INFO("AmsStKitDataAbilityDataBLifecycleObserver OnStop"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnStop"); } void AmsStKitDataAbilityDataBLifecycleObserver::OnStateChanged(LifeCycle::Event event, const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataBLifecycleObserver OnStateChanged"); + HILOG_INFO("AmsStKitDataAbilityDataBLifecycleObserver OnStateChanged"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnStateChanged"); } void AmsStKitDataAbilityDataBLifecycleObserver::OnStateChanged(LifeCycle::Event event) { - APP_LOGI("AmsStKitDataAbilityDataBLifecycleObserver OnStateChanged"); + HILOG_INFO("AmsStKitDataAbilityDataBLifecycleObserver OnStateChanged"); mainAbility_->PublishEvent(abilityEventName, LIFECYCLE_OBSERVER, "OnStateChanged"); } @@ -163,9 +163,9 @@ bool AmsStKitDataAbilityDataB::PublishEvent(const std::string &eventName, const void KitTestDataBEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("KitTestDataBEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestDataBEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("KitTestDataBEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("KitTestDataBEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestDataBEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("KitTestDataBEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (eventName.compare(testEventName) == 0 && ABILITY_DATA_CODE == data.GetCode()) { std::string target = data.GetData(); @@ -177,7 +177,7 @@ void AmsStKitDataAbilityDataB::Init(const std::shared_ptr &abilityI const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AmsStKitDataAbilityDataB::Init called."); + HILOG_INFO("AmsStKitDataAbilityDataB::Init called."); Ability::Init(abilityInfo, application, handler, token); auto callback = std::make_shared(); callback->mainAbility_ = this; @@ -214,7 +214,7 @@ void AmsStKitDataAbilityDataB::SubscribeEvent(const Want &want) void AmsStKitDataAbilityDataB::OnStart(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataB OnStart"); + HILOG_INFO("AmsStKitDataAbilityDataB OnStart"); SubscribeEvent(want); originWant_ = want; Ability::OnStart(want); @@ -223,35 +223,35 @@ void AmsStKitDataAbilityDataB::OnStart(const Want &want) void AmsStKitDataAbilityDataB::OnStop() { - APP_LOGI("AmsStKitDataAbilityDataB OnStop"); + HILOG_INFO("AmsStKitDataAbilityDataB OnStop"); Ability::OnStop(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnStop"); } void AmsStKitDataAbilityDataB::OnActive() { - APP_LOGI("AmsStKitDataAbilityDataB OnActive"); + HILOG_INFO("AmsStKitDataAbilityDataB OnActive"); Ability::OnActive(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnActive"); } void AmsStKitDataAbilityDataB::OnInactive() { - APP_LOGI("AmsStKitDataAbilityDataB OnInactive"); + HILOG_INFO("AmsStKitDataAbilityDataB OnInactive"); Ability::OnInactive(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnInactive"); } void AmsStKitDataAbilityDataB::OnForeground(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataB OnForeground"); + HILOG_INFO("AmsStKitDataAbilityDataB OnForeground"); Ability::OnForeground(want); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnForeground"); } void AmsStKitDataAbilityDataB::OnNewWant(const Want &want) { - APP_LOGI("AmsStKitDataAbilityDataB::OnNewWant"); + HILOG_INFO("AmsStKitDataAbilityDataB::OnNewWant"); originWant_ = want; Ability::OnNewWant(want); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnNewWant"); @@ -259,28 +259,28 @@ void AmsStKitDataAbilityDataB::OnNewWant(const Want &want) void AmsStKitDataAbilityDataB::OnBackground() { - APP_LOGI("AmsStKitDataAbilityDataB OnBackground"); + HILOG_INFO("AmsStKitDataAbilityDataB OnBackground"); Ability::OnBackground(); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OnBackground"); } int AmsStKitDataAbilityDataB::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) { - APP_LOGI("AmsStKitDataAbilityDataB <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataB <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "Insert"); return DEFAULT_INSERT_RESULT; } int AmsStKitDataAbilityDataB::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsStKitDataAbilityDataB <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataB <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "Delete"); return DEFAULT_DELETE_RESULT; } int AmsStKitDataAbilityDataB::Update(const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("AmsStKitDataAbilityDataB <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataB <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "Update"); return DEFAULT_UPDATE_RESULT; } @@ -289,7 +289,7 @@ std::shared_ptr AmsStKitDataAbilityDataB::Query( const Uri &uri, const std::vector &columns, const NativeRdb::DataAbilityPredicates &predicates) { subscriber_->vectorOperator_ = columns; - APP_LOGI("AmsStKitDataAbilityDataB <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataB <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, OPERATOR_QUERY); STtools::WaitCompleted(event, OPERATOR_QUERY, ABILITY_DATA_CODE); @@ -305,7 +305,7 @@ std::shared_ptr AmsStKitDataAbilityDataB::Query( std::vector AmsStKitDataAbilityDataB::GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) { - APP_LOGI("AmsStKitDataAbilityDataB <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataB <<<>>>"); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "GetFileTypes"); std::vector fileType {"filetypes"}; return fileType; @@ -313,7 +313,7 @@ std::vector AmsStKitDataAbilityDataB::GetFileTypes(const Uri &uri, int AmsStKitDataAbilityDataB::OpenFile(const Uri &uri, const std::string &mode) { - APP_LOGI("AmsStKitDataAbilityDataB <<<>>>"); + HILOG_INFO("AmsStKitDataAbilityDataB <<<>>>"); if (fd1 != nullptr) { fclose(fd1); fd1 = nullptr; @@ -322,7 +322,7 @@ int AmsStKitDataAbilityDataB::OpenFile(const Uri &uri, const std::string &mode) if (fd1 == nullptr) return -1; int fd = fileno(fd1); - APP_LOGI("AmsStKitDataAbilityDataB fd: %{public}d", fd); + HILOG_INFO("AmsStKitDataAbilityDataB fd: %{public}d", fd); PublishEvent(abilityEventName, ABILITY_DATA_CODE, "OpenFile"); return fd; @@ -375,23 +375,23 @@ static void GetResult(std::shared_ptr child, std::shared_pt void KitTestDataBEventSubscriber::TestPost(const std::string funName) { - APP_LOGI("KitTestDataBEventSubscriber::TestPost %{public}s", funName.c_str()); + HILOG_INFO("KitTestDataBEventSubscriber::TestPost %{public}s", funName.c_str()); STtools::StOperator allOperator {}; STtools::DeserializationStOperatorFromVector(allOperator, vectorOperator_); std::shared_ptr helper = DataAbilityHelper::Creator(mainAbility_->GetContext()); for (auto child : allOperator.GetChildOperator()) { /// data ability if (child->GetAbilityType() == ABILITY_TYPE_DATA) { - APP_LOGI("---------------------targetAbility_--------------------"); + HILOG_INFO("---------------------targetAbility_--------------------"); Uri dataAbilityUri("dataability:///" + child->GetBundleName() + "." + child->GetAbilityName()); std::string result; if (helper != nullptr) { - APP_LOGI("---------------------helper--------------------"); + HILOG_INFO("---------------------helper--------------------"); GetResult(child, helper, *mainAbility_, dataAbilityUri, result); } mainAbility_->PublishEvent(abilityEventName, ABILITY_DATA_CODE, child->GetOperatorName() + " " + result); } else if (child->GetAbilityType() == ABILITY_TYPE_PAGE) { - APP_LOGI("---------------------StartPageAbility--------------------"); + HILOG_INFO("---------------------StartPageAbility--------------------"); std::vector vectoroperator; if (child->GetChildOperator().size() != 0) { vectoroperator = STtools::SerializationStOperatorToVector(*child); diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataB/src/ams_st_kit_data_ability_page_b.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataB/src/ams_st_kit_data_ability_page_b.cpp index 76a5fd0f1a..7c6128ead0 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataB/src/ams_st_kit_data_ability_page_b.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataB/src/ams_st_kit_data_ability_page_b.cpp @@ -19,7 +19,7 @@ #include #include "data_ability_helper.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "abs_shared_result_set.h" #include "data_ability_predicates.h" #include "values_bucket.h" @@ -51,9 +51,9 @@ bool AmsStKitDataAbilityPageB::PublishEvent(const std::string &eventName, const void KitTestPageBEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("KitTestPageBEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestPageBEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("KitTestPageBEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("KitTestPageBEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestPageBEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("KitTestPageBEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (eventName.compare("event_data_test_action") == 0 && ABILITY_PAGE_CODE == data.GetCode()) { auto target = data.GetData(); @@ -61,7 +61,7 @@ void KitTestPageBEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (func != mapTestFunc_.end()) { func->second(); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } @@ -91,7 +91,7 @@ void AmsStKitDataAbilityPageB::SubscribeEvent(const Want &want) void AmsStKitDataAbilityPageB::OnStart(const Want &want) { - APP_LOGI("AmsStKitDataAbilityPageB::onStart"); + HILOG_INFO("AmsStKitDataAbilityPageB::onStart"); originWant_ = want; SubscribeEvent(want); Ability::OnStart(want); @@ -100,35 +100,35 @@ void AmsStKitDataAbilityPageB::OnStart(const Want &want) void AmsStKitDataAbilityPageB::OnNewWant(const Want &want) { - APP_LOGI("AmsStKitDataAbilityPageB::OnNewWant"); + HILOG_INFO("AmsStKitDataAbilityPageB::OnNewWant"); originWant_ = want; Ability::OnNewWant(want); } void AmsStKitDataAbilityPageB::OnStop() { - APP_LOGI("AmsStKitDataAbilityPageB::onStop"); + HILOG_INFO("AmsStKitDataAbilityPageB::onStop"); Ability::OnStop(); PublishEvent(abilityEventName, ABILITY_PAGE_CODE, "OnStop"); } void AmsStKitDataAbilityPageB::OnActive() { - APP_LOGI("AmsStKitDataAbilityPageB::OnActive"); + HILOG_INFO("AmsStKitDataAbilityPageB::OnActive"); Ability::OnActive(); PublishEvent(abilityEventName, ABILITY_PAGE_CODE, "OnActive"); } void AmsStKitDataAbilityPageB::OnInactive() { - APP_LOGI("AmsStKitDataAbilityPageB::OnInactive"); + HILOG_INFO("AmsStKitDataAbilityPageB::OnInactive"); Ability::OnInactive(); PublishEvent(abilityEventName, ABILITY_PAGE_CODE, "OnInactive"); } void AmsStKitDataAbilityPageB::OnBackground() { - APP_LOGI("AmsStKitDataAbilityPageB::OnBackground"); + HILOG_INFO("AmsStKitDataAbilityPageB::OnBackground"); Ability::OnBackground(); PublishEvent(abilityEventName, ABILITY_PAGE_CODE, "OnBackground"); } @@ -141,11 +141,11 @@ void AmsStKitDataAbilityPageB::GetWantInfo(const Want &want) STtools::DeserializationStOperatorFromVector(allOperator, vectorOperator); for (auto child : allOperator.GetChildOperator()) { - APP_LOGI("-----------------targetBundle:%{public}s", child->GetBundleName().c_str()); - APP_LOGI("-----------------targetAbility:%{public}s", child->GetAbilityName().c_str()); - APP_LOGI("-----------------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); - APP_LOGI("-----------------operatorName:%{public}s", child->GetOperatorName().c_str()); - APP_LOGI("-----------------childOperatorNum:%{public}zu", child->GetChildOperator().size()); + HILOG_INFO("-----------------targetBundle:%{public}s", child->GetBundleName().c_str()); + HILOG_INFO("-----------------targetAbility:%{public}s", child->GetAbilityName().c_str()); + HILOG_INFO("-----------------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); + HILOG_INFO("-----------------operatorName:%{public}s", child->GetOperatorName().c_str()); + HILOG_INFO("-----------------childOperatorNum:%{public}zu", child->GetChildOperator().size()); } } @@ -196,24 +196,24 @@ static void GetResult(std::shared_ptr child, std::shared_pt void KitTestPageBEventSubscriber::TestPost(const std::string funName) { - APP_LOGI("KitTestPageBEventSubscriber::TestPost %{public}s", funName.c_str()); + HILOG_INFO("KitTestPageBEventSubscriber::TestPost %{public}s", funName.c_str()); STtools::StOperator allOperator {}; STtools::DeserializationStOperatorFromVector(allOperator, vectorOperator_); std::shared_ptr helper = DataAbilityHelper::Creator(mainAbility_->GetContext()); for (auto child : allOperator.GetChildOperator()) { /// data ability if (child->GetAbilityType() == "2") { - APP_LOGI("---------------------targetAbility_--------------------"); + HILOG_INFO("---------------------targetAbility_--------------------"); Uri dataAbilityUri("dataability:///" + child->GetBundleName() + "." + child->GetAbilityName()); std::string result; if (helper != nullptr) { - APP_LOGI("---------------------helper--------------------"); + HILOG_INFO("---------------------helper--------------------"); GetResult(child, helper, *mainAbility_, dataAbilityUri, result); } mainAbility_->PublishEvent(abilityEventName, ABILITY_PAGE_CODE, child->GetOperatorName() + " " + result); } else if (child->GetAbilityType() == "0") { - APP_LOGI("---------------------StartPageAbility--------------------"); + HILOG_INFO("---------------------StartPageAbility--------------------"); std::vector vectoroperator; if (child->GetChildOperator().size() != 0) { vectoroperator = STtools::SerializationStOperatorToVector(*child); diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataB/src/ams_st_kit_data_ability_service_b.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataB/src/ams_st_kit_data_ability_service_b.cpp index ce7942848d..f9bd1c8b46 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataB/src/ams_st_kit_data_ability_service_b.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestDataB/src/ams_st_kit_data_ability_service_b.cpp @@ -19,7 +19,7 @@ #include #include "data_ability_helper.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "abs_shared_result_set.h" #include "data_ability_predicates.h" #include "values_bucket.h" @@ -51,9 +51,9 @@ bool AmsStKitDataAbilityServiceB::PublishEvent(const std::string &eventName, con void KitTestServiceBEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("KitTestServiceBEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestServiceBEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("KitTestServiceBEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("KitTestServiceBEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestServiceBEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("KitTestServiceBEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (eventName.compare("event_data_test_action") == 0 && ABILITY_SERVICE_CODE == data.GetCode()) { auto target = data.GetData(); @@ -61,7 +61,7 @@ void KitTestServiceBEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (func != mapTestFunc_.end()) { func->second(); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } @@ -92,7 +92,7 @@ void AmsStKitDataAbilityServiceB::SubscribeEvent(const Want &want) void AmsStKitDataAbilityServiceB::OnStart(const Want &want) { - APP_LOGI("AmsStKitDataAbilityServiceB::onStart"); + HILOG_INFO("AmsStKitDataAbilityServiceB::onStart"); originWant_ = want; SubscribeEvent(want); Ability::OnStart(want); @@ -101,42 +101,42 @@ void AmsStKitDataAbilityServiceB::OnStart(const Want &want) void AmsStKitDataAbilityServiceB::OnNewWant(const Want &want) { - APP_LOGI("AmsStKitDataAbilityServiceB::OnNewWant"); + HILOG_INFO("AmsStKitDataAbilityServiceB::OnNewWant"); originWant_ = want; Ability::OnNewWant(want); } void AmsStKitDataAbilityServiceB::OnStop() { - APP_LOGI("AmsStKitDataAbilityServiceB::onStop"); + HILOG_INFO("AmsStKitDataAbilityServiceB::onStop"); Ability::OnStop(); PublishEvent(abilityEventName, ABILITY_SERVICE_CODE, "OnStop"); } void AmsStKitDataAbilityServiceB::OnActive() { - APP_LOGI("AmsStKitDataAbilityServiceB::OnActive"); + HILOG_INFO("AmsStKitDataAbilityServiceB::OnActive"); Ability::OnActive(); PublishEvent(abilityEventName, ABILITY_SERVICE_CODE, "OnActive"); } void AmsStKitDataAbilityServiceB::OnInactive() { - APP_LOGI("AmsStKitDataAbilityServiceB::OnInactive"); + HILOG_INFO("AmsStKitDataAbilityServiceB::OnInactive"); Ability::OnInactive(); PublishEvent(abilityEventName, ABILITY_SERVICE_CODE, "OnInactive"); } void AmsStKitDataAbilityServiceB::OnBackground() { - APP_LOGI("AmsStKitDataAbilityServiceB::OnBackground"); + HILOG_INFO("AmsStKitDataAbilityServiceB::OnBackground"); Ability::OnBackground(); PublishEvent(abilityEventName, ABILITY_SERVICE_CODE, "OnBackground"); } void AmsStKitDataAbilityServiceB::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("AmsStKitDataAbilityServiceB::OnCommand"); + HILOG_INFO("AmsStKitDataAbilityServiceB::OnCommand"); GetWantInfo(want); Ability::OnCommand(want, restart, startId); @@ -145,7 +145,7 @@ void AmsStKitDataAbilityServiceB::OnCommand(const AAFwk::Want &want, bool restar sptr AmsStKitDataAbilityServiceB::OnConnect(const Want &want) { - APP_LOGI("AmsStKitDataAbilityServiceB::OnConnect"); + HILOG_INFO("AmsStKitDataAbilityServiceB::OnConnect"); sptr ret = Ability::OnConnect(want); PublishEvent(abilityEventName, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnConnect"); @@ -153,7 +153,7 @@ sptr AmsStKitDataAbilityServiceB::OnConnect(const Want &want) } void AmsStKitDataAbilityServiceB::OnDisconnect(const Want &want) { - APP_LOGI("AmsStKitDataAbilityServiceB::OnDisconnect"); + HILOG_INFO("AmsStKitDataAbilityServiceB::OnDisconnect"); Ability::OnDisconnect(want); PublishEvent(abilityEventName, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnDisconnect"); @@ -167,11 +167,11 @@ void AmsStKitDataAbilityServiceB::GetWantInfo(const Want &want) STtools::DeserializationStOperatorFromVector(allOperator, vectorOperator); for (auto child : allOperator.GetChildOperator()) { - APP_LOGI("-----------------targetBundle:%{public}s", child->GetBundleName().c_str()); - APP_LOGI("-----------------targetAbility:%{public}s", child->GetAbilityName().c_str()); - APP_LOGI("-----------------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); - APP_LOGI("-----------------operatorName:%{public}s", child->GetOperatorName().c_str()); - APP_LOGI("-----------------childOperatorNum:%{public}zu", child->GetChildOperator().size()); + HILOG_INFO("-----------------targetBundle:%{public}s", child->GetBundleName().c_str()); + HILOG_INFO("-----------------targetAbility:%{public}s", child->GetAbilityName().c_str()); + HILOG_INFO("-----------------targetAbilityType:%{public}s", child->GetAbilityType().c_str()); + HILOG_INFO("-----------------operatorName:%{public}s", child->GetOperatorName().c_str()); + HILOG_INFO("-----------------childOperatorNum:%{public}zu", child->GetChildOperator().size()); } } @@ -222,24 +222,24 @@ static void GetResult(std::shared_ptr child, std::shared_pt void KitTestServiceBEventSubscriber::TestPost(const std::string funName) { - APP_LOGI("KitTestServiceAEventSubscriber::TestPost %{public}s", funName.c_str()); + HILOG_INFO("KitTestServiceAEventSubscriber::TestPost %{public}s", funName.c_str()); STtools::StOperator allOperator {}; STtools::DeserializationStOperatorFromVector(allOperator, vectorOperator_); std::shared_ptr helper = DataAbilityHelper::Creator(mainAbility_->GetContext()); for (auto child : allOperator.GetChildOperator()) { /// data ability if (child->GetAbilityType() == "2") { - APP_LOGI("---------------------targetAbility_--------------------"); + HILOG_INFO("---------------------targetAbility_--------------------"); Uri dataAbilityUri("dataability:///" + child->GetBundleName() + "." + child->GetAbilityName()); std::string result; if (helper != nullptr) { - APP_LOGI("---------------------helper--------------------"); + HILOG_INFO("---------------------helper--------------------"); GetResult(child, helper, *mainAbility_, dataAbilityUri, result); } mainAbility_->PublishEvent(abilityEventName, ABILITY_SERVICE_CODE, child->GetOperatorName() + " " + result); } else if (child->GetAbilityType() == "0") { - APP_LOGI("---------------------StartPageAbility--------------------"); + HILOG_INFO("---------------------StartPageAbility--------------------"); std::vector vectoroperator; if (child->GetChildOperator().size() != 0) { vectoroperator = STtools::SerializationStOperatorToVector(*child); diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/BUILD.gn index ec7ecb033b..912b64f9bb 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/BUILD.gn @@ -25,12 +25,13 @@ config("amsSystemTestCConfig") { "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${appexecfwk_path}/services/bundlemgr/include", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsKitSystemTestPageA\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsKitSystemTestPageA\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsKitSystemTestPageA") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/ability_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/ability_ability.cpp index 54c96e090b..d4f2319cc4 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/ability_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/ability_ability.cpp @@ -15,7 +15,7 @@ #include "ability_ability.h" #include "ability_start_setting.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -26,7 +26,7 @@ void AbilityAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AbilityAbility::Init called."); + HILOG_INFO("AbilityAbility::Init called."); BaseAbility::Init(abilityInfo, application, handler, token); SubscribeEvent(); @@ -72,12 +72,12 @@ bool AbilityAbility::SubscribeEvent() void AbilityAbility::OnStart(const Want &want) { - APP_LOGI("AbilityAbility::OnStart"); + HILOG_INFO("AbilityAbility::OnStart"); sequenceNumber_ = GetNoFromWantInfo(want); - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s", sequenceNumber_.c_str()); + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s", sequenceNumber_.c_str()); want_ = want; - APP_LOGI("AbilityAbility::OnStart"); + HILOG_INFO("AbilityAbility::OnStart"); BaseAbility::OnStart(want); TestUtils::PublishEvent(APP_ABILITY_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnStart"); @@ -86,7 +86,7 @@ void AbilityAbility::OnStart(const Want &want) void AbilityAbility::OnStop() { - APP_LOGI("AbilityAbility::OnStop"); + HILOG_INFO("AbilityAbility::OnStop"); BaseAbility::OnStop(); TestUtils::PublishEvent(APP_ABILITY_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); @@ -96,7 +96,7 @@ void AbilityAbility::OnStop() void AbilityAbility::OnActive() { - APP_LOGI("AbilityAbility::OnActive"); + HILOG_INFO("AbilityAbility::OnActive"); BaseAbility::OnActive(); TestUtils::PublishEvent(APP_ABILITY_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); @@ -106,7 +106,7 @@ void AbilityAbility::OnActive() void AbilityAbility::OnInactive() { - APP_LOGI("AbilityAbility::OnInactive"); + HILOG_INFO("AbilityAbility::OnInactive"); BaseAbility::OnInactive(); TestUtils::PublishEvent( @@ -117,7 +117,7 @@ void AbilityAbility::OnInactive() void AbilityAbility::OnBackground() { - APP_LOGI("AbilityAbility::OnBackground"); + HILOG_INFO("AbilityAbility::OnBackground"); BaseAbility::OnBackground(); TestUtils::PublishEvent( @@ -128,7 +128,7 @@ void AbilityAbility::OnBackground() void AbilityAbility::OnForeground(const Want &want) { - APP_LOGI("AbilityAbility::OnForeground"); + HILOG_INFO("AbilityAbility::OnForeground"); BaseAbility::OnBackground(); TestUtils::PublishEvent( @@ -139,7 +139,7 @@ void AbilityAbility::OnForeground(const Want &want) void AbilityAbility::OnCommand(const Want &want, bool restart, int startId) { - APP_LOGI("AbilityAbility::OnCommand"); + HILOG_INFO("AbilityAbility::OnCommand"); BaseAbility::OnCommand(want, restart, startId); TestUtils::PublishEvent(APP_ABILITY_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnCommand"); @@ -149,7 +149,7 @@ void AbilityAbility::OnCommand(const Want &want, bool restart, int startId) sptr AbilityAbility::OnConnect(const Want &want) { - APP_LOGI("AbilityAbility::OnConnect"); + HILOG_INFO("AbilityAbility::OnConnect"); sptr ret = BaseAbility::OnConnect(want); TestUtils::PublishEvent(APP_ABILITY_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnConnect"); @@ -161,7 +161,7 @@ sptr AbilityAbility::OnConnect(const Want &want) void AbilityAbility::OnDisconnect(const Want &want) { - APP_LOGI("AbilityAbility::OnDisconnect"); + HILOG_INFO("AbilityAbility::OnDisconnect"); BaseAbility::OnDisconnect(want); TestUtils::PublishEvent( @@ -172,7 +172,7 @@ void AbilityAbility::OnDisconnect(const Want &want) void AbilityAbility::OnNewWant(const Want &want) { - APP_LOGI("AbilityAbility::OnNewWant"); + HILOG_INFO("AbilityAbility::OnNewWant"); BaseAbility::OnNewWant(want); TestUtils::PublishEvent( @@ -183,7 +183,7 @@ void AbilityAbility::OnNewWant(const Want &want) void AbilityAbility::OnAbilityResult(int requestCode, int resultCode, const Want &resultData) { - APP_LOGI("AbilityAbility::OnNewWant"); + HILOG_INFO("AbilityAbility::OnNewWant"); BaseAbility::OnAbilityResult(requestCode, resultCode, resultData); TestUtils::PublishEvent(APP_ABILITY_RESP_EVENT_NAME, requestCode, "OnAbilityResult"); @@ -198,7 +198,7 @@ void AbilityAbility::StopSelfAbility() void AbilityAbility::TestConnectAbility() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -252,7 +252,7 @@ void AbilityAbility::TestConnectAbility() void AbilityAbility::TestStopAbility() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -357,7 +357,7 @@ void AbilityAbility::TestDisconnectAbility() void AbilityAbility::TestStartAbility() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -408,7 +408,7 @@ void AbilityAbility::TestStartAbility() void AbilityAbility::TestTerminateAbility() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -558,7 +558,7 @@ void AbilityAbility::TestStartAbilityForResult() void AbilityAbility::TestAbilityStartAbility() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -609,7 +609,7 @@ void AbilityAbility::TestAbilityStartAbility() void AbilityAbility::TestAbilityConnectAbility() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -667,7 +667,7 @@ void AbilityAbility::TestAbilityConnectAbility() void AbilityAbility::TestAbilityStopAbility() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -719,7 +719,7 @@ void AbilityAbility::TestAbilityStopAbility() void AbilityAbility::TestAbilityGetLifecycle() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -790,7 +790,7 @@ void AbilityAbility::caseIndexTwo() void AbilityAbility::TestAbilityDisconnectAbility() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -844,9 +844,9 @@ void AbilityAbility::TestAbilityDisconnectAbility() void AbilityAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("AbilityAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("AbilityAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("AbilityAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("AbilityAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("AbilityAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("AbilityAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), APP_ABILITY_REQ_EVENT_NAME.c_str()) == 0) { @@ -855,7 +855,7 @@ void AbilityAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (func != mapTestFunc_.end()) { func->second(); } else { - APP_LOGI( + HILOG_INFO( "AbilityAbilityEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/ability_context_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/ability_context_ability.cpp index 283ac05ac3..bef6c8ccea 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/ability_context_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/ability_context_ability.cpp @@ -14,7 +14,7 @@ */ #include "ability_context_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "base_ability.h" #include "test_utils.h" @@ -31,7 +31,7 @@ void AbilityContextAbility::Init(const std::shared_ptr &abilityInfo const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AbilityContextAbility::Init called."); + HILOG_INFO("AbilityContextAbility::Init called."); BaseAbility::Init(abilityInfo, application, handler, token); SubscribeEvent(); @@ -52,7 +52,7 @@ void AbilityContextAbility::OnStart(const Want &want) { want_ = want; sequenceNumber_ = std::stoi(GetNoFromWantInfo(want)); - APP_LOGI("AbilityContextAbility::OnStart"); + HILOG_INFO("AbilityContextAbility::OnStart"); BaseAbility::OnStart(want); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityContextAbility::GetState(), "OnStart"); @@ -60,42 +60,42 @@ void AbilityContextAbility::OnStart(const Want &want) void AbilityContextAbility::OnStop() { - APP_LOGI("AbilityContextAbility::OnStop"); + HILOG_INFO("AbilityContextAbility::OnStop"); BaseAbility::OnStop(); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityContextAbility::GetState(), "OnStop"); } void AbilityContextAbility::OnActive() { - APP_LOGI("AbilityContextAbility::OnActive"); + HILOG_INFO("AbilityContextAbility::OnActive"); BaseAbility::OnActive(); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityContextAbility::GetState(), "OnActive"); } void AbilityContextAbility::OnInactive() { - APP_LOGI("AbilityContextAbility::OnInactive"); + HILOG_INFO("AbilityContextAbility::OnInactive"); BaseAbility::OnInactive(); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityContextAbility::GetState(), "OnInactive"); } void AbilityContextAbility::OnBackground() { - APP_LOGI("AbilityContextAbility::OnBackground"); + HILOG_INFO("AbilityContextAbility::OnBackground"); BaseAbility::OnBackground(); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityContextAbility::GetState(), "OnBackground"); } void AbilityContextAbility::OnForeground(const Want &want) { - APP_LOGI("AbilityContextAbility::OnForeground"); + HILOG_INFO("AbilityContextAbility::OnForeground"); BaseAbility::OnForeground(want); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityContextAbility::GetState(), "OnForeground"); } void AbilityContextAbility::OnCommand(const Want &want, bool restart, int startId) { - APP_LOGI("AbilityContextAbility::OnCommand"); + HILOG_INFO("AbilityContextAbility::OnCommand"); BaseAbility::OnCommand(want, restart, startId); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityContextAbility::GetState(), "OnCommand"); @@ -103,7 +103,7 @@ void AbilityContextAbility::OnCommand(const Want &want, bool restart, int startI sptr AbilityContextAbility::OnConnect(const Want &want) { - APP_LOGI("AbilityContextAbility::OnConnect"); + HILOG_INFO("AbilityContextAbility::OnConnect"); sptr ret = BaseAbility::OnConnect(want); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityContextAbility::GetState(), "OnConnect"); @@ -112,7 +112,7 @@ sptr AbilityContextAbility::OnConnect(const Want &want) void AbilityContextAbility::OnDisconnect(const Want &want) { - APP_LOGI("AbilityContextAbility::OnDisconnect"); + HILOG_INFO("AbilityContextAbility::OnDisconnect"); BaseAbility::OnDisconnect(want); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityContextAbility::GetState(), "OnDisconnect"); @@ -341,10 +341,10 @@ void AbilityContextAbility::TestTerminateAbility() void AbilityContextAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI( + HILOG_INFO( "AbilityContextAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("AbilityContextAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("AbilityContextAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("AbilityContextAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("AbilityContextAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), APP_ABILITY_CONTEXT_REQ_EVENT_NAME.c_str()) == 0) { @@ -353,7 +353,7 @@ void AbilityContextAbilityEventSubscriber::OnReceiveEvent(const CommonEventData if (func != mapTestFunc_.end()) { func->second(); } else { - APP_LOGI("AbilityContextAbilityEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", + HILOG_INFO("AbilityContextAbilityEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/ability_life_cycle_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/ability_life_cycle_ability.cpp index c2552fa710..fe6bc74375 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/ability_life_cycle_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/ability_life_cycle_ability.cpp @@ -14,7 +14,7 @@ */ #include "ability_life_cycle_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "base_ability.h" #include "test_utils.h" @@ -34,7 +34,7 @@ void AbilityLifeCycleAbility::Init(const std::shared_ptr &abilityIn const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AbilityLifeCycleAbility::Init called."); + HILOG_INFO("AbilityLifeCycleAbility::Init called."); BaseAbility::Init(abilityInfo, application, handler, token); SubscribeEvent(); @@ -63,7 +63,7 @@ void AbilityLifeCycleAbility::OnStart(const Want &want) { sequenceNumber_ = std::stoi(GetNoFromWantInfo(want)); want_ = want; - APP_LOGI("AbilityLifeCycleAbility::OnStart"); + HILOG_INFO("AbilityLifeCycleAbility::OnStart"); BaseAbility::OnStart(want); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityLifeCycleAbility::GetState(), "OnStart"); @@ -75,7 +75,7 @@ void AbilityLifeCycleAbility::OnStart(const Want &want) void AbilityLifeCycleAbility::OnStop() { - APP_LOGI("AbilityLifeCycleAbility::OnStop"); + HILOG_INFO("AbilityLifeCycleAbility::OnStop"); BaseAbility::OnStop(); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityLifeCycleAbility::GetState(), "OnStop"); @@ -86,7 +86,7 @@ void AbilityLifeCycleAbility::OnStop() void AbilityLifeCycleAbility::OnActive() { - APP_LOGI("AbilityLifeCycleAbility::OnActive"); + HILOG_INFO("AbilityLifeCycleAbility::OnActive"); BaseAbility::OnActive(); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityLifeCycleAbility::GetState(), "OnActive"); @@ -97,7 +97,7 @@ void AbilityLifeCycleAbility::OnActive() void AbilityLifeCycleAbility::OnInactive() { - APP_LOGI("AbilityLifeCycleAbility::OnInactive"); + HILOG_INFO("AbilityLifeCycleAbility::OnInactive"); BaseAbility::OnInactive(); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityLifeCycleAbility::GetState(), "OnInactive"); @@ -108,7 +108,7 @@ void AbilityLifeCycleAbility::OnInactive() void AbilityLifeCycleAbility::OnBackground() { - APP_LOGI("AbilityLifeCycleAbility::OnBackground"); + HILOG_INFO("AbilityLifeCycleAbility::OnBackground"); BaseAbility::OnBackground(); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityLifeCycleAbility::GetState(), "OnBackground"); @@ -119,7 +119,7 @@ void AbilityLifeCycleAbility::OnBackground() void AbilityLifeCycleAbility::OnForeground(const Want &want) { - APP_LOGI("AbilityLifeCycleAbility::OnForeground"); + HILOG_INFO("AbilityLifeCycleAbility::OnForeground"); BaseAbility::OnBackground(); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityLifeCycleAbility::GetState(), "OnForeground"); @@ -130,7 +130,7 @@ void AbilityLifeCycleAbility::OnForeground(const Want &want) void AbilityLifeCycleAbility::OnCommand(const Want &want, bool restart, int startId) { - APP_LOGI("AbilityLifeCycleAbility::OnCommand"); + HILOG_INFO("AbilityLifeCycleAbility::OnCommand"); BaseAbility::OnCommand(want, restart, startId); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityLifeCycleAbility::GetState(), "OnCommand"); @@ -142,7 +142,7 @@ void AbilityLifeCycleAbility::OnCommand(const Want &want, bool restart, int star sptr AbilityLifeCycleAbility::OnConnect(const Want &want) { - APP_LOGI("AbilityLifeCycleAbility::OnConnect"); + HILOG_INFO("AbilityLifeCycleAbility::OnConnect"); sptr ret = BaseAbility::OnConnect(want); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityLifeCycleAbility::GetState(), "OnConnect"); @@ -155,7 +155,7 @@ sptr AbilityLifeCycleAbility::OnConnect(const Want &want) void AbilityLifeCycleAbility::OnDisconnect(const Want &want) { - APP_LOGI("AbilityLifeCycleAbility::OnDisconnect"); + HILOG_INFO("AbilityLifeCycleAbility::OnDisconnect"); BaseAbility::OnDisconnect(want); TestUtils::PublishEvent(APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityLifeCycleAbility::GetState(), "OnDisconnect"); @@ -696,10 +696,10 @@ void AbilityLifeCycleAbility::TestLifeCycleRemoveObserver() void AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI( + HILOG_INFO( "AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), APP_ABILITY_LIFE_CYCLE_REQ_EVENT_NAME.c_str()) == 0) { @@ -708,7 +708,7 @@ void AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent(const CommonEventDat if (func != mapTestFunc_.end()) { func->second(); } else { - APP_LOGI("AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", + HILOG_INFO("AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/base_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/base_ability.cpp index 2fbf38eec9..f68ae5a4fa 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/base_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/base_ability.cpp @@ -15,7 +15,7 @@ */ #include "base_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -25,63 +25,63 @@ void BaseAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("BaseAbility::Init called."); + HILOG_INFO("BaseAbility::Init called."); Ability::Init(abilityInfo, application, handler, token); } void BaseAbility::OnStart(const Want &want) { - APP_LOGI("BaseAbility::OnStart"); + HILOG_INFO("BaseAbility::OnStart"); Ability::OnStart(want); } void BaseAbility::OnStop() { - APP_LOGI("BaseAbility::OnStop"); + HILOG_INFO("BaseAbility::OnStop"); Ability::OnStop(); } void BaseAbility::OnActive() { - APP_LOGI("BaseAbility::OnActive"); + HILOG_INFO("BaseAbility::OnActive"); Ability::OnActive(); } void BaseAbility::OnInactive() { - APP_LOGI("BaseAbility::OnInactive"); + HILOG_INFO("BaseAbility::OnInactive"); Ability::OnInactive(); } void BaseAbility::OnBackground() { - APP_LOGI("BaseAbility::OnBackground"); + HILOG_INFO("BaseAbility::OnBackground"); Ability::OnBackground(); } void BaseAbility::OnForeground(const Want &want) { - APP_LOGI("BaseAbility::OnForeground"); + HILOG_INFO("BaseAbility::OnForeground"); Ability::OnForeground(want); } void BaseAbility::OnCommand(const Want &want, bool restart, int startId) { - APP_LOGI("BaseAbility::OnCommand"); + HILOG_INFO("BaseAbility::OnCommand"); Ability::OnCommand(want, restart, startId); } sptr BaseAbility::OnConnect(const Want &want) { - APP_LOGI("BaseAbility::OnConnect"); + HILOG_INFO("BaseAbility::OnConnect"); sptr ret = Ability::OnConnect(want); return ret; @@ -89,28 +89,28 @@ sptr BaseAbility::OnConnect(const Want &want) void BaseAbility::OnDisconnect(const Want &want) { - APP_LOGI("BaseAbility::OnDisconnect"); + HILOG_INFO("BaseAbility::OnDisconnect"); Ability::OnDisconnect(want); } void BaseAbility::OnNewWant(const Want &want) { - APP_LOGI("BaseAbility::OnNewWant"); + HILOG_INFO("BaseAbility::OnNewWant"); Ability::OnNewWant(want); } void BaseAbility::OnAbilityResult(int requestCode, int resultCode, const Want &resultData) { - APP_LOGI("BaseAbility::OnAbilityResult"); + HILOG_INFO("BaseAbility::OnAbilityResult"); Ability::OnAbilityResult(requestCode, resultCode, resultData); } void BaseAbility::OnBackPressed() { - APP_LOGI("BaseAbility::OnBackPressed"); + HILOG_INFO("BaseAbility::OnBackPressed"); Ability::OnBackPressed(); } diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/life_cycle_call_backs_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/life_cycle_call_backs_ability.cpp index 3bc3dcf3a9..d886ab6b0f 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/life_cycle_call_backs_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/life_cycle_call_backs_ability.cpp @@ -14,7 +14,7 @@ */ #include "life_cycle_call_backs_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "base_ability.h" #include "test_utils.h" @@ -89,7 +89,7 @@ void LifecycleCallbacksAbility::Init(const std::shared_ptr &ability const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("LifecycleCallbacksAbility::Init called."); + HILOG_INFO("LifecycleCallbacksAbility::Init called."); Ability::Init(abilityInfo, application, handler, token); @@ -106,7 +106,7 @@ std::string LifecycleCallbacksAbility::GetNoFromWantInfo(const Want &want) void LifecycleCallbacksAbility::OnStart(const Want &want) { - APP_LOGI("LifecycleCallbacksAbility::OnStart"); + HILOG_INFO("LifecycleCallbacksAbility::OnStart"); sequenceNumber_ = GetNoFromWantInfo(want); want_ = want; @@ -122,9 +122,10 @@ void LifecycleCallbacksAbility::StopSelfAbility() void LifecycleCallbacksEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("LifecycleCallbacksEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("LifecycleCallbacksEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("LifecycleCallbacksEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO( + "LifecycleCallbacksEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("LifecycleCallbacksEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("LifecycleCallbacksEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), APP_LIFE_CYCLE_CALL_BACKS_REQ_EVENT_NAME.c_str()) == 0) { @@ -133,7 +134,7 @@ void LifecycleCallbacksEventSubscriber::OnReceiveEvent(const CommonEventData &da if (func != mapTestFunc_.end()) { func->second(); } else { - APP_LOGI( + HILOG_INFO( "LifecycleCallbacksEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } @@ -151,7 +152,7 @@ bool LifecycleCallbacksAbility::SubscribeEvent() } void LifecycleCallbacksAbility::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("LifecycleCallbacksAbility::OnCommand"); + HILOG_INFO("LifecycleCallbacksAbility::OnCommand"); Ability::OnCommand(want, restart, startId); TestUtils::PublishEvent( @@ -159,13 +160,13 @@ void LifecycleCallbacksAbility::OnCommand(const AAFwk::Want &want, bool restart, } void LifecycleCallbacksAbility::OnNewWant(const Want &want) { - APP_LOGI("LifecycleCallbacksAbility::OnNewWant"); + HILOG_INFO("LifecycleCallbacksAbility::OnNewWant"); Ability::OnNewWant(want); } void LifecycleCallbacksAbility::OnStop() { - APP_LOGI("LifecycleCallbacksAbility::OnStop"); + HILOG_INFO("LifecycleCallbacksAbility::OnStop"); Ability::OnStop(); TestUtils::PublishEvent( @@ -173,7 +174,7 @@ void LifecycleCallbacksAbility::OnStop() } void LifecycleCallbacksAbility::OnActive() { - APP_LOGI("LifecycleCallbacksAbility::OnActive"); + HILOG_INFO("LifecycleCallbacksAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent( @@ -181,7 +182,7 @@ void LifecycleCallbacksAbility::OnActive() } void LifecycleCallbacksAbility::OnInactive() { - APP_LOGI("LifecycleCallbacksAbility::OnInactive"); + HILOG_INFO("LifecycleCallbacksAbility::OnInactive"); Ability::OnInactive(); TestUtils::PublishEvent( @@ -189,7 +190,7 @@ void LifecycleCallbacksAbility::OnInactive() } void LifecycleCallbacksAbility::OnBackground() { - APP_LOGI("LifecycleCallbacksAbility::OnBackground"); + HILOG_INFO("LifecycleCallbacksAbility::OnBackground"); Ability::OnBackground(); TestUtils::PublishEvent(APP_LIFE_CYCLE_CALL_BACKS_RESP_EVENT_NAME, @@ -199,7 +200,7 @@ void LifecycleCallbacksAbility::OnBackground() void LifecycleCallbacksAbility::OnForeground(const Want &want) { - APP_LOGI("LifecycleCallbacksAbility::OnForeground"); + HILOG_INFO("LifecycleCallbacksAbility::OnForeground"); Ability::OnForeground(want); TestUtils::PublishEvent( APP_LIFE_CYCLE_CALL_BACKS_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnForeground"); diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/life_cycle_observer_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/life_cycle_observer_ability.cpp index f0733fca77..e26f473777 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/life_cycle_observer_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestPageA/src/life_cycle_observer_ability.cpp @@ -14,7 +14,7 @@ */ #include "life_cycle_observer_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "base_ability.h" #include "test_utils.h" @@ -130,7 +130,7 @@ void LifeCycleObserverAbility::Init(const std::shared_ptr &abilityI const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("LifeCycleObserverAbility::Init called."); + HILOG_INFO("LifeCycleObserverAbility::Init called."); BaseAbility::Init(abilityInfo, application, handler, token); SubscribeEvent(); @@ -165,7 +165,7 @@ void LifeCycleObserverAbility::OnStart(const Want &want) { sequenceNumber_ = std::stoi(GetNoFromWantInfo(want)); want_ = want; - APP_LOGI("LifeCycleObserverAbility::OnStart"); + HILOG_INFO("LifeCycleObserverAbility::OnStart"); BaseAbility::OnStart(want); TestUtils::PublishEvent(APP_LIFE_CYCLE_OBSERVER_RESP_EVENT_NAME, LifeCycleObserverAbility::GetState(), "OnStart"); @@ -177,7 +177,7 @@ void LifeCycleObserverAbility::OnStart(const Want &want) void LifeCycleObserverAbility::OnStop() { - APP_LOGI("LifeCycleObserverAbility::OnStop"); + HILOG_INFO("LifeCycleObserverAbility::OnStop"); BaseAbility::OnStop(); TestUtils::PublishEvent(APP_LIFE_CYCLE_OBSERVER_RESP_EVENT_NAME, LifeCycleObserverAbility::GetState(), "OnStop"); @@ -188,7 +188,7 @@ void LifeCycleObserverAbility::OnStop() void LifeCycleObserverAbility::OnActive() { - APP_LOGI("LifeCycleObserverAbility::OnActive"); + HILOG_INFO("LifeCycleObserverAbility::OnActive"); BaseAbility::OnActive(); TestUtils::PublishEvent(APP_LIFE_CYCLE_OBSERVER_RESP_EVENT_NAME, LifeCycleObserverAbility::GetState(), "OnActive"); @@ -199,7 +199,7 @@ void LifeCycleObserverAbility::OnActive() void LifeCycleObserverAbility::OnInactive() { - APP_LOGI("LifeCycleObserverAbility::OnInactive"); + HILOG_INFO("LifeCycleObserverAbility::OnInactive"); BaseAbility::OnInactive(); TestUtils::PublishEvent( APP_LIFE_CYCLE_OBSERVER_RESP_EVENT_NAME, LifeCycleObserverAbility::GetState(), "OnInactive"); @@ -211,7 +211,7 @@ void LifeCycleObserverAbility::OnInactive() void LifeCycleObserverAbility::OnBackground() { - APP_LOGI("LifeCycleObserverAbility::OnBackground"); + HILOG_INFO("LifeCycleObserverAbility::OnBackground"); BaseAbility::OnBackground(); TestUtils::PublishEvent( APP_LIFE_CYCLE_OBSERVER_RESP_EVENT_NAME, LifeCycleObserverAbility::GetState(), "OnBackground"); @@ -223,7 +223,7 @@ void LifeCycleObserverAbility::OnBackground() void LifeCycleObserverAbility::OnForeground(const Want &want) { - APP_LOGI("LifeCycleObserverAbility::OnForeground"); + HILOG_INFO("LifeCycleObserverAbility::OnForeground"); BaseAbility::OnBackground(); TestUtils::PublishEvent( APP_LIFE_CYCLE_OBSERVER_RESP_EVENT_NAME, LifeCycleObserverAbility::GetState(), "OnForeground"); @@ -235,7 +235,7 @@ void LifeCycleObserverAbility::OnForeground(const Want &want) void LifeCycleObserverAbility::OnCommand(const Want &want, bool restart, int startId) { - APP_LOGI("LifeCycleObserverAbility::OnCommand"); + HILOG_INFO("LifeCycleObserverAbility::OnCommand"); BaseAbility::OnCommand(want, restart, startId); TestUtils::PublishEvent(APP_LIFE_CYCLE_OBSERVER_RESP_EVENT_NAME, LifeCycleObserverAbility::GetState(), "OnCommand"); @@ -247,7 +247,7 @@ void LifeCycleObserverAbility::OnCommand(const Want &want, bool restart, int sta sptr LifeCycleObserverAbility::OnConnect(const Want &want) { - APP_LOGI("LifeCycleObserverAbility::OnConnect"); + HILOG_INFO("LifeCycleObserverAbility::OnConnect"); sptr ret = BaseAbility::OnConnect(want); TestUtils::PublishEvent(APP_LIFE_CYCLE_OBSERVER_RESP_EVENT_NAME, LifeCycleObserverAbility::GetState(), "OnConnect"); @@ -260,7 +260,7 @@ sptr LifeCycleObserverAbility::OnConnect(const Want &want) void LifeCycleObserverAbility::OnDisconnect(const Want &want) { - APP_LOGI("LifeCycleObserverAbility::OnDisconnect"); + HILOG_INFO("LifeCycleObserverAbility::OnDisconnect"); BaseAbility::OnDisconnect(want); TestUtils::PublishEvent( @@ -761,10 +761,10 @@ void LifeCycleObserverAbility::TestLifeCycleRemoveObserver() void LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI( + HILOG_INFO( "LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), APP_LIFE_CYCLE_OBSERVER_REQ_EVENT_NAME.c_str()) == 0) { @@ -773,7 +773,7 @@ void LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent(const CommonEventDa if (func != mapTestFunc_.end()) { func->second(); } else { - APP_LOGI("LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", + HILOG_INFO("LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/BUILD.gn index e98c8c8803..977f19bf07 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/BUILD.gn @@ -22,6 +22,7 @@ config("amsKitSystemTestServiceconfig") { "${aafwk_path}/interfaces/innerkits/uri/include", "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${aafwk_path}/frameworks/kits/appkit/native/app", @@ -30,8 +31,8 @@ config("amsKitSystemTestServiceconfig") { "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsKitSystemTestService\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsKitSystemTestService\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsKitSystemTestService") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/ability_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/ability_ability.cpp index 3fbc8e2715..8e8cee67d3 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/ability_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/ability_ability.cpp @@ -14,7 +14,7 @@ */ #include "ability_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -34,7 +34,7 @@ void AbilityAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AbilityAbility::Init called."); + HILOG_INFO("AbilityAbility::Init called."); BaseAbility::Init(abilityInfo, application, handler, token); SubscribeEvent(); @@ -69,12 +69,12 @@ bool AbilityAbility::SubscribeEvent() void AbilityAbility::OnStart(const Want &want) { - APP_LOGI("AbilityAbility::OnStart"); + HILOG_INFO("AbilityAbility::OnStart"); sequenceNumber_ = GetNoFromWantInfo(want); - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s", sequenceNumber_.c_str()); + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s", sequenceNumber_.c_str()); want_ = want; - APP_LOGI("AbilityAbility::OnStart"); + HILOG_INFO("AbilityAbility::OnStart"); BaseAbility::OnStart(want); TestUtils::PublishEvent(APP_ABILITY_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnStart"); @@ -83,7 +83,7 @@ void AbilityAbility::OnStart(const Want &want) void AbilityAbility::OnStop() { - APP_LOGI("AbilityAbility::OnStop"); + HILOG_INFO("AbilityAbility::OnStop"); BaseAbility::OnStop(); TestUtils::PublishEvent(APP_ABILITY_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); @@ -93,7 +93,7 @@ void AbilityAbility::OnStop() void AbilityAbility::OnActive() { - APP_LOGI("AbilityAbility::OnActive"); + HILOG_INFO("AbilityAbility::OnActive"); BaseAbility::OnActive(); TestUtils::PublishEvent(APP_ABILITY_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); @@ -103,7 +103,7 @@ void AbilityAbility::OnActive() void AbilityAbility::OnInactive() { - APP_LOGI("AbilityAbility::OnInactive"); + HILOG_INFO("AbilityAbility::OnInactive"); BaseAbility::OnInactive(); TestUtils::PublishEvent( @@ -114,7 +114,7 @@ void AbilityAbility::OnInactive() void AbilityAbility::OnBackground() { - APP_LOGI("AbilityAbility::OnBackground"); + HILOG_INFO("AbilityAbility::OnBackground"); BaseAbility::OnBackground(); TestUtils::PublishEvent( @@ -125,7 +125,7 @@ void AbilityAbility::OnBackground() void AbilityAbility::OnForeground(const Want &want) { - APP_LOGI("AbilityAbility::OnForeground"); + HILOG_INFO("AbilityAbility::OnForeground"); BaseAbility::OnBackground(); TestUtils::PublishEvent( @@ -136,7 +136,7 @@ void AbilityAbility::OnForeground(const Want &want) void AbilityAbility::OnCommand(const Want &want, bool restart, int startId) { - APP_LOGI("AbilityAbility::OnCommand"); + HILOG_INFO("AbilityAbility::OnCommand"); BaseAbility::OnCommand(want, restart, startId); TestUtils::PublishEvent(APP_ABILITY_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnCommand"); @@ -146,7 +146,7 @@ void AbilityAbility::OnCommand(const Want &want, bool restart, int startId) sptr AbilityAbility::OnConnect(const Want &want) { - APP_LOGI("AbilityAbility::OnConnect"); + HILOG_INFO("AbilityAbility::OnConnect"); sptr ret = BaseAbility::OnConnect(want); TestUtils::PublishEvent(APP_ABILITY_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnConnect"); @@ -158,7 +158,7 @@ sptr AbilityAbility::OnConnect(const Want &want) void AbilityAbility::OnDisconnect(const Want &want) { - APP_LOGI("AbilityAbility::OnDisconnect"); + HILOG_INFO("AbilityAbility::OnDisconnect"); BaseAbility::OnDisconnect(want); TestUtils::PublishEvent( @@ -169,7 +169,7 @@ void AbilityAbility::OnDisconnect(const Want &want) void AbilityAbility::OnNewWant(const Want &want) { - APP_LOGI("AbilityAbility::OnNewWant"); + HILOG_INFO("AbilityAbility::OnNewWant"); BaseAbility::OnNewWant(want); TestUtils::PublishEvent( @@ -203,7 +203,7 @@ void AbilityAbility::CaseIndexTwo() void AbilityAbility::TestConnectAbility() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -254,7 +254,7 @@ void AbilityAbility::TestConnectAbility() void AbilityAbility::TestStopAbility() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -322,7 +322,7 @@ void AbilityAbility::DisconnectCaseIndexTwo() void AbilityAbility::TestDisconnectAbility() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -373,7 +373,7 @@ void AbilityAbility::TestDisconnectAbility() void AbilityAbility::TestStartAbility() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -420,7 +420,7 @@ void AbilityAbility::TestStartAbility() void AbilityAbility::TestTerminateAbility() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -475,7 +475,7 @@ void AbilityAbility::TestTerminateAbility() void AbilityAbility::TestAbilityStartAbility() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -526,7 +526,7 @@ void AbilityAbility::TestAbilityStartAbility() void AbilityAbility::TestAbilityConnectAbility() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -584,7 +584,7 @@ void AbilityAbility::TestAbilityConnectAbility() void AbilityAbility::TestAbilityStopAbility() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -636,7 +636,7 @@ void AbilityAbility::TestAbilityStopAbility() void AbilityAbility::TestAbilityGetLifecycle() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -707,7 +707,7 @@ void AbilityAbility::AbilityDisconnectCaseIndexTwo() void AbilityAbility::TestAbilityDisconnectAbility() { - APP_LOGI("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", + HILOG_INFO("AbilityAbility::OnStart sequenceNumber_ = %{public}s %{public}d", sequenceNumber_.c_str(), std::stoi(AbilityAbility::sequenceNumber_)); @@ -761,9 +761,9 @@ void AbilityAbility::TestAbilityDisconnectAbility() void AbilityAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("AbilityAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("AbilityAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("AbilityAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("AbilityAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("AbilityAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("AbilityAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), APP_ABILITY_REQ_EVENT_NAME.c_str()) == 0) { @@ -772,7 +772,7 @@ void AbilityAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (func != mapTestFunc_.end()) { func->second(); } else { - APP_LOGI( + HILOG_INFO( "AbilityAbilityEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/ability_connection_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/ability_connection_ability.cpp index 896e033611..73ef8b702d 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/ability_connection_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/ability_connection_ability.cpp @@ -14,7 +14,7 @@ */ #include "ability_connection_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "base_ability.h" namespace OHOS { @@ -30,7 +30,7 @@ void AbilityConnectionAbility::Init(const std::shared_ptr &abilityI const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AbilityConnectionAbility::Init called."); + HILOG_INFO("AbilityConnectionAbility::Init called."); BaseAbility::Init(abilityInfo, application, handler, token); SubscribeEvent(); @@ -51,7 +51,7 @@ void AbilityConnectionAbility::OnStart(const Want &want) { want_ = want; sequenceNumber_ = GetNoFromWantInfo(want); - APP_LOGI("AbilityConnectionAbility::OnStart"); + HILOG_INFO("AbilityConnectionAbility::OnStart"); BaseAbility::OnStart(want); TestUtils::PublishEvent( @@ -60,7 +60,7 @@ void AbilityConnectionAbility::OnStart(const Want &want) void AbilityConnectionAbility::OnStop() { - APP_LOGI("AbilityConnectionAbility::OnStop"); + HILOG_INFO("AbilityConnectionAbility::OnStop"); BaseAbility::OnStop(); TestUtils::PublishEvent( APP_ABILITY_CONNECTION_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); @@ -68,7 +68,7 @@ void AbilityConnectionAbility::OnStop() void AbilityConnectionAbility::OnActive() { - APP_LOGI("AbilityConnectionAbility::OnActive"); + HILOG_INFO("AbilityConnectionAbility::OnActive"); BaseAbility::OnActive(); TestUtils::PublishEvent( APP_ABILITY_CONNECTION_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); @@ -76,7 +76,7 @@ void AbilityConnectionAbility::OnActive() void AbilityConnectionAbility::OnInactive() { - APP_LOGI("AbilityConnectionAbility::OnInactive"); + HILOG_INFO("AbilityConnectionAbility::OnInactive"); BaseAbility::OnInactive(); TestUtils::PublishEvent( APP_ABILITY_CONNECTION_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); @@ -84,7 +84,7 @@ void AbilityConnectionAbility::OnInactive() void AbilityConnectionAbility::OnBackground() { - APP_LOGI("AbilityConnectionAbility::OnBackground"); + HILOG_INFO("AbilityConnectionAbility::OnBackground"); BaseAbility::OnBackground(); TestUtils::PublishEvent( APP_ABILITY_CONNECTION_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); @@ -92,7 +92,7 @@ void AbilityConnectionAbility::OnBackground() void AbilityConnectionAbility::OnForeground(const Want &want) { - APP_LOGI("AbilityConnectionAbility::OnForeground"); + HILOG_INFO("AbilityConnectionAbility::OnForeground"); BaseAbility::OnBackground(); TestUtils::PublishEvent( APP_ABILITY_CONNECTION_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnForeground"); @@ -100,7 +100,7 @@ void AbilityConnectionAbility::OnForeground(const Want &want) void AbilityConnectionAbility::OnCommand(const Want &want, bool restart, int startId) { - APP_LOGI("AbilityConnectionAbility::OnCommand"); + HILOG_INFO("AbilityConnectionAbility::OnCommand"); BaseAbility::OnCommand(want, restart, startId); TestUtils::PublishEvent( @@ -109,7 +109,7 @@ void AbilityConnectionAbility::OnCommand(const Want &want, bool restart, int sta sptr AbilityConnectionAbility::OnConnect(const Want &want) { - APP_LOGI("AbilityConnectionAbility::OnConnect"); + HILOG_INFO("AbilityConnectionAbility::OnConnect"); sptr ret = BaseAbility::OnConnect(want); TestUtils::PublishEvent( @@ -119,7 +119,7 @@ sptr AbilityConnectionAbility::OnConnect(const Want &want) void AbilityConnectionAbility::OnDisconnect(const Want &want) { - APP_LOGI("AbilityConnectionAbility::OnDisconnect"); + HILOG_INFO("AbilityConnectionAbility::OnDisconnect"); BaseAbility::OnDisconnect(want); TestUtils::PublishEvent( @@ -403,10 +403,10 @@ void AbilityConnectionAbility::TestTerminateAbility() void AbilityConnectionAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI( + HILOG_INFO( "AbilityConnectionAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("AbilityConnectionAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("AbilityConnectionAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("AbilityConnectionAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("AbilityConnectionAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), APP_ABILITY_CONNECTION_REQ_EVENT_NAME.c_str()) == 0) { @@ -415,7 +415,7 @@ void AbilityConnectionAbilityEventSubscriber::OnReceiveEvent(const CommonEventDa if (func != mapTestFunc_.end()) { func->second(); } else { - APP_LOGI("AbilityConnectionAbilityEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", + HILOG_INFO("AbilityConnectionAbilityEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/ability_context_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/ability_context_ability.cpp index 934641dfd2..f65aac8d31 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/ability_context_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/ability_context_ability.cpp @@ -14,7 +14,7 @@ */ #include "ability_context_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "base_ability.h" #include "test_utils.h" @@ -34,7 +34,7 @@ void AbilityContextAbility::Init(const std::shared_ptr &abilityInfo const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AbilityContextAbility::Init called."); + HILOG_INFO("AbilityContextAbility::Init called."); BaseAbility::Init(abilityInfo, application, handler, token); SubscribeEvent(); @@ -55,7 +55,7 @@ void AbilityContextAbility::OnStart(const Want &want) { want_ = want; sequenceNumber_ = std::stoi(GetNoFromWantInfo(want)); - APP_LOGI("AbilityContextAbility::OnStart"); + HILOG_INFO("AbilityContextAbility::OnStart"); BaseAbility::OnStart(want); TestUtils::PublishEvent( @@ -64,7 +64,7 @@ void AbilityContextAbility::OnStart(const Want &want) void AbilityContextAbility::OnStop() { - APP_LOGI("AbilityContextAbility::OnStop"); + HILOG_INFO("AbilityContextAbility::OnStop"); BaseAbility::OnStop(); TestUtils::PublishEvent( APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); @@ -72,7 +72,7 @@ void AbilityContextAbility::OnStop() void AbilityContextAbility::OnActive() { - APP_LOGI("AbilityContextAbility::OnActive"); + HILOG_INFO("AbilityContextAbility::OnActive"); BaseAbility::OnActive(); TestUtils::PublishEvent( APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); @@ -80,7 +80,7 @@ void AbilityContextAbility::OnActive() void AbilityContextAbility::OnInactive() { - APP_LOGI("AbilityContextAbility::OnInactive"); + HILOG_INFO("AbilityContextAbility::OnInactive"); BaseAbility::OnInactive(); TestUtils::PublishEvent( APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); @@ -88,7 +88,7 @@ void AbilityContextAbility::OnInactive() void AbilityContextAbility::OnBackground() { - APP_LOGI("AbilityContextAbility::OnBackground"); + HILOG_INFO("AbilityContextAbility::OnBackground"); BaseAbility::OnBackground(); TestUtils::PublishEvent( APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); @@ -96,7 +96,7 @@ void AbilityContextAbility::OnBackground() void AbilityContextAbility::OnForeground(const Want &want) { - APP_LOGI("AbilityContextAbility::OnForeground"); + HILOG_INFO("AbilityContextAbility::OnForeground"); BaseAbility::OnBackground(); TestUtils::PublishEvent( APP_ABILITY_CONTEXT_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnForeground"); @@ -104,7 +104,7 @@ void AbilityContextAbility::OnForeground(const Want &want) void AbilityContextAbility::OnCommand(const Want &want, bool restart, int startId) { - APP_LOGI("AbilityContextAbility::OnCommand"); + HILOG_INFO("AbilityContextAbility::OnCommand"); BaseAbility::OnCommand(want, restart, startId); TestUtils::PublishEvent( @@ -113,7 +113,7 @@ void AbilityContextAbility::OnCommand(const Want &want, bool restart, int startI sptr AbilityContextAbility::OnConnect(const Want &want) { - APP_LOGI("AbilityContextAbility::OnConnect"); + HILOG_INFO("AbilityContextAbility::OnConnect"); sptr ret = BaseAbility::OnConnect(want); TestUtils::PublishEvent( @@ -123,7 +123,7 @@ sptr AbilityContextAbility::OnConnect(const Want &want) void AbilityContextAbility::OnDisconnect(const Want &want) { - APP_LOGI("AbilityContextAbility::OnDisconnect"); + HILOG_INFO("AbilityContextAbility::OnDisconnect"); BaseAbility::OnDisconnect(want); TestUtils::PublishEvent( @@ -412,10 +412,10 @@ void AbilityContextAbility::TestTerminateAbility() void AbilityContextAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI( + HILOG_INFO( "AbilityContextAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("AbilityContextAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("AbilityContextAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("AbilityContextAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("AbilityContextAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), APP_ABILITY_CONTEXT_REQ_EVENT_NAME.c_str()) == 0) { @@ -424,7 +424,7 @@ void AbilityContextAbilityEventSubscriber::OnReceiveEvent(const CommonEventData if (func != mapTestFunc_.end()) { func->second(); } else { - APP_LOGI("AbilityContextAbilityEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", + HILOG_INFO("AbilityContextAbilityEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/ability_life_cycle_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/ability_life_cycle_ability.cpp index a25ab12d96..cbeada1033 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/ability_life_cycle_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/ability_life_cycle_ability.cpp @@ -14,7 +14,7 @@ */ #include "ability_life_cycle_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "base_ability.h" #include "test_utils.h" @@ -33,7 +33,7 @@ void AbilityLifeCycleAbility::Init(const std::shared_ptr &abilityIn const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AbilityLifeCycleAbility::Init called."); + HILOG_INFO("AbilityLifeCycleAbility::Init called."); BaseAbility::Init(abilityInfo, application, handler, token); SubscribeEvent(); @@ -59,7 +59,7 @@ void AbilityLifeCycleAbility::OnStart(const Want &want) { sequenceNumber_ = std::stoi(GetNoFromWantInfo(want)); want_ = want; - APP_LOGI("AbilityLifeCycleAbility::OnStart"); + HILOG_INFO("AbilityLifeCycleAbility::OnStart"); BaseAbility::OnStart(want); TestUtils::PublishEvent( @@ -72,7 +72,7 @@ void AbilityLifeCycleAbility::OnStart(const Want &want) void AbilityLifeCycleAbility::OnStop() { - APP_LOGI("AbilityLifeCycleAbility::OnStop"); + HILOG_INFO("AbilityLifeCycleAbility::OnStop"); BaseAbility::OnStop(); TestUtils::PublishEvent( APP_ABILITY_LIFE_CYCLE_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); @@ -84,7 +84,7 @@ void AbilityLifeCycleAbility::OnStop() void AbilityLifeCycleAbility::OnActive() { - APP_LOGI("AbilityLifeCycleAbility::OnActive"); + HILOG_INFO("AbilityLifeCycleAbility::OnActive"); BaseAbility::OnActive(); TestUtils::PublishEvent( APP_ABILITY_LIFE_CYCLE_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); @@ -96,7 +96,7 @@ void AbilityLifeCycleAbility::OnActive() void AbilityLifeCycleAbility::OnInactive() { - APP_LOGI("AbilityLifeCycleAbility::OnInactive"); + HILOG_INFO("AbilityLifeCycleAbility::OnInactive"); BaseAbility::OnInactive(); TestUtils::PublishEvent( APP_ABILITY_LIFE_CYCLE_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); @@ -108,7 +108,7 @@ void AbilityLifeCycleAbility::OnInactive() void AbilityLifeCycleAbility::OnBackground() { - APP_LOGI("AbilityLifeCycleAbility::OnBackground"); + HILOG_INFO("AbilityLifeCycleAbility::OnBackground"); BaseAbility::OnBackground(); TestUtils::PublishEvent( APP_ABILITY_LIFE_CYCLE_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); @@ -120,7 +120,7 @@ void AbilityLifeCycleAbility::OnBackground() void AbilityLifeCycleAbility::OnForeground(const Want &want) { - APP_LOGI("AbilityLifeCycleAbility::OnForeground"); + HILOG_INFO("AbilityLifeCycleAbility::OnForeground"); BaseAbility::OnBackground(); TestUtils::PublishEvent( APP_ABILITY_LIFE_CYCLE_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnForeground"); @@ -132,7 +132,7 @@ void AbilityLifeCycleAbility::OnForeground(const Want &want) void AbilityLifeCycleAbility::OnCommand(const Want &want, bool restart, int startId) { - APP_LOGI("AbilityLifeCycleAbility::OnCommand"); + HILOG_INFO("AbilityLifeCycleAbility::OnCommand"); BaseAbility::OnCommand(want, restart, startId); TestUtils::PublishEvent( @@ -145,7 +145,7 @@ void AbilityLifeCycleAbility::OnCommand(const Want &want, bool restart, int star sptr AbilityLifeCycleAbility::OnConnect(const Want &want) { - APP_LOGI("AbilityLifeCycleAbility::OnConnect"); + HILOG_INFO("AbilityLifeCycleAbility::OnConnect"); sptr ret = BaseAbility::OnConnect(want); TestUtils::PublishEvent( @@ -159,7 +159,7 @@ sptr AbilityLifeCycleAbility::OnConnect(const Want &want) void AbilityLifeCycleAbility::OnDisconnect(const Want &want) { - APP_LOGI("AbilityLifeCycleAbility::OnDisconnect"); + HILOG_INFO("AbilityLifeCycleAbility::OnDisconnect"); BaseAbility::OnDisconnect(want); TestUtils::PublishEvent( @@ -777,10 +777,10 @@ void AbilityLifeCycleAbility::TestLifeCycleRemoveObserver() void AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI( + HILOG_INFO( "AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), APP_ABILITY_LIFE_CYCLE_REQ_EVENT_NAME.c_str()) == 0) { @@ -789,7 +789,7 @@ void AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent(const CommonEventDat if (func != mapTestFunc_.end()) { func->second(); } else { - APP_LOGI("AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", + HILOG_INFO("AbilityLifeCycleAbilityEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/base_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/base_ability.cpp index 89e59465de..6286482879 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/base_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/base_ability.cpp @@ -15,7 +15,7 @@ */ #include "base_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -25,63 +25,63 @@ void BaseAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("BaseAbility::Init called."); + HILOG_INFO("BaseAbility::Init called."); Ability::Init(abilityInfo, application, handler, token); } void BaseAbility::OnStart(const Want &want) { - APP_LOGI("BaseAbility::OnStart"); + HILOG_INFO("BaseAbility::OnStart"); Ability::OnStart(want); } void BaseAbility::OnStop() { - APP_LOGI("BaseAbility::OnStop"); + HILOG_INFO("BaseAbility::OnStop"); Ability::OnStop(); } void BaseAbility::OnActive() { - APP_LOGI("BaseAbility::OnActive"); + HILOG_INFO("BaseAbility::OnActive"); Ability::OnActive(); } void BaseAbility::OnInactive() { - APP_LOGI("BaseAbility::OnInactive"); + HILOG_INFO("BaseAbility::OnInactive"); Ability::OnInactive(); } void BaseAbility::OnBackground() { - APP_LOGI("BaseAbility::OnBackground"); + HILOG_INFO("BaseAbility::OnBackground"); Ability::OnBackground(); } void BaseAbility::OnForeground(const Want &want) { - APP_LOGI("BaseAbility::OnForeground"); + HILOG_INFO("BaseAbility::OnForeground"); Ability::OnForeground(want); } void BaseAbility::OnCommand(const Want &want, bool restart, int startId) { - APP_LOGI("BaseAbility::OnCommand"); + HILOG_INFO("BaseAbility::OnCommand"); Ability::OnCommand(want, restart, startId); } sptr BaseAbility::OnConnect(const Want &want) { - APP_LOGI("BaseAbility::OnConnect"); + HILOG_INFO("BaseAbility::OnConnect"); sptr ret = Ability::OnConnect(want); return ret; @@ -89,14 +89,14 @@ sptr BaseAbility::OnConnect(const Want &want) void BaseAbility::OnDisconnect(const Want &want) { - APP_LOGI("BaseAbility::OnDisconnect"); + HILOG_INFO("BaseAbility::OnDisconnect"); Ability::OnDisconnect(want); } void BaseAbility::OnNewWant(const Want &want) { - APP_LOGI("BaseAbility::OnNewWant"); + HILOG_INFO("BaseAbility::OnNewWant"); Ability::OnNewWant(want); } diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/life_cycle_call_backs_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/life_cycle_call_backs_ability.cpp index ada1a15a3a..f9d760c8b0 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/life_cycle_call_backs_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/life_cycle_call_backs_ability.cpp @@ -14,7 +14,7 @@ */ #include "life_cycle_call_backs_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "base_ability.h" #include "test_utils.h" @@ -88,7 +88,7 @@ void LifecycleCallbacksAbility::Init(const std::shared_ptr &ability const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("LifecycleCallbacksAbility::Init called."); + HILOG_INFO("LifecycleCallbacksAbility::Init called."); Ability::Init(abilityInfo, application, handler, token); @@ -105,7 +105,7 @@ std::string LifecycleCallbacksAbility::GetNoFromWantInfo(const Want &want) void LifecycleCallbacksAbility::OnStart(const Want &want) { - APP_LOGI("LifecycleCallbacksAbility::OnStart"); + HILOG_INFO("LifecycleCallbacksAbility::OnStart"); sequenceNumber_ = GetNoFromWantInfo(want); @@ -121,9 +121,10 @@ void LifecycleCallbacksAbility::StopSelfAbility() void LifecycleCallbacksEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("LifecycleCallbacksEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("LifecycleCallbacksEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("LifecycleCallbacksEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO( + "LifecycleCallbacksEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("LifecycleCallbacksEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("LifecycleCallbacksEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), APP_LIFE_CYCLE_CALL_BACKS_REQ_EVENT_NAME.c_str()) == 0) { @@ -132,7 +133,7 @@ void LifecycleCallbacksEventSubscriber::OnReceiveEvent(const CommonEventData &da if (func != mapTestFunc_.end()) { func->second(); } else { - APP_LOGI( + HILOG_INFO( "LifecycleCallbacksEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } @@ -150,7 +151,7 @@ bool LifecycleCallbacksAbility::SubscribeEvent() } void LifecycleCallbacksAbility::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("LifecycleCallbacksAbility::OnCommand"); + HILOG_INFO("LifecycleCallbacksAbility::OnCommand"); Ability::OnCommand(want, restart, startId); TestUtils::PublishEvent( @@ -158,13 +159,13 @@ void LifecycleCallbacksAbility::OnCommand(const AAFwk::Want &want, bool restart, } void LifecycleCallbacksAbility::OnNewWant(const Want &want) { - APP_LOGI("LifecycleCallbacksAbility::OnNewWant"); + HILOG_INFO("LifecycleCallbacksAbility::OnNewWant"); Ability::OnNewWant(want); } void LifecycleCallbacksAbility::OnStop() { - APP_LOGI("LifecycleCallbacksAbility::OnStop"); + HILOG_INFO("LifecycleCallbacksAbility::OnStop"); Ability::OnStop(); TestUtils::PublishEvent( @@ -172,7 +173,7 @@ void LifecycleCallbacksAbility::OnStop() } void LifecycleCallbacksAbility::OnActive() { - APP_LOGI("LifecycleCallbacksAbility::OnActive"); + HILOG_INFO("LifecycleCallbacksAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent( @@ -180,7 +181,7 @@ void LifecycleCallbacksAbility::OnActive() } void LifecycleCallbacksAbility::OnInactive() { - APP_LOGI("LifecycleCallbacksAbility::OnInactive"); + HILOG_INFO("LifecycleCallbacksAbility::OnInactive"); Ability::OnInactive(); TestUtils::PublishEvent( @@ -188,7 +189,7 @@ void LifecycleCallbacksAbility::OnInactive() } void LifecycleCallbacksAbility::OnBackground() { - APP_LOGI("LifecycleCallbacksAbility::OnBackground"); + HILOG_INFO("LifecycleCallbacksAbility::OnBackground"); Ability::OnBackground(); TestUtils::PublishEvent(APP_LIFE_CYCLE_CALL_BACKS_RESP_EVENT_NAME, diff --git a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/life_cycle_observer_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/life_cycle_observer_ability.cpp index a5559b0e1b..e856c07eb2 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/life_cycle_observer_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsKitSystemTestService/src/life_cycle_observer_ability.cpp @@ -14,7 +14,7 @@ */ #include "life_cycle_observer_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "base_ability.h" #include "test_utils.h" @@ -132,7 +132,7 @@ void LifeCycleObserverAbility::Init(const std::shared_ptr &abilityI const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("LifeCycleObserverAbility::Init called."); + HILOG_INFO("LifeCycleObserverAbility::Init called."); BaseAbility::Init(abilityInfo, application, handler, token); SubscribeEvent(); lifecycleCallbacks_ = std::make_shared(); @@ -172,7 +172,7 @@ void LifeCycleObserverAbility::OnStart(const Want &want) void LifeCycleObserverAbility::OnStop() { - APP_LOGI("LifeCycleObserverAbility::OnStop"); + HILOG_INFO("LifeCycleObserverAbility::OnStop"); BaseAbility::OnStop(); TestUtils::PublishEvent( APP_LIFE_CYCLE_OBSERVER_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); @@ -184,7 +184,7 @@ void LifeCycleObserverAbility::OnStop() void LifeCycleObserverAbility::OnActive() { - APP_LOGI("LifeCycleObserverAbility::OnActive"); + HILOG_INFO("LifeCycleObserverAbility::OnActive"); BaseAbility::OnActive(); TestUtils::PublishEvent( APP_LIFE_CYCLE_OBSERVER_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); @@ -196,7 +196,7 @@ void LifeCycleObserverAbility::OnActive() void LifeCycleObserverAbility::OnInactive() { - APP_LOGI("LifeCycleObserverAbility::OnInactive"); + HILOG_INFO("LifeCycleObserverAbility::OnInactive"); BaseAbility::OnInactive(); TestUtils::PublishEvent( APP_LIFE_CYCLE_OBSERVER_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); @@ -208,7 +208,7 @@ void LifeCycleObserverAbility::OnInactive() void LifeCycleObserverAbility::OnBackground() { - APP_LOGI("LifeCycleObserverAbility::OnBackground"); + HILOG_INFO("LifeCycleObserverAbility::OnBackground"); BaseAbility::OnBackground(); TestUtils::PublishEvent( APP_LIFE_CYCLE_OBSERVER_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); @@ -220,7 +220,7 @@ void LifeCycleObserverAbility::OnBackground() void LifeCycleObserverAbility::OnForeground(const Want &want) { - APP_LOGI("LifeCycleObserverAbility::OnForeground"); + HILOG_INFO("LifeCycleObserverAbility::OnForeground"); BaseAbility::OnBackground(); TestUtils::PublishEvent( APP_LIFE_CYCLE_OBSERVER_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnForeground"); @@ -232,7 +232,7 @@ void LifeCycleObserverAbility::OnForeground(const Want &want) void LifeCycleObserverAbility::OnCommand(const Want &want, bool restart, int startId) { - APP_LOGI("LifeCycleObserverAbility::OnCommand"); + HILOG_INFO("LifeCycleObserverAbility::OnCommand"); BaseAbility::OnCommand(want, restart, startId); TestUtils::PublishEvent( @@ -245,7 +245,7 @@ void LifeCycleObserverAbility::OnCommand(const Want &want, bool restart, int sta sptr LifeCycleObserverAbility::OnConnect(const Want &want) { - APP_LOGI("LifeCycleObserverAbility::OnConnect"); + HILOG_INFO("LifeCycleObserverAbility::OnConnect"); sptr ret = BaseAbility::OnConnect(want); TestUtils::PublishEvent( @@ -259,7 +259,7 @@ sptr LifeCycleObserverAbility::OnConnect(const Want &want) void LifeCycleObserverAbility::OnDisconnect(const Want &want) { - APP_LOGI("LifeCycleObserverAbility::OnDisconnect"); + HILOG_INFO("LifeCycleObserverAbility::OnDisconnect"); BaseAbility::OnDisconnect(want); TestUtils::PublishEvent( @@ -755,10 +755,10 @@ void LifeCycleObserverAbility::TestLifeCycleRemoveObserver() void LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI( + HILOG_INFO( "LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), APP_LIFE_CYCLE_OBSERVER_REQ_EVENT_NAME.c_str()) == 0) { @@ -767,7 +767,7 @@ void LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent(const CommonEventDa if (func != mapTestFunc_.end()) { func->second(); } else { - APP_LOGI("LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", + HILOG_INFO("LifeCycleObserverAbilityEventSubscriber::OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } diff --git a/test/resource/amssystemtestability/abilitySrc/amsMissionStackTest/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsMissionStackTest/BUILD.gn index 9516c93dc0..bb362dc452 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsMissionStackTest/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsMissionStackTest/BUILD.gn @@ -31,8 +31,8 @@ config("amsMissionStackTestConfig") { "${SUBST_TOOLS_DIR}/include", ] defines = [ - "APP_LOG_TAG = \"amsMissionStackTest\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsMissionStackTest\"", + "AMS_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsMissionStackTest/src/main_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsMissionStackTest/src/main_ability.cpp index 4084128d4e..c0fbef9fc4 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsMissionStackTest/src/main_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsMissionStackTest/src/main_ability.cpp @@ -14,7 +14,7 @@ */ #include "main_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -29,7 +29,7 @@ void MainAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("MainAbility::Init"); + HILOG_INFO("MainAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } @@ -40,7 +40,7 @@ MainAbility::~MainAbility() void MainAbility::OnStart(const Want &want) { - APP_LOGI("MainAbility::OnStart"); + HILOG_INFO("MainAbility::OnStart"); SubscribeEvent(); Ability::OnStart(want); TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, MAIN_ABILITY_CODE, "OnStart"); @@ -48,7 +48,7 @@ void MainAbility::OnStart(const Want &want) void MainAbility::OnStop() { - APP_LOGI("MainAbility::OnStop"); + HILOG_INFO("MainAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, MAIN_ABILITY_CODE, "OnStop"); @@ -56,41 +56,41 @@ void MainAbility::OnStop() void MainAbility::OnActive() { - APP_LOGI("MainAbility::OnActive"); + HILOG_INFO("MainAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, MAIN_ABILITY_CODE, "OnActive"); } void MainAbility::OnInactive() { - APP_LOGI("MainAbility::OnInactive"); + HILOG_INFO("MainAbility::OnInactive"); Ability::OnInactive(); TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, MAIN_ABILITY_CODE, "OnInactive"); } void MainAbility::OnBackground() { - APP_LOGI("MainAbility::OnBackground"); + HILOG_INFO("MainAbility::OnBackground"); Ability::OnBackground(); TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, MAIN_ABILITY_CODE, "OnBackground"); } void MainAbility::OnForeground(const Want &want) { - APP_LOGI("MainAbility::OnForeground"); + HILOG_INFO("MainAbility::OnForeground"); Ability::OnForeground(want); TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, MAIN_ABILITY_CODE, "OnForeground"); } void MainAbility::OnRestoreAbilityState(const PacMap &inState) { - APP_LOGI("MainAbility::OnRestoreAbilityState"); + HILOG_INFO("MainAbility::OnRestoreAbilityState"); Ability::OnRestoreAbilityState(inState); TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, MAIN_ABILITY_CODE, "OnRestoreAbilityState"); } void MainAbility::OnSaveAbilityState(PacMap &outState) { - APP_LOGI("MainAbility::OnSaveAbilityState"); + HILOG_INFO("MainAbility::OnSaveAbilityState"); Ability::OnSaveAbilityState(outState); TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE, MAIN_ABILITY_CODE, "OnSaveAbilityState"); } @@ -113,9 +113,9 @@ void MainAbility::SubscribeEvent() void FirstEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), g_EVENT_REQU_MAIN.c_str()) == 0) { auto target = data.GetData(); @@ -126,14 +126,14 @@ void FirstEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (mapTestFunc_.find(caseInfo[index_f]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[index_f]](std::stoi(caseInfo[index_s]), std::stoi(caseInfo[index_t]), data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } void MainAbility::TestAbility(int apiIndex, int caseIndex, int code) { - APP_LOGI("MainAbility::TestAbility"); + HILOG_INFO("MainAbility::TestAbility"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); @@ -143,7 +143,7 @@ void MainAbility::TestAbility(int apiIndex, int caseIndex, int code) void MainAbility::MissionStackCase1(int code) { - APP_LOGI("MainAbility::MissionStackCase1"); + HILOG_INFO("MainAbility::MissionStackCase1"); bool result = true; std::map params; Want want = TestUtils::MakeWant("", "SecondAbility", "com.ohos.amsst.MissionStack", params); @@ -152,7 +152,7 @@ void MainAbility::MissionStackCase1(int code) } void MainAbility::MissionStackCase2(int code) { - APP_LOGI("MainAbility::MissionStackCase2"); + HILOG_INFO("MainAbility::MissionStackCase2"); bool result = true; LockMission(); TestUtils::PublishEvent(g_EVENT_RESP_MAIN, code, std::to_string(result)); @@ -160,7 +160,7 @@ void MainAbility::MissionStackCase2(int code) } void MainAbility::MissionStackCase3(int code) { - APP_LOGI("MainAbility::MissionStackCase3"); + HILOG_INFO("MainAbility::MissionStackCase3"); bool result = true; LockMission(); TestUtils::PublishEvent(g_EVENT_RESP_MAIN, code, std::to_string(result)); @@ -177,7 +177,7 @@ void MainAbility::MissionStackCase5(int code) } void MainAbility::MissionStackCase6(int code) { - APP_LOGI("MainAbility::MissionStackCase6"); + HILOG_INFO("MainAbility::MissionStackCase6"); bool result = true; LockMission(); std::map params; @@ -187,7 +187,7 @@ void MainAbility::MissionStackCase6(int code) } void MainAbility::MissionStackCase7(int code) { - APP_LOGI("MainAbility::MissionStackCase7"); + HILOG_INFO("MainAbility::MissionStackCase7"); bool result = true; LockMission(); UnlockMission(); @@ -200,7 +200,7 @@ void MainAbility::MissionStackCase8(int code) } void MainAbility::MissionStackCase9(int code) { - APP_LOGI("MainAbility::MissionStackCase9"); + HILOG_INFO("MainAbility::MissionStackCase9"); bool result = true; std::map params; Want want = TestUtils::MakeWant("", "SecondAbility", "com.ohos.amsst.MissionStack", params); @@ -209,7 +209,7 @@ void MainAbility::MissionStackCase9(int code) } void MainAbility::MissionStackCase10(int code) { - APP_LOGI("MainAbility::MissionStackCase10"); + HILOG_INFO("MainAbility::MissionStackCase10"); bool result = true; int missionId = GetMissionId(); result = missionId >= 0; @@ -217,7 +217,7 @@ void MainAbility::MissionStackCase10(int code) } void MainAbility::MissionStackCase11(int code) { - APP_LOGI("MainAbility::MissionStackCase11"); + HILOG_INFO("MainAbility::MissionStackCase11"); bool result = true; std::map params; Want want = TestUtils::MakeWant("", "SecondAbility", "com.ohos.amsst.MissionStack", params); @@ -226,31 +226,31 @@ void MainAbility::MissionStackCase11(int code) } void MainAbility::MissionStackCase12(int code) { - APP_LOGI("MainAbility::MissionStackCase12"); + HILOG_INFO("MainAbility::MissionStackCase12"); bool result = true; result = MoveMissionToEnd(true); if (result) { - APP_LOGI("MainAbility::MissionStackCase12 MoveMissionToEnd(true)true ====> %{public}d", result); + HILOG_INFO("MainAbility::MissionStackCase12 MoveMissionToEnd(true)true ====> %{public}d", result); } else { - APP_LOGI("MainAbility::MissionStackCase12 MoveMissionToEnd(true)false ====> %{public}d", result); + HILOG_INFO("MainAbility::MissionStackCase12 MoveMissionToEnd(true)false ====> %{public}d", result); } TestUtils::PublishEvent(g_EVENT_RESP_MAIN, code, std::to_string(result)); } void MainAbility::MissionStackCase13(int code) { - APP_LOGI("MainAbility::MissionStackCase13"); + HILOG_INFO("MainAbility::MissionStackCase13"); bool result = true; result = MoveMissionToEnd(false); if (result) { - APP_LOGI("MainAbility::MissionStackCase13 MoveMissionToEnd(false)true ====> %{public}d", result); + HILOG_INFO("MainAbility::MissionStackCase13 MoveMissionToEnd(false)true ====> %{public}d", result); } else { - APP_LOGI("MainAbility::MissionStackCase13 MoveMissionToEnd(false)false ====> %{public}d", result); + HILOG_INFO("MainAbility::MissionStackCase13 MoveMissionToEnd(false)false ====> %{public}d", result); } TestUtils::PublishEvent(g_EVENT_RESP_MAIN, code, std::to_string(result)); } void MainAbility::MissionStackCase14(int code) { - APP_LOGI("MainAbility::MissionStackCase14"); + HILOG_INFO("MainAbility::MissionStackCase14"); bool result = true; std::map params; Want want = TestUtils::MakeWant("", "SecondAbility", "com.ohos.amsst.MissionStack", params); @@ -259,7 +259,7 @@ void MainAbility::MissionStackCase14(int code) } void MainAbility::MissionStackCase15(int code) { - APP_LOGI("MainAbility::MissionStackCase15"); + HILOG_INFO("MainAbility::MissionStackCase15"); bool result = true; std::map params; Want want = TestUtils::MakeWant("", "SecondAbility", "com.ohos.amsst.MissionStack", params); @@ -268,26 +268,26 @@ void MainAbility::MissionStackCase15(int code) } void MainAbility::MissionStackCase16(int code) { - APP_LOGI("MainAbility::MissionStackCase16"); + HILOG_INFO("MainAbility::MissionStackCase16"); bool result = true; TestUtils::PublishEvent(g_EVENT_RESP_MAIN, code, std::to_string(result)); } void MainAbility::MissionStackCase17(int code) { - APP_LOGI("MainAbility::MissionStackCase17"); + HILOG_INFO("MainAbility::MissionStackCase17"); bool result = true; TestUtils::PublishEvent(g_EVENT_RESP_MAIN, code, std::to_string(result)); } void MainAbility::MissionStackCase18(int code) { - APP_LOGI("MainAbility::MissionStackCase18"); + HILOG_INFO("MainAbility::MissionStackCase18"); bool result = true; LockMission(); result = MoveMissionToEnd(false); if (result) { - APP_LOGI("MainAbility::MissionStackCase18 MoveMissionToEnd(false)true ====> %{public}d", result); + HILOG_INFO("MainAbility::MissionStackCase18 MoveMissionToEnd(false)true ====> %{public}d", result); } else { - APP_LOGI("MainAbility::MissionStackCase18 MoveMissionToEnd(false)false ====> %{public}d", result); + HILOG_INFO("MainAbility::MissionStackCase18 MoveMissionToEnd(false)false ====> %{public}d", result); } TestUtils::PublishEvent(g_EVENT_RESP_MAIN, code, std::to_string(result)); } diff --git a/test/resource/amssystemtestability/abilitySrc/amsMissionStackTest/src/second_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsMissionStackTest/src/second_ability.cpp index 7c56b71123..cc4dd2b03f 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsMissionStackTest/src/second_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsMissionStackTest/src/second_ability.cpp @@ -14,7 +14,7 @@ */ #include "second_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -29,7 +29,7 @@ void SecondAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("SecondAbility::Init"); + HILOG_INFO("SecondAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } @@ -40,7 +40,7 @@ SecondAbility::~SecondAbility() void SecondAbility::OnStart(const Want &want) { - APP_LOGI("SecondAbility::OnStart"); + HILOG_INFO("SecondAbility::OnStart"); SubscribeEvent(); Ability::OnStart(want); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SECOND_ABILITY_CODE, "OnStart"); @@ -48,7 +48,7 @@ void SecondAbility::OnStart(const Want &want) void SecondAbility::OnStop() { - APP_LOGI("SecondAbility::OnStop"); + HILOG_INFO("SecondAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SECOND_ABILITY_CODE, "OnStop"); @@ -56,41 +56,41 @@ void SecondAbility::OnStop() void SecondAbility::OnActive() { - APP_LOGI("SecondAbility::OnActive"); + HILOG_INFO("SecondAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SECOND_ABILITY_CODE, "OnActive"); } void SecondAbility::OnInactive() { - APP_LOGI("SecondAbility::OnInactive"); + HILOG_INFO("SecondAbility::OnInactive"); Ability::OnInactive(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SECOND_ABILITY_CODE, "OnInactive"); } void SecondAbility::OnBackground() { - APP_LOGI("SecondAbility::OnBackground"); + HILOG_INFO("SecondAbility::OnBackground"); Ability::OnBackground(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SECOND_ABILITY_CODE, "OnBackground"); } void SecondAbility::OnForeground(const Want &want) { - APP_LOGI("SecondAbility::OnForeground"); + HILOG_INFO("SecondAbility::OnForeground"); Ability::OnForeground(want); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SECOND_ABILITY_CODE, "OnForeground"); } void SecondAbility::OnRestoreAbilityState(const PacMap &inState) { - APP_LOGI("SecondAbility::OnRestoreAbilityState"); + HILOG_INFO("SecondAbility::OnRestoreAbilityState"); Ability::OnRestoreAbilityState(inState); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SECOND_ABILITY_CODE, "OnRestoreAbilityState"); } void SecondAbility::OnSaveAbilityState(PacMap &outState) { - APP_LOGI("SecondAbility::OnSaveAbilityState"); + HILOG_INFO("SecondAbility::OnSaveAbilityState"); Ability::OnSaveAbilityState(outState); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE, SECOND_ABILITY_CODE, "OnSaveAbilityState"); } @@ -113,9 +113,9 @@ void SecondAbility::SubscribeEvent() void SecondEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), g_EVENT_REQU_SECOND.c_str()) == 0) { auto target = data.GetData(); @@ -126,14 +126,14 @@ void SecondEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (mapTestFunc_.find(caseInfo[index_f]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[index_f]](std::stoi(caseInfo[index_s]), std::stoi(caseInfo[index_t]), data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } void SecondAbility::TestAbility(int apiIndex, int caseIndex, int code) { - APP_LOGI("SecondAbility::TestAbility"); + HILOG_INFO("SecondAbility::TestAbility"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); @@ -214,43 +214,43 @@ void SecondAbility::MissionStackCase13(int code) } void SecondAbility::MissionStackCase14(int code) { - APP_LOGI("SecondAbility::MissionStackCase14"); + HILOG_INFO("SecondAbility::MissionStackCase14"); bool result = true; result = MoveMissionToEnd(true); if (result) { - APP_LOGI("SecondAbility::MissionStackCase14 MoveMissionToEnd(true)true ====> %{public}d", result); + HILOG_INFO("SecondAbility::MissionStackCase14 MoveMissionToEnd(true)true ====> %{public}d", result); } else { - APP_LOGI("SecondAbility::MissionStackCase14 MoveMissionToEnd(true)false ====> %{public}d", result); + HILOG_INFO("SecondAbility::MissionStackCase14 MoveMissionToEnd(true)false ====> %{public}d", result); } TestUtils::PublishEvent(g_EVENT_RESP_SECOND, code, std::to_string(result)); } void SecondAbility::MissionStackCase15(int code) { - APP_LOGI("SecondAbility::MissionStackCase15"); + HILOG_INFO("SecondAbility::MissionStackCase15"); bool result = true; result = MoveMissionToEnd(false); if (result) { - APP_LOGI("SecondAbility::MissionStackCase15 MoveMissionToEnd(false)true ====> %{public}d", result); + HILOG_INFO("SecondAbility::MissionStackCase15 MoveMissionToEnd(false)true ====> %{public}d", result); } else { - APP_LOGI("SecondAbility::MissionStackCase15 MoveMissionToEnd(false)false ====> %{public}d", result); + HILOG_INFO("SecondAbility::MissionStackCase15 MoveMissionToEnd(false)false ====> %{public}d", result); } TestUtils::PublishEvent(g_EVENT_RESP_SECOND, code, std::to_string(result)); } void SecondAbility::MissionStackCase16(int code) { - APP_LOGI("SecondAbility::MissionStackCase16"); + HILOG_INFO("SecondAbility::MissionStackCase16"); bool result = true; TestUtils::PublishEvent(g_EVENT_RESP_SECOND, code, std::to_string(result)); } void SecondAbility::MissionStackCase17(int code) { - APP_LOGI("SecondAbility::MissionStackCase17"); + HILOG_INFO("SecondAbility::MissionStackCase17"); bool result = true; TestUtils::PublishEvent(g_EVENT_RESP_SECOND, code, std::to_string(result)); } void SecondAbility::MissionStackCase18(int code) { - APP_LOGI("SecondAbility::MissionStackCase18"); + HILOG_INFO("SecondAbility::MissionStackCase18"); bool result = true; TestUtils::PublishEvent(g_EVENT_RESP_SECOND, code, std::to_string(result)); } diff --git a/test/resource/amssystemtestability/abilitySrc/amsMissionStackTest/src/third_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsMissionStackTest/src/third_ability.cpp index 59b7c1e793..91667dfa1d 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsMissionStackTest/src/third_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsMissionStackTest/src/third_ability.cpp @@ -14,7 +14,7 @@ */ #include "third_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -29,7 +29,7 @@ void ThirdAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("ThirdAbility::Init"); + HILOG_INFO("ThirdAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } @@ -40,7 +40,7 @@ ThirdAbility::~ThirdAbility() void ThirdAbility::OnStart(const Want &want) { - APP_LOGI("ThirdAbility::OnStart"); + HILOG_INFO("ThirdAbility::OnStart"); SubscribeEvent(); Ability::OnStart(want); TestUtils::PublishEvent(g_EVENT_RESP_THIRD_LIFECYCLE, THIRD_ABILITY_CODE, "OnStart"); @@ -48,7 +48,7 @@ void ThirdAbility::OnStart(const Want &want) void ThirdAbility::OnStop() { - APP_LOGI("ThirdAbility::OnStop"); + HILOG_INFO("ThirdAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); TestUtils::PublishEvent(g_EVENT_RESP_THIRD_LIFECYCLE, THIRD_ABILITY_CODE, "OnStop"); @@ -56,41 +56,41 @@ void ThirdAbility::OnStop() void ThirdAbility::OnActive() { - APP_LOGI("ThirdAbility::OnActive"); + HILOG_INFO("ThirdAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent(g_EVENT_RESP_THIRD_LIFECYCLE, THIRD_ABILITY_CODE, "OnActive"); } void ThirdAbility::OnInactive() { - APP_LOGI("ThirdAbility::OnInactive"); + HILOG_INFO("ThirdAbility::OnInactive"); Ability::OnInactive(); TestUtils::PublishEvent(g_EVENT_RESP_THIRD_LIFECYCLE, THIRD_ABILITY_CODE, "OnInactive"); } void ThirdAbility::OnBackground() { - APP_LOGI("ThirdAbility::OnBackground"); + HILOG_INFO("ThirdAbility::OnBackground"); Ability::OnBackground(); TestUtils::PublishEvent(g_EVENT_RESP_THIRD_LIFECYCLE, THIRD_ABILITY_CODE, "OnBackground"); } void ThirdAbility::OnForeground(const Want &want) { - APP_LOGI("ThirdAbility::OnForeground"); + HILOG_INFO("ThirdAbility::OnForeground"); Ability::OnForeground(want); TestUtils::PublishEvent(g_EVENT_RESP_THIRD_LIFECYCLE, THIRD_ABILITY_CODE, "OnForeground"); } void ThirdAbility::OnRestoreAbilityState(const PacMap &inState) { - APP_LOGI("ThirdAbility::OnRestoreAbilityState"); + HILOG_INFO("ThirdAbility::OnRestoreAbilityState"); Ability::OnRestoreAbilityState(inState); TestUtils::PublishEvent(g_EVENT_RESP_THIRD_LIFECYCLE, THIRD_ABILITY_CODE, "OnRestoreAbilityState"); } void ThirdAbility::OnSaveAbilityState(PacMap &outState) { - APP_LOGI("ThirdAbility::OnSaveAbilityState"); + HILOG_INFO("ThirdAbility::OnSaveAbilityState"); Ability::OnSaveAbilityState(outState); TestUtils::PublishEvent(g_EVENT_RESP_THIRD_LIFECYCLE, THIRD_ABILITY_CODE, "OnSaveAbilityState"); } @@ -113,9 +113,9 @@ void ThirdAbility::SubscribeEvent() void ThirdEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("ThirdEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("ThirdEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("ThirdEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("ThirdEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("ThirdEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("ThirdEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), g_EVENT_REQU_THIRD.c_str()) == 0) { auto target = data.GetData(); @@ -126,14 +126,14 @@ void ThirdEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (mapTestFunc_.find(caseInfo[index_f]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[index_f]](std::stoi(caseInfo[index_s]), std::stoi(caseInfo[index_t]), data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } void ThirdAbility::TestAbility(int apiIndex, int caseIndex, int code) { - APP_LOGI("ThirdAbility::TestAbility"); + HILOG_INFO("ThirdAbility::TestAbility"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); diff --git a/test/resource/amssystemtestability/abilitySrc/amsMissionStackTestSubsidiary/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsMissionStackTestSubsidiary/BUILD.gn index 34c44f937d..f198a79e37 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsMissionStackTestSubsidiary/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsMissionStackTestSubsidiary/BUILD.gn @@ -31,8 +31,8 @@ config("amsMissionStackTestSubsidiaryConfig") { "${SUBST_TOOLS_DIR}/include", ] defines = [ - "APP_LOG_TAG = \"amsMissionStackTestSubsidiary\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsMissionStackTestSubsidiary\"", + "AMS_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsMissionStackTestSubsidiary/src/main_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsMissionStackTestSubsidiary/src/main_ability.cpp index 1494ddd3b7..4fa17f84c3 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsMissionStackTestSubsidiary/src/main_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsMissionStackTestSubsidiary/src/main_ability.cpp @@ -14,7 +14,7 @@ */ #include "main_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -30,7 +30,7 @@ void MainAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("MainAbility::Init"); + HILOG_INFO("MainAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } @@ -41,7 +41,7 @@ MainAbility::~MainAbility() void MainAbility::OnStart(const Want &want) { - APP_LOGI("MainAbility::OnStart"); + HILOG_INFO("MainAbility::OnStart"); SubscribeEvent(); Ability::OnStart(want); callbackSeq += "OnStart"; @@ -50,7 +50,7 @@ void MainAbility::OnStart(const Want &want) void MainAbility::OnStop() { - APP_LOGI("MainAbility::OnStop"); + HILOG_INFO("MainAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); callbackSeq = "OnStop"; @@ -60,7 +60,7 @@ void MainAbility::OnStop() void MainAbility::OnActive() { - APP_LOGI("MainAbility::OnActive====<"); + HILOG_INFO("MainAbility::OnActive====<"); Ability::OnActive(); callbackSeq = "OnActive"; TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE_SUBSIDIARY, MAIN_ABILITY_CODE_SUBSIDIARY, callbackSeq); @@ -69,7 +69,7 @@ void MainAbility::OnActive() void MainAbility::OnConfigurationUpdated(const Configuration &configuration) { - APP_LOGI("MainAbility::OnConfigurationUpdated====<"); + HILOG_INFO("MainAbility::OnConfigurationUpdated====<"); Ability::OnConfigurationUpdated(configuration); callbackUpdated += "Updated"; // UpdatedUpdated TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE_SUBSIDIARY, MAIN_ABILITY_CODE_SUBSIDIARY, callbackUpdated); @@ -77,7 +77,7 @@ void MainAbility::OnConfigurationUpdated(const Configuration &configuration) void MainAbility::OnInactive() { - APP_LOGI("MainAbility::OnInactive"); + HILOG_INFO("MainAbility::OnInactive"); Ability::OnInactive(); callbackSeq += "OnInactive"; TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE_SUBSIDIARY, MAIN_ABILITY_CODE_SUBSIDIARY, "OnInactive"); @@ -85,7 +85,7 @@ void MainAbility::OnInactive() void MainAbility::OnBackground() { - APP_LOGI("MainAbility::OnBackground"); + HILOG_INFO("MainAbility::OnBackground"); Ability::OnBackground(); callbackSeq += "OnBackground"; TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE_SUBSIDIARY, MAIN_ABILITY_CODE_SUBSIDIARY, "OnBackground"); @@ -93,7 +93,7 @@ void MainAbility::OnBackground() void MainAbility::OnForeground(const Want &want) { - APP_LOGI("MainAbility::OnForeground"); + HILOG_INFO("MainAbility::OnForeground"); Ability::OnForeground(want); callbackSeq += "OnForeground"; TestUtils::PublishEvent(g_EVENT_RESP_MAIN_LIFECYCLE_SUBSIDIARY, MAIN_ABILITY_CODE_SUBSIDIARY, "OnForeground"); @@ -117,9 +117,9 @@ void MainAbility::SubscribeEvent() void MainAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("MainAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("MainAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("MainAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("MainAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("MainAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("MainAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), g_EVENT_REQU_MAIN_SUBSIDIARY.c_str()) == 0) { auto target = data.GetData(); @@ -130,14 +130,14 @@ void MainAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (mapTestFunc_.find(caseInfo[index_f]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[index_f]](std::stoi(caseInfo[index_s]), std::stoi(caseInfo[index_t]), data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } void MainAbility::TestAbility(int apiIndex, int caseIndex, int code) { - APP_LOGI("MainAbility::TestAbility"); + HILOG_INFO("MainAbility::TestAbility"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); @@ -147,7 +147,7 @@ void MainAbility::TestAbility(int apiIndex, int caseIndex, int code) void MainAbility::MissionStackCase1(int code) { - APP_LOGI("MainAbility::MissionStackCase1"); + HILOG_INFO("MainAbility::MissionStackCase1"); bool result = true; std::map params; Want want = TestUtils::MakeWant("", "SecondAbility", "com.ohos.amsst.MissionStackSubsidiary", params); @@ -158,25 +158,25 @@ void MainAbility::MissionStackCase1(int code) void MainAbility::MissionStackCase2(int code) { - APP_LOGI("MainAbility::MissionStackCase2"); + HILOG_INFO("MainAbility::MissionStackCase2"); bool result = true; result = MoveMissionToEnd(true); if (result) { - APP_LOGI("MainAbility::MissionStackCase2 MoveMissionToEnd(true)true ====> %{public}d", result); + HILOG_INFO("MainAbility::MissionStackCase2 MoveMissionToEnd(true)true ====> %{public}d", result); } else { - APP_LOGI("MainAbility::MissionStackCase2 MoveMissionToEnd(true)false ====> %{public}d", result); + HILOG_INFO("MainAbility::MissionStackCase2 MoveMissionToEnd(true)false ====> %{public}d", result); } TestUtils::PublishEvent(g_EVENT_RESP_MAIN_SUBSIDIARY, code, std::to_string(result)); } void MainAbility::MissionStackCase3(int code) { - APP_LOGI("MainAbility::MissionStackCase3"); + HILOG_INFO("MainAbility::MissionStackCase3"); bool result = true; result = MoveMissionToEnd(false); if (result) { - APP_LOGI("MainAbility::MissionStackCase3 MoveMissionToEnd(false)true ====> %{public}d", result); + HILOG_INFO("MainAbility::MissionStackCase3 MoveMissionToEnd(false)true ====> %{public}d", result); } else { - APP_LOGI("MainAbility::MissionStackCase3 MoveMissionToEnd(false)false ====> %{public}d", result); + HILOG_INFO("MainAbility::MissionStackCase3 MoveMissionToEnd(false)false ====> %{public}d", result); } TestUtils::PublishEvent(g_EVENT_RESP_MAIN_SUBSIDIARY, code, std::to_string(result)); } diff --git a/test/resource/amssystemtestability/abilitySrc/amsMissionStackTestSubsidiary/src/second_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsMissionStackTestSubsidiary/src/second_ability.cpp index 913eedc54a..b46da2b70f 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsMissionStackTestSubsidiary/src/second_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsMissionStackTestSubsidiary/src/second_ability.cpp @@ -14,7 +14,7 @@ */ #include "second_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -30,7 +30,7 @@ void SecondAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("SecondAbility::Init"); + HILOG_INFO("SecondAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } @@ -41,7 +41,7 @@ SecondAbility::~SecondAbility() void SecondAbility::OnStart(const Want &want) { - APP_LOGI("SecondAbility::OnStart"); + HILOG_INFO("SecondAbility::OnStart"); SubscribeEvent(); Ability::OnStart(want); callbackSeq += "OnStart"; @@ -50,7 +50,7 @@ void SecondAbility::OnStart(const Want &want) void SecondAbility::OnStop() { - APP_LOGI("SecondAbility::OnStop"); + HILOG_INFO("SecondAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); callbackSeq = "OnStop"; @@ -60,7 +60,7 @@ void SecondAbility::OnStop() void SecondAbility::OnActive() { - APP_LOGI("SecondAbility::OnActive====<"); + HILOG_INFO("SecondAbility::OnActive====<"); Ability::OnActive(); callbackSeq = "OnActive"; TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE_SUBSIDIARY, SECOND_ABILITY_CODE_SUBSIDIARY, callbackSeq); @@ -69,7 +69,7 @@ void SecondAbility::OnActive() void SecondAbility::OnConfigurationUpdated(const Configuration &configuration) { - APP_LOGI("SecondAbility::OnConfigurationUpdated====<"); + HILOG_INFO("SecondAbility::OnConfigurationUpdated====<"); Ability::OnConfigurationUpdated(configuration); callbackUpdated += "Updated"; // UpdatedUpdated TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE_SUBSIDIARY, SECOND_ABILITY_CODE_SUBSIDIARY, callbackUpdated); @@ -77,7 +77,7 @@ void SecondAbility::OnConfigurationUpdated(const Configuration &configuration) void SecondAbility::OnInactive() { - APP_LOGI("SecondAbility::OnInactive"); + HILOG_INFO("SecondAbility::OnInactive"); Ability::OnInactive(); callbackSeq += "OnInactive"; TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE_SUBSIDIARY, SECOND_ABILITY_CODE_SUBSIDIARY, "OnInactive"); @@ -85,7 +85,7 @@ void SecondAbility::OnInactive() void SecondAbility::OnBackground() { - APP_LOGI("SecondAbility::OnBackground"); + HILOG_INFO("SecondAbility::OnBackground"); Ability::OnBackground(); callbackSeq += "OnBackground"; TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE_SUBSIDIARY, SECOND_ABILITY_CODE_SUBSIDIARY, "OnBackground"); @@ -93,7 +93,7 @@ void SecondAbility::OnBackground() void SecondAbility::OnForeground(const Want &want) { - APP_LOGI("SecondAbility::OnForeground"); + HILOG_INFO("SecondAbility::OnForeground"); Ability::OnForeground(want); callbackSeq += "OnForeground"; TestUtils::PublishEvent(g_EVENT_RESP_SECOND_LIFECYCLE_SUBSIDIARY, SECOND_ABILITY_CODE_SUBSIDIARY, "OnForeground"); @@ -101,14 +101,14 @@ void SecondAbility::OnForeground(const Want &want) void SecondAbility::OnRestoreAbilityState(const PacMap &inState) { - APP_LOGI("SecondAbility::OnRestoreAbilityState"); + HILOG_INFO("SecondAbility::OnRestoreAbilityState"); Ability::OnRestoreAbilityState(inState); TestUtils::PublishEvent( g_EVENT_RESP_SECOND_LIFECYCLE_SUBSIDIARY, SECOND_ABILITY_CODE_SUBSIDIARY, "OnRestoreAbilityState"); } void SecondAbility::OnSaveAbilityState(PacMap &outState) { - APP_LOGI("SecondAbility::OnSaveAbilityState"); + HILOG_INFO("SecondAbility::OnSaveAbilityState"); Ability::OnSaveAbilityState(outState); TestUtils::PublishEvent( g_EVENT_RESP_SECOND_LIFECYCLE_SUBSIDIARY, SECOND_ABILITY_CODE_SUBSIDIARY, "OnSaveAbilityState"); @@ -132,9 +132,9 @@ void SecondAbility::SubscribeEvent() void SecondAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("SecondAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("SecondAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("SecondAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("SecondAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("SecondAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("SecondAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), g_EVENT_REQU_SECOND.c_str()) == 0) { auto target = data.GetData(); @@ -145,14 +145,14 @@ void SecondAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (mapTestFunc_.find(caseInfo[index_f]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[index_f]](std::stoi(caseInfo[index_s]), std::stoi(caseInfo[index_t]), data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } void SecondAbility::TestAbility(int apiIndex, int caseIndex, int code) { - APP_LOGI("SecondAbility::TestAbility"); + HILOG_INFO("SecondAbility::TestAbility"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); @@ -162,7 +162,7 @@ void SecondAbility::TestAbility(int apiIndex, int caseIndex, int code) void SecondAbility::MissionStackCase1(int code) { - APP_LOGI("SecondAbility::MissionStackCase1====<"); + HILOG_INFO("SecondAbility::MissionStackCase1====<"); bool result = true; result = true; diff --git a/test/resource/amssystemtestability/abilitySrc/amsMissionStackTestSubsidiary/src/third_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsMissionStackTestSubsidiary/src/third_ability.cpp index b15f3e21b4..c76107009f 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsMissionStackTestSubsidiary/src/third_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsMissionStackTestSubsidiary/src/third_ability.cpp @@ -14,7 +14,7 @@ */ #include "third_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" namespace OHOS { @@ -26,7 +26,7 @@ void ThirdAbility::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("ThirdAbility::Init"); + HILOG_INFO("ThirdAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } @@ -37,7 +37,7 @@ ThirdAbility::~ThirdAbility() void ThirdAbility::OnStart(const Want &want) { - APP_LOGI("ThirdAbility::OnStart"); + HILOG_INFO("ThirdAbility::OnStart"); SubscribeEvent(); Ability::OnStart(want); callbackSeq += "OnStart"; @@ -46,7 +46,7 @@ void ThirdAbility::OnStart(const Want &want) void ThirdAbility::OnStop() { - APP_LOGI("ThirdAbility::OnStop"); + HILOG_INFO("ThirdAbility::OnStop"); Ability::OnStop(); callbackSeq += "OnStop"; // OnInactiveOnBackgroundOnStop CommonEventManager::UnSubscribeCommonEvent(subscriber_); @@ -56,7 +56,7 @@ void ThirdAbility::OnStop() void ThirdAbility::OnActive() { - APP_LOGI("ThirdAbility::OnActive====<"); + HILOG_INFO("ThirdAbility::OnActive====<"); Ability::OnActive(); callbackSeq += "OnActive"; // OnStartOnActive TestUtils::PublishEvent(g_EVENT_RESP_THIRD_LIFECYCLE, THIRD_ABILITY_CODE, callbackSeq); @@ -65,7 +65,7 @@ void ThirdAbility::OnActive() void ThirdAbility::OnConfigurationUpdated(const Configuration &configuration) { - APP_LOGI("ThirdAbility::OnConfigurationUpdated====<"); + HILOG_INFO("ThirdAbility::OnConfigurationUpdated====<"); Ability::OnConfigurationUpdated(configuration); callbackUpdated += "Updated"; // UpdatedUpdated TestUtils::PublishEvent(g_EVENT_RESP_THIRD_LIFECYCLE, THIRD_ABILITY_CODE, callbackUpdated); @@ -73,7 +73,7 @@ void ThirdAbility::OnConfigurationUpdated(const Configuration &configuration) void ThirdAbility::OnInactive() { - APP_LOGI("ThirdAbility::OnInactive"); + HILOG_INFO("ThirdAbility::OnInactive"); Ability::OnInactive(); callbackSeq += "OnInactive"; TestUtils::PublishEvent(g_EVENT_RESP_THIRD_LIFECYCLE, THIRD_ABILITY_CODE, "OnInactive"); @@ -81,7 +81,7 @@ void ThirdAbility::OnInactive() void ThirdAbility::OnBackground() { - APP_LOGI("ThirdAbility::OnBackground"); + HILOG_INFO("ThirdAbility::OnBackground"); Ability::OnBackground(); callbackSeq += "OnBackground"; TestUtils::PublishEvent(g_EVENT_RESP_THIRD_LIFECYCLE, THIRD_ABILITY_CODE, "OnBackground"); @@ -89,7 +89,7 @@ void ThirdAbility::OnBackground() void ThirdAbility::OnForeground(const Want &want) { - APP_LOGI("ThirdAbility::OnForeground"); + HILOG_INFO("ThirdAbility::OnForeground"); Ability::OnForeground(want); callbackSeq += "OnForeground"; TestUtils::PublishEvent(g_EVENT_RESP_THIRD_LIFECYCLE, THIRD_ABILITY_CODE, "OnForeground"); @@ -113,15 +113,15 @@ void ThirdAbility::SubscribeEvent() void ThirdAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("ThirdAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("ThirdAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("ThirdAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("ThirdAbilityEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("ThirdAbilityEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("ThirdAbilityEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); } void ThirdAbility::TestAbility(int apiIndex, int caseIndex, int code) { - APP_LOGI("ThirdAbility::TestAbility"); + HILOG_INFO("ThirdAbility::TestAbility"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); diff --git a/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/BUILD.gn index be6b0320ce..121b77c08e 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/BUILD.gn @@ -27,12 +27,13 @@ config("verify_act_ability_config") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${EVENT_DIR}/kits/native/include", ] defines = [ - "APP_LOG_TAG = \"amsStDataAbility\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsStDataAbility\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } config("verify_act_ability_public_config") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/src/verify_act_data_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/src/verify_act_data_ability.cpp index b5bcbb9676..3dee118c56 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/src/verify_act_data_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/src/verify_act_data_ability.cpp @@ -17,7 +17,7 @@ #include "data_ability_predicates.h" #include "values_bucket.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ability_loader.h" #include "verify_act_data_ability.h" @@ -48,14 +48,14 @@ int InsertTestOpenCallback::OnUpgrade(NativeRdb::RdbStore &store, int oldVersion void VerifyActDataAbility::OnStart(const Want &want) { - APP_LOGI("VerifyActDataAbility OnStart"); + HILOG_INFO("VerifyActDataAbility OnStart"); sharedList_.clear(); Ability::OnStart(want); } int VerifyActDataAbility::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) { - APP_LOGI("VerifyActDataAbility <<<>>>"); + HILOG_INFO("VerifyActDataAbility <<<>>>"); return defaultReturn; } @@ -67,7 +67,7 @@ std::shared_ptr VerifyActDataAbility::Query( NativeRdb::RdbStoreConfig config(dbDir + "/" + DATABASE_FILE_NAME); InsertTestOpenCallback helper; testStore = NativeRdb::RdbHelper::GetRdbStore(config, 1, helper, errCode); - APP_LOGI("VerifyActDataAbility <<<>>> Patch %{public}s", (dbDir + "/" + DATABASE_FILE_NAME).c_str()); + HILOG_INFO("VerifyActDataAbility <<<>>> Patch %{public}s", (dbDir + "/" + DATABASE_FILE_NAME).c_str()); int64_t id; NativeRdb::ValuesBucket values; @@ -82,19 +82,19 @@ std::shared_ptr VerifyActDataAbility::Query( values.PutBlob("blobType", std::vector {1, 2, 3}); if (testStore == nullptr) { - APP_LOGI("VerifyActDataAbility <<<>>> testStore is nullptr, data will be empty"); + HILOG_INFO("VerifyActDataAbility <<<>>> testStore is nullptr, data will be empty"); return nullptr; } if (testStore->Replace(id, "test", values) != 0) { - APP_LOGE("VerifyActDataAbility <<<>>> store->Replace Error"); + HILOG_ERROR("VerifyActDataAbility <<<>>> store->Replace Error"); return nullptr; } std::unique_ptr rresultSet = testStore->QuerySql("SELECT * FROM test WHERE name = ?", std::vector {"zhangsan"}); if (rresultSet == nullptr) { - APP_LOGE("VerifyActDataAbility <<<>>> rresultSet is nullptr"); + HILOG_ERROR("VerifyActDataAbility <<<>>> rresultSet is nullptr"); return nullptr; } @@ -106,28 +106,28 @@ std::shared_ptr VerifyActDataAbility::Query( int VerifyActDataAbility::Update( const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("VerifyActDataAbility <<<>>>"); + HILOG_INFO("VerifyActDataAbility <<<>>>"); return defaultReturn; } int VerifyActDataAbility::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("VerifyActDataAbility <<<>>>"); + HILOG_INFO("VerifyActDataAbility <<<>>>"); return defaultReturn; } std::string VerifyActDataAbility::GetType(const Uri &uri) { - APP_LOGI("VerifyActDataAbility <<<>>>"); + HILOG_INFO("VerifyActDataAbility <<<>>>"); std::string retval(uri.ToString()); return retval; } int VerifyActDataAbility::OpenFile(const Uri &uri, const std::string &mode) { - APP_LOGI("VerifyActDataAbility <<<>>>"); + HILOG_INFO("VerifyActDataAbility <<<>>>"); return 0; } int VerifyActDataAbility::BatchInsert(const Uri &uri, const std::vector &values) { - APP_LOGI("VerifyActDataAbility <<<>>>"); + HILOG_INFO("VerifyActDataAbility <<<>>>"); return Ability::BatchInsert(uri, values); } diff --git a/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/src/verify_act_data_ability2.cpp b/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/src/verify_act_data_ability2.cpp index 51606531b0..55360e176b 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/src/verify_act_data_ability2.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/src/verify_act_data_ability2.cpp @@ -17,7 +17,7 @@ #include "data_ability_predicates.h" #include "values_bucket.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ability_loader.h" #include "verify_act_data_ability2.h" @@ -48,14 +48,14 @@ int InsertTestOpenCallback2::OnUpgrade(NativeRdb::RdbStore &store, int oldVersio void VerifyActDataAbility2::OnStart(const Want &want) { - APP_LOGI("VerifyActDataAbility2 OnStart"); + HILOG_INFO("VerifyActDataAbility2 OnStart"); sharedList_.clear(); Ability::OnStart(want); } int VerifyActDataAbility2::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) { - APP_LOGI("VerifyActDataAbility2 <<<>>>"); + HILOG_INFO("VerifyActDataAbility2 <<<>>>"); return defaultReturn; } @@ -67,7 +67,7 @@ std::shared_ptr VerifyActDataAbility2::Query( NativeRdb::RdbStoreConfig config(dbDir + "/" + DATABASE_FILE_NAME); InsertTestOpenCallback2 helper; testStore = NativeRdb::RdbHelper::GetRdbStore(config, 1, helper, errCode); - APP_LOGI("VerifyActDataAbility2 <<<>>> Patch %{public}s", (dbDir + "/" + DATABASE_FILE_NAME).c_str()); + HILOG_INFO("VerifyActDataAbility2 <<<>>> Patch %{public}s", (dbDir + "/" + DATABASE_FILE_NAME).c_str()); int64_t id; NativeRdb::ValuesBucket values; @@ -82,23 +82,23 @@ std::shared_ptr VerifyActDataAbility2::Query( values.PutBlob("blobType", std::vector {1, 2, 3}); if (testStore == nullptr) { - APP_LOGI("VerifyActDataAbility2 <<<>>> testStore is nullptr, data will be empty"); + HILOG_INFO("VerifyActDataAbility2 <<<>>> testStore is nullptr, data will be empty"); return nullptr; } if (testStore->Replace(id, "test", values) != 0) { - APP_LOGE("VerifyActDataAbility2 <<<>>> store->Replace Error"); + HILOG_ERROR("VerifyActDataAbility2 <<<>>> store->Replace Error"); return nullptr; } std::unique_ptr rresultSet = testStore->QuerySql("SELECT * FROM test WHERE name = ?", std::vector {"zhangsan"}); if (rresultSet == nullptr) { - APP_LOGE("VerifyActDataAbility2 <<<>>> rresultSet is nullptr"); + HILOG_ERROR("VerifyActDataAbility2 <<<>>> rresultSet is nullptr"); return nullptr; } - APP_LOGI("VerifyActDataAbility2 <<<>>> Marshalling Object"); + HILOG_INFO("VerifyActDataAbility2 <<<>>> Marshalling Object"); std::shared_ptr ret(rresultSet.release()); sharedList_.push_back(ret); return ret; @@ -107,28 +107,28 @@ std::shared_ptr VerifyActDataAbility2::Query( int VerifyActDataAbility2::Update( const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("VerifyActDataAbility2 <<<>>>"); + HILOG_INFO("VerifyActDataAbility2 <<<>>>"); return defaultReturn; } int VerifyActDataAbility2::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) { - APP_LOGI("VerifyActDataAbility2 <<<>>>"); + HILOG_INFO("VerifyActDataAbility2 <<<>>>"); return defaultReturn; } std::string VerifyActDataAbility2::GetType(const Uri &uri) { - APP_LOGI("VerifyActDataAbility2 <<<>>>"); + HILOG_INFO("VerifyActDataAbility2 <<<>>>"); std::string retval(uri.ToString()); return retval; } int VerifyActDataAbility2::OpenFile(const Uri &uri, const std::string &mode) { - APP_LOGI("VerifyActDataAbility2 <<<>>>"); + HILOG_INFO("VerifyActDataAbility2 <<<>>>"); return 0; } int VerifyActDataAbility2::BatchInsert(const Uri &uri, const std::vector &values) { - APP_LOGI("VerifyActDataAbility2 <<<>>>"); + HILOG_INFO("VerifyActDataAbility2 <<<>>>"); return Ability::BatchInsert(uri, values); } diff --git a/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/src/verify_act_page_ability.cpp b/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/src/verify_act_page_ability.cpp index 2c4790a5f5..0b721e504e 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/src/verify_act_page_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/src/verify_act_page_ability.cpp @@ -17,14 +17,14 @@ #include "data_ability_predicates.h" #include "values_bucket.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "verify_act_page_ability.h" namespace OHOS { namespace AppExecFwk { void VerifyActPageAbility::OnStart(const Want &want) { - APP_LOGI("----------VerifyActPageAbility::onStart begin----------"); + HILOG_INFO("----------VerifyActPageAbility::onStart begin----------"); // Test DataAbility EventFwk::MatchingSkills MatchingSkillsDataAbility; MatchingSkillsDataAbility.AddEvent("Test_DataAbility"); @@ -33,69 +33,69 @@ void VerifyActPageAbility::OnStart(const Want &want) EventFwk::CommonEventManager::SubscribeCommonEvent(subscriberDataAbility); subscriberDataAbility->DataAbility_ = Ability::GetContext(); - APP_LOGI("----------VerifyActPageAbility::onStart end----------"); + HILOG_INFO("----------VerifyActPageAbility::onStart end----------"); Ability::OnStart(want); } void VerifyActPageAbility::OnStop() { - APP_LOGI("----------VerifyActPageAbility::onStop begin----------"); + HILOG_INFO("----------VerifyActPageAbility::onStop begin----------"); if (subscriberDataAbility != nullptr) { EventFwk::CommonEventManager::UnSubscribeCommonEvent(subscriberDataAbility); } - APP_LOGI("----------VerifyActPageAbility::onStop end----------"); - APP_LOGI("----------VerifyActPageAbility::onStop TimerThreadDestoryBegin----------"); - APP_LOGI("----------VerifyActPageAbility::onStop TimerThreadDestoryEnd----------"); + HILOG_INFO("----------VerifyActPageAbility::onStop end----------"); + HILOG_INFO("----------VerifyActPageAbility::onStop TimerThreadDestoryBegin----------"); + HILOG_INFO("----------VerifyActPageAbility::onStop TimerThreadDestoryEnd----------"); Ability::OnStop(); } void VerifyActPageAbility::OnActive() { - APP_LOGI("----------VerifyActPageAbility::OnActive begin----------"); - APP_LOGI("----------VerifyActPageAbility::OnActive end----------"); + HILOG_INFO("----------VerifyActPageAbility::OnActive begin----------"); + HILOG_INFO("----------VerifyActPageAbility::OnActive end----------"); Ability::OnActive(); } void VerifyActPageAbility::OnInactive() { - APP_LOGI("----------VerifyActPageAbility::OnInactive begin----------"); - APP_LOGI("----------VerifyActPageAbility::OnInactive end----------"); + HILOG_INFO("----------VerifyActPageAbility::OnInactive begin----------"); + HILOG_INFO("----------VerifyActPageAbility::OnInactive end----------"); Ability::OnInactive(); } void VerifyActPageAbility::OnBackground() { - APP_LOGI("----------VerifyActPageAbility::OnBackground begin----------"); - APP_LOGI("----------VerifyActPageAbility::OnBackground end----------"); + HILOG_INFO("----------VerifyActPageAbility::OnBackground begin----------"); + HILOG_INFO("----------VerifyActPageAbility::OnBackground end----------"); Ability::OnBackground(); } void VerifyActPageAbility::OnForeground(const Want &want) { - APP_LOGI("----------VerifyActPageAbility::OnForeground begin----------"); - APP_LOGI("----------VerifyActPageAbility::OnForeground end----------"); + HILOG_INFO("----------VerifyActPageAbility::OnForeground begin----------"); + HILOG_INFO("----------VerifyActPageAbility::OnForeground end----------"); Ability::OnForeground(want); } void CommentDataAbilityTest::OnReceiveEvent(const EventFwk::CommonEventData &data) { - APP_LOGI("----------OnReceiveEvent---------DataAbility_%{public}ld", DataAbility_.use_count()); + HILOG_INFO("----------OnReceiveEvent---------DataAbility_%{public}ld", DataAbility_.use_count()); auto dataAbility = DataAbility_.lock(); if (dataAbility == nullptr) { return; } - APP_LOGI("----------OnReceiveEvent----------dataAbility%{public}ld", dataAbility.use_count()); + HILOG_INFO("----------OnReceiveEvent----------dataAbility%{public}ld", dataAbility.use_count()); std::shared_ptr uri = std::make_shared("dataability:///com.ix.VerifyActDataAbility"); std::shared_ptr helper = DataAbilityHelper::Creator(dataAbility, uri, false); if (helper != nullptr) { - APP_LOGI("-----------OnReceiveEvent helper isn't null-----------"); + HILOG_INFO("-----------OnReceiveEvent helper isn't null-----------"); Uri uri_DataAbility("dataability:///com.ix.VerifyActDataAbility"); - APP_LOGI("-----------OnReceiveEvent data.GetCode() ====%{public}d ---------", data.GetCode()); + HILOG_INFO("-----------OnReceiveEvent data.GetCode() ====%{public}d ---------", data.GetCode()); switch (data.GetCode()) { case INSERT: { NativeRdb::ValuesBucket valueBucket; int result = helper->Insert(uri_DataAbility, valueBucket); - APP_LOGI("-----------insertTest::OnReceiveEvent result = %{public}d", result); + HILOG_INFO("-----------insertTest::OnReceiveEvent result = %{public}d", result); break; } case DELETE: { NativeRdb::DataAbilityPredicates dataAbilityPredicate("dumy Predicates"); int result = helper->Delete(uri_DataAbility, dataAbilityPredicate); - APP_LOGI("-----------deleteTest::OnReceiveEvent result = %{public}d", result); + HILOG_INFO("-----------deleteTest::OnReceiveEvent result = %{public}d", result); break; } default: diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/BUILD.gn index 9e3df4220d..3d2e268ffc 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/BUILD.gn @@ -24,13 +24,14 @@ config("amsSystemTestAConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestA\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestA\"", + "AMS_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/include/amsstabilitya1.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/include/amsstabilitya1.h index cd9c821e3d..a89a89cbe0 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/include/amsstabilitya1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/include/amsstabilitya1.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/include/amsstabilitya2.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/include/amsstabilitya2.h index 6ca95cad8a..775333d948 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/include/amsstabilitya2.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/include/amsstabilitya2.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/src/amsstabilitya1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/src/amsstabilitya1.cpp index 1c7a0d712d..0390c58291 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/src/amsstabilitya1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/src/amsstabilitya1.cpp @@ -21,7 +21,7 @@ void AmsStAbilityA1::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityA1::onStart"); + HILOG_INFO("AmsStAbilityA1::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityA1::OnStart(const Want &want) void AmsStAbilityA1::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityA1::OnNewWant"); + HILOG_INFO("AmsStAbilityA1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityA1::OnNewWant(const Want &want) void AmsStAbilityA1::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityA1::OnForeground"); + HILOG_INFO("AmsStAbilityA1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityA1::OnForeground(const Want &want) void AmsStAbilityA1::OnStop() { - APP_LOGI("AmsStAbilityA1::onStop"); + HILOG_INFO("AmsStAbilityA1::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityA1::OnStop() void AmsStAbilityA1::OnActive() { - APP_LOGI("AmsStAbilityA1::OnActive"); + HILOG_INFO("AmsStAbilityA1::OnActive"); Ability::OnActive(); if (!targetBundle.empty() && !targetAbility.empty()) { Want want; @@ -73,7 +73,7 @@ void AmsStAbilityA1::OnActive() void AmsStAbilityA1::OnInactive() { - APP_LOGI("AmsStAbilityA1::OnInactive"); + HILOG_INFO("AmsStAbilityA1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -81,7 +81,7 @@ void AmsStAbilityA1::OnInactive() void AmsStAbilityA1::OnBackground() { - APP_LOGI("AmsStAbilityA1::OnBackground"); + HILOG_INFO("AmsStAbilityA1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/src/amsstabilitya2.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/src/amsstabilitya2.cpp index 92f5ee7d67..e6ad1daec3 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/src/amsstabilitya2.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestA/src/amsstabilitya2.cpp @@ -21,7 +21,7 @@ void AmsStAbilityA2::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityA2::onStart"); + HILOG_INFO("AmsStAbilityA2::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityA2::OnStart(const Want &want) void AmsStAbilityA2::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityA2::OnForeground"); + HILOG_INFO("AmsStAbilityA2::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityA2::OnForeground(const Want &want) void AmsStAbilityA2::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityA2::OnNewWant"); + HILOG_INFO("AmsStAbilityA2::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityA2::OnNewWant(const Want &want) void AmsStAbilityA2::OnStop() { - APP_LOGI("AmsStAbilityA2::onStop"); + HILOG_INFO("AmsStAbilityA2::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityA2::OnStop() void AmsStAbilityA2::OnActive() { - APP_LOGI("AmsStAbilityA2::OnActive"); + HILOG_INFO("AmsStAbilityA2::OnActive"); Ability::OnActive(); if (std::string::npos != shouldReturn.find(GetAbilityName())) { TerminateAbility(); @@ -67,7 +67,7 @@ void AmsStAbilityA2::OnActive() void AmsStAbilityA2::OnInactive() { - APP_LOGI("AmsStAbilityA2::OnInactive"); + HILOG_INFO("AmsStAbilityA2::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -75,7 +75,7 @@ void AmsStAbilityA2::OnInactive() void AmsStAbilityA2::OnBackground() { - APP_LOGI("AmsStAbilityA2::OnBackground"); + HILOG_INFO("AmsStAbilityA2::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestB/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestB/BUILD.gn index c8603f4200..bca9a7c5f7 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestB/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestB/BUILD.gn @@ -24,13 +24,14 @@ config("amsSystemTestBConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestB\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestB\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestB") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestB/include/amsstabilityb1.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestB/include/amsstabilityb1.h index 001bd07cdc..a5138c02c9 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestB/include/amsstabilityb1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestB/include/amsstabilityb1.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestB/src/amsstabilityb1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestB/src/amsstabilityb1.cpp index 772751a38e..0254fc3413 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestB/src/amsstabilityb1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestB/src/amsstabilityb1.cpp @@ -21,7 +21,7 @@ void AmsStAbilityB1::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityB1::onStart"); + HILOG_INFO("AmsStAbilityB1::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityB1::OnStart(const Want &want) void AmsStAbilityB1::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityB1::OnNewWant"); + HILOG_INFO("AmsStAbilityB1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityB1::OnNewWant(const Want &want) void AmsStAbilityB1::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityB1::OnForeground"); + HILOG_INFO("AmsStAbilityB1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityB1::OnForeground(const Want &want) void AmsStAbilityB1::OnStop() { - APP_LOGI("AmsStAbilityB1::onStop"); + HILOG_INFO("AmsStAbilityB1::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityB1::OnStop() void AmsStAbilityB1::OnActive() { - APP_LOGI("AmsStAbilityB1::OnActive"); + HILOG_INFO("AmsStAbilityB1::OnActive"); Ability::OnActive(); if (std::string::npos != shouldReturn.find(GetAbilityName())) { TerminateAbility(); @@ -67,7 +67,7 @@ void AmsStAbilityB1::OnActive() void AmsStAbilityB1::OnInactive() { - APP_LOGI("AmsStAbilityB1::OnInactive"); + HILOG_INFO("AmsStAbilityB1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -75,7 +75,7 @@ void AmsStAbilityB1::OnInactive() void AmsStAbilityB1::OnBackground() { - APP_LOGI("AmsStAbilityB1::OnBackground"); + HILOG_INFO("AmsStAbilityB1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/BUILD.gn index 07d4556d72..546df0f169 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/BUILD.gn @@ -24,13 +24,14 @@ config("amsSystemTestCConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestC\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestC\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestC") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/include/amsstabilityc1.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/include/amsstabilityc1.h index 3ba74f6a48..19dbf585c0 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/include/amsstabilityc1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/include/amsstabilityc1.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/include/amsstabilityc2.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/include/amsstabilityc2.h index 4b362668af..9d820d312d 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/include/amsstabilityc2.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/include/amsstabilityc2.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/include/amsstabilityc3.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/include/amsstabilityc3.h index 9dde40b58a..d1e286c21b 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/include/amsstabilityc3.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/include/amsstabilityc3.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/src/amsstabilityc1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/src/amsstabilityc1.cpp index cd43e18e9d..04d440523e 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/src/amsstabilityc1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/src/amsstabilityc1.cpp @@ -21,7 +21,7 @@ void AmsStAbilityC1::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityC1::onStart"); + HILOG_INFO("AmsStAbilityC1::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityC1::OnStart(const Want &want) void AmsStAbilityC1::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityC1::OnForeground"); + HILOG_INFO("AmsStAbilityC1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityC1::OnForeground(const Want &want) void AmsStAbilityC1::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityC1::OnNewWant"); + HILOG_INFO("AmsStAbilityC1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityC1::OnNewWant(const Want &want) void AmsStAbilityC1::OnStop() { - APP_LOGI("AmsStAbilityC1::onStop"); + HILOG_INFO("AmsStAbilityC1::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityC1::OnStop() void AmsStAbilityC1::OnActive() { - APP_LOGI("AmsStAbilityC1::OnActive"); + HILOG_INFO("AmsStAbilityC1::OnActive"); Ability::OnActive(); if (!targetBundle.empty() && !targetAbility.empty()) { Want want; @@ -73,7 +73,7 @@ void AmsStAbilityC1::OnActive() void AmsStAbilityC1::OnInactive() { - APP_LOGI("AmsStAbilityC1::OnInactive"); + HILOG_INFO("AmsStAbilityC1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -81,7 +81,7 @@ void AmsStAbilityC1::OnInactive() void AmsStAbilityC1::OnBackground() { - APP_LOGI("AmsStAbilityC1::OnBackground"); + HILOG_INFO("AmsStAbilityC1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/src/amsstabilityc2.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/src/amsstabilityc2.cpp index 71f932129b..5cd851d356 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/src/amsstabilityc2.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/src/amsstabilityc2.cpp @@ -21,7 +21,7 @@ void AmsStAbilityC2::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityC2::onStart"); + HILOG_INFO("AmsStAbilityC2::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityC2::OnStart(const Want &want) void AmsStAbilityC2::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityC2::OnForeground"); + HILOG_INFO("AmsStAbilityC2::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityC2::OnForeground(const Want &want) void AmsStAbilityC2::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityC2::OnNewWant"); + HILOG_INFO("AmsStAbilityC2::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityC2::OnNewWant(const Want &want) void AmsStAbilityC2::OnStop() { - APP_LOGI("AmsStAbilityC2::onStop"); + HILOG_INFO("AmsStAbilityC2::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityC2::OnStop() void AmsStAbilityC2::OnActive() { - APP_LOGI("AmsStAbilityC2::OnActive"); + HILOG_INFO("AmsStAbilityC2::OnActive"); Ability::OnActive(); if (!targetBundle.empty() && !targetAbility.empty()) { Want want; @@ -73,7 +73,7 @@ void AmsStAbilityC2::OnActive() void AmsStAbilityC2::OnInactive() { - APP_LOGI("AmsStAbilityC2::OnInactive"); + HILOG_INFO("AmsStAbilityC2::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -81,7 +81,7 @@ void AmsStAbilityC2::OnInactive() void AmsStAbilityC2::OnBackground() { - APP_LOGI("AmsStAbilityC2::OnBackground"); + HILOG_INFO("AmsStAbilityC2::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/src/amsstabilityc3.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/src/amsstabilityc3.cpp index 8fd4ca9f15..97b219e38d 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/src/amsstabilityc3.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestC/src/amsstabilityc3.cpp @@ -21,7 +21,7 @@ void AmsStAbilityC3::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityC3::onStart"); + HILOG_INFO("AmsStAbilityC3::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityC3::OnStart(const Want &want) void AmsStAbilityC3::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityC3::OnForeground"); + HILOG_INFO("AmsStAbilityC3::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityC3::OnForeground(const Want &want) void AmsStAbilityC3::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityC3::OnNewWant"); + HILOG_INFO("AmsStAbilityC3::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityC3::OnNewWant(const Want &want) void AmsStAbilityC3::OnStop() { - APP_LOGI("AmsStAbilityC3::onStop"); + HILOG_INFO("AmsStAbilityC3::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityC3::OnStop() void AmsStAbilityC3::OnActive() { - APP_LOGI("AmsStAbilityC3::OnActive"); + HILOG_INFO("AmsStAbilityC3::OnActive"); Ability::OnActive(); if (!targetBundle.empty() && !targetAbility.empty()) { Want want; @@ -73,7 +73,7 @@ void AmsStAbilityC3::OnActive() void AmsStAbilityC3::OnInactive() { - APP_LOGI("AmsStAbilityC3::OnInactive"); + HILOG_INFO("AmsStAbilityC3::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -81,7 +81,7 @@ void AmsStAbilityC3::OnInactive() void AmsStAbilityC3::OnBackground() { - APP_LOGI("AmsStAbilityC3::OnBackground"); + HILOG_INFO("AmsStAbilityC3::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/BUILD.gn index f427bb23bf..b36c8da0f6 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/BUILD.gn @@ -24,13 +24,14 @@ config("amsSystemTestDConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestD\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestD\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestD") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/include/amsstabilityd1.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/include/amsstabilityd1.h index 0224cc955c..1ee7439f3c 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/include/amsstabilityd1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/include/amsstabilityd1.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/include/amsstabilityd2.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/include/amsstabilityd2.h index d861aefff8..ef09eee25a 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/include/amsstabilityd2.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/include/amsstabilityd2.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/src/amsstabilityd1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/src/amsstabilityd1.cpp index eaf9452172..c307e5355f 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/src/amsstabilityd1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/src/amsstabilityd1.cpp @@ -21,7 +21,7 @@ void AmsStAbilityD1::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityD1::onStart"); + HILOG_INFO("AmsStAbilityD1::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityD1::OnStart(const Want &want) void AmsStAbilityD1::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityD1::OnForeground"); + HILOG_INFO("AmsStAbilityD1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityD1::OnForeground(const Want &want) void AmsStAbilityD1::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityD1::OnNewWant"); + HILOG_INFO("AmsStAbilityD1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityD1::OnNewWant(const Want &want) void AmsStAbilityD1::OnStop() { - APP_LOGI("AmsStAbilityD1::onStop"); + HILOG_INFO("AmsStAbilityD1::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityD1::OnStop() void AmsStAbilityD1::OnActive() { - APP_LOGI("AmsStAbilityD1::OnActive"); + HILOG_INFO("AmsStAbilityD1::OnActive"); Ability::OnActive(); if (!targetBundle.empty() && !targetAbility.empty()) { Want want; @@ -73,7 +73,7 @@ void AmsStAbilityD1::OnActive() void AmsStAbilityD1::OnInactive() { - APP_LOGI("AmsStAbilityD1::OnInactive"); + HILOG_INFO("AmsStAbilityD1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -81,7 +81,7 @@ void AmsStAbilityD1::OnInactive() void AmsStAbilityD1::OnBackground() { - APP_LOGI("AmsStAbilityD1::OnBackground"); + HILOG_INFO("AmsStAbilityD1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/src/amsstabilityd2.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/src/amsstabilityd2.cpp index e824e91a27..744d0920cf 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/src/amsstabilityd2.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestD/src/amsstabilityd2.cpp @@ -21,7 +21,7 @@ void AmsStAbilityD2::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityD2::onStart"); + HILOG_INFO("AmsStAbilityD2::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityD2::OnStart(const Want &want) void AmsStAbilityD2::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityD2::OnForeground"); + HILOG_INFO("AmsStAbilityD2::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityD2::OnForeground(const Want &want) void AmsStAbilityD2::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityD2::OnNewWant"); + HILOG_INFO("AmsStAbilityD2::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityD2::OnNewWant(const Want &want) void AmsStAbilityD2::OnStop() { - APP_LOGI("AmsStAbilityD2::onStop"); + HILOG_INFO("AmsStAbilityD2::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityD2::OnStop() void AmsStAbilityD2::OnActive() { - APP_LOGI("AmsStAbilityD2::OnActive"); + HILOG_INFO("AmsStAbilityD2::OnActive"); Ability::OnActive(); if (std::string::npos != shouldReturn.find(GetAbilityName())) { TerminateAbility(); @@ -67,7 +67,7 @@ void AmsStAbilityD2::OnActive() void AmsStAbilityD2::OnInactive() { - APP_LOGI("AmsStAbilityD2::OnInactive"); + HILOG_INFO("AmsStAbilityD2::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -75,7 +75,7 @@ void AmsStAbilityD2::OnInactive() void AmsStAbilityD2::OnBackground() { - APP_LOGI("AmsStAbilityD2::OnBackground"); + HILOG_INFO("AmsStAbilityD2::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestDFX/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestDFX/BUILD.gn index c35c323054..0c22a3b711 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestDFX/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestDFX/BUILD.gn @@ -26,13 +26,14 @@ config("amsSystemTestCConfig") { "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${appexecfwk_path}/services/bundlemgr/include", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestDFX\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestDFX\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestDFX") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestDFX/src/ams_dfx_st_service_ability_a1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestDFX/src/ams_dfx_st_service_ability_a1.cpp index 97c7e6002d..f9d5340884 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestDFX/src/ams_dfx_st_service_ability_a1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestDFX/src/ams_dfx_st_service_ability_a1.cpp @@ -14,7 +14,7 @@ */ #include "ams_dfx_st_service_ability_a1.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" using namespace OHOS::EventFwk; @@ -26,7 +26,7 @@ AmsDfxStServiceAbilityA1::~AmsDfxStServiceAbilityA1() void AmsDfxStServiceAbilityA1::OnStart(const Want &want) { - APP_LOGI("AmsDfxStServiceAbilityA1::OnStart"); + HILOG_INFO("AmsDfxStServiceAbilityA1::OnStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -35,7 +35,7 @@ void AmsDfxStServiceAbilityA1::OnStart(const Want &want) void AmsDfxStServiceAbilityA1::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("AmsDfxStServiceAbilityA1::OnCommand"); + HILOG_INFO("AmsDfxStServiceAbilityA1::OnCommand"); Ability::OnCommand(want, restart, startId); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnCommand; @@ -44,7 +44,7 @@ void AmsDfxStServiceAbilityA1::OnCommand(const AAFwk::Want &want, bool restart, void AmsDfxStServiceAbilityA1::OnNewWant(const Want &want) { - APP_LOGI("AmsDfxStServiceAbilityA1::OnNewWant"); + HILOG_INFO("AmsDfxStServiceAbilityA1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; @@ -53,7 +53,7 @@ void AmsDfxStServiceAbilityA1::OnNewWant(const Want &want) void AmsDfxStServiceAbilityA1::OnStop() { - APP_LOGI("AmsDfxStServiceAbilityA1::OnStop"); + HILOG_INFO("AmsDfxStServiceAbilityA1::OnStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); @@ -63,7 +63,7 @@ void AmsDfxStServiceAbilityA1::OnStop() void AmsDfxStServiceAbilityA1::OnActive() { - APP_LOGI("AmsDfxStServiceAbilityA1::OnActive"); + HILOG_INFO("AmsDfxStServiceAbilityA1::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnActive; @@ -72,7 +72,7 @@ void AmsDfxStServiceAbilityA1::OnActive() void AmsDfxStServiceAbilityA1::OnInactive() { - APP_LOGI("AmsDfxStServiceAbilityA1::OnInactive"); + HILOG_INFO("AmsDfxStServiceAbilityA1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; @@ -81,7 +81,7 @@ void AmsDfxStServiceAbilityA1::OnInactive() void AmsDfxStServiceAbilityA1::OnBackground() { - APP_LOGI("AmsDfxStServiceAbilityA1::OnBackground"); + HILOG_INFO("AmsDfxStServiceAbilityA1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; @@ -90,7 +90,7 @@ void AmsDfxStServiceAbilityA1::OnBackground() sptr AmsDfxStServiceAbilityA1::OnConnect(const Want &want) { - APP_LOGI("AmsDfxStServiceAbilityA1::OnConnect"); + HILOG_INFO("AmsDfxStServiceAbilityA1::OnConnect"); sptr ret = Ability::OnConnect(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnConnect; @@ -101,7 +101,7 @@ sptr AmsDfxStServiceAbilityA1::OnConnect(const Want &want) void AmsDfxStServiceAbilityA1::OnDisconnect(const Want &want) { - APP_LOGI("AmsDfxStServiceAbilityA1::OnDisconnect"); + HILOG_INFO("AmsDfxStServiceAbilityA1::OnDisconnect"); Ability::OnDisconnect(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnDisconnect; diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestDFX/src/ams_dfx_st_service_ability_a2.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestDFX/src/ams_dfx_st_service_ability_a2.cpp index 9f2358f9f2..c04cd94fb4 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestDFX/src/ams_dfx_st_service_ability_a2.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestDFX/src/ams_dfx_st_service_ability_a2.cpp @@ -14,7 +14,7 @@ */ #include "ams_dfx_st_service_ability_a2.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" using namespace OHOS::EventFwk; @@ -26,7 +26,7 @@ AmsDfxStServiceAbilityA2::~AmsDfxStServiceAbilityA2() void AmsDfxStServiceAbilityA2::OnStart(const Want &want) { - APP_LOGI("AmsDfxStServiceAbilityA2::OnStart"); + HILOG_INFO("AmsDfxStServiceAbilityA2::OnStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -35,7 +35,7 @@ void AmsDfxStServiceAbilityA2::OnStart(const Want &want) void AmsDfxStServiceAbilityA2::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("AmsDfxStServiceAbilityA2::OnCommand"); + HILOG_INFO("AmsDfxStServiceAbilityA2::OnCommand"); Ability::OnCommand(want, restart, startId); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnCommand; @@ -44,7 +44,7 @@ void AmsDfxStServiceAbilityA2::OnCommand(const AAFwk::Want &want, bool restart, void AmsDfxStServiceAbilityA2::OnNewWant(const Want &want) { - APP_LOGI("AmsDfxStServiceAbilityA2::OnNewWant"); + HILOG_INFO("AmsDfxStServiceAbilityA2::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; @@ -53,7 +53,7 @@ void AmsDfxStServiceAbilityA2::OnNewWant(const Want &want) void AmsDfxStServiceAbilityA2::OnStop() { - APP_LOGI("AmsDfxStServiceAbilityA2::OnStop"); + HILOG_INFO("AmsDfxStServiceAbilityA2::OnStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); @@ -63,7 +63,7 @@ void AmsDfxStServiceAbilityA2::OnStop() void AmsDfxStServiceAbilityA2::OnActive() { - APP_LOGI("AmsDfxStServiceAbilityA2::OnActive"); + HILOG_INFO("AmsDfxStServiceAbilityA2::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnActive; @@ -72,7 +72,7 @@ void AmsDfxStServiceAbilityA2::OnActive() void AmsDfxStServiceAbilityA2::OnInactive() { - APP_LOGI("AmsDfxStServiceAbilityA2::OnInactive"); + HILOG_INFO("AmsDfxStServiceAbilityA2::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; @@ -81,7 +81,7 @@ void AmsDfxStServiceAbilityA2::OnInactive() void AmsDfxStServiceAbilityA2::OnBackground() { - APP_LOGI("AmsDfxStServiceAbilityA2::OnBackground"); + HILOG_INFO("AmsDfxStServiceAbilityA2::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; @@ -90,7 +90,7 @@ void AmsDfxStServiceAbilityA2::OnBackground() sptr AmsDfxStServiceAbilityA2::OnConnect(const Want &want) { - APP_LOGI("AmsDfxStServiceAbilityA2::OnConnect"); + HILOG_INFO("AmsDfxStServiceAbilityA2::OnConnect"); sptr ret = Ability::OnConnect(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnConnect; @@ -100,7 +100,7 @@ sptr AmsDfxStServiceAbilityA2::OnConnect(const Want &want) void AmsDfxStServiceAbilityA2::OnDisconnect(const Want &want) { - APP_LOGI("AmsDfxStServiceAbilityA2::OnDisconnect"); + HILOG_INFO("AmsDfxStServiceAbilityA2::OnDisconnect"); Ability::OnDisconnect(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnDisconnect; diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestE/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestE/BUILD.gn index 8559d9ca92..4e31381570 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestE/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestE/BUILD.gn @@ -24,13 +24,14 @@ config("amsSystemTestEConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestE\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestE\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestE") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestE/include/amsstabilitye1.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestE/include/amsstabilitye1.h index c9c7835748..e682fc9b18 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestE/include/amsstabilitye1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestE/include/amsstabilitye1.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestE/src/amsstabilitye1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestE/src/amsstabilitye1.cpp index 777bfcd110..4fd8883435 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestE/src/amsstabilitye1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestE/src/amsstabilitye1.cpp @@ -21,7 +21,7 @@ void AmsStAbilityE1::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityE1::onStart"); + HILOG_INFO("AmsStAbilityE1::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityE1::OnStart(const Want &want) void AmsStAbilityE1::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityE1::OnForeground"); + HILOG_INFO("AmsStAbilityE1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityE1::OnForeground(const Want &want) void AmsStAbilityE1::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityE1::OnNewWant"); + HILOG_INFO("AmsStAbilityE1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityE1::OnNewWant(const Want &want) void AmsStAbilityE1::OnStop() { - APP_LOGI("AmsStAbilityE1::onStop"); + HILOG_INFO("AmsStAbilityE1::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityE1::OnStop() void AmsStAbilityE1::OnActive() { - APP_LOGI("AmsStAbilityE1::OnActive"); + HILOG_INFO("AmsStAbilityE1::OnActive"); Ability::OnActive(); if (std::string::npos != shouldReturn.find(GetAbilityName())) { TerminateAbility(); @@ -67,7 +67,7 @@ void AmsStAbilityE1::OnActive() void AmsStAbilityE1::OnInactive() { - APP_LOGI("AmsStAbilityE1::OnInactive"); + HILOG_INFO("AmsStAbilityE1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -75,7 +75,7 @@ void AmsStAbilityE1::OnInactive() void AmsStAbilityE1::OnBackground() { - APP_LOGI("AmsStAbilityE1::OnBackground"); + HILOG_INFO("AmsStAbilityE1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorK/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorK/BUILD.gn index 9ce0a88ea1..9a47f73d27 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorK/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorK/BUILD.gn @@ -23,12 +23,13 @@ config("amsSystemTestErrorKConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestErrorK\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestErrorK\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestErrorK") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorK/include/amsstabilityerrork1.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorK/include/amsstabilityerrork1.h index 47a5a9dc99..b369c25204 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorK/include/amsstabilityerrork1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorK/include/amsstabilityerrork1.h @@ -16,7 +16,7 @@ #ifndef _AMS_ST_ABILITY_ERROR_K1_ #define _AMS_ST_ABILITY_ERROR_K1_ #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include namespace OHOS { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorK/src/amsstabilityerrork1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorK/src/amsstabilityerrork1.cpp index 22fdc5c7bf..69534d40d7 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorK/src/amsstabilityerrork1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorK/src/amsstabilityerrork1.cpp @@ -28,19 +28,19 @@ void AmsStAbilityErrorK1::OnStart(const Want &want) int errorCode3 = 0; errorCode1 = errorCode2 / errorCode3; - APP_LOGI("AmsStAbilityErrorK1::onStart"); + HILOG_INFO("AmsStAbilityErrorK1::onStart"); Ability::OnStart(want); } void AmsStAbilityErrorK1::OnStop() { - APP_LOGI("AmsStAbilityErrorK1::onStop"); + HILOG_INFO("AmsStAbilityErrorK1::onStop"); Ability::OnStop(); } void AmsStAbilityErrorK1::OnActive() { - APP_LOGI("AmsStAbilityErrorK1::OnActive"); + HILOG_INFO("AmsStAbilityErrorK1::OnActive"); Ability::OnActive(); if (!targetBundle.empty() && !targetAbility.empty()) { Want want; @@ -55,13 +55,13 @@ void AmsStAbilityErrorK1::OnActive() void AmsStAbilityErrorK1::OnInactive() { - APP_LOGI("AmsStAbilityErrorK1::OnInactive"); + HILOG_INFO("AmsStAbilityErrorK1::OnInactive"); Ability::OnInactive(); } void AmsStAbilityErrorK1::OnBackground() { - APP_LOGI("AmsStAbilityErrorK1::OnBackground"); + HILOG_INFO("AmsStAbilityErrorK1::OnBackground"); Ability::OnBackground(); } diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorL/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorL/BUILD.gn index f600cd1fb1..70a33d2ea4 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorL/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorL/BUILD.gn @@ -23,12 +23,13 @@ config("amsSystemTestErrorLConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestErrorL\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestErrorL\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestErrorL") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorL/include/amsstabilityerrorl1.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorL/include/amsstabilityerrorl1.h index 03e442243f..4990c34baa 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorL/include/amsstabilityerrorl1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorL/include/amsstabilityerrorl1.h @@ -16,7 +16,7 @@ #ifndef _AMS_ST_ABILITY_ERROR_L1_ #define _AMS_ST_ABILITY_ERROR_L1_ #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include namespace OHOS { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorL/src/amsstabilityerrorl1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorL/src/amsstabilityerrorl1.cpp index b62ab38f5b..ba071229dc 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorL/src/amsstabilityerrorl1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestErrorL/src/amsstabilityerrorl1.cpp @@ -24,19 +24,19 @@ void AmsStAbilityErrorL1::OnStart(const Want &want) targetBundle = mWant.GetStringParam("targetBundle"); targetAbility = mWant.GetStringParam("targetAbility"); - APP_LOGI("AmsStAbilityErrorL1::onStart"); + HILOG_INFO("AmsStAbilityErrorL1::onStart"); Ability::OnStart(want); } void AmsStAbilityErrorL1::OnStop() { - APP_LOGI("AmsStAbilityErrorL1::onStop"); + HILOG_INFO("AmsStAbilityErrorL1::onStop"); Ability::OnStop(); } void AmsStAbilityErrorL1::OnActive() { - APP_LOGI("AmsStAbilityErrorL1::OnActive"); + HILOG_INFO("AmsStAbilityErrorL1::OnActive"); Ability::OnActive(); if (!targetBundle.empty() && !targetAbility.empty()) { Want want; @@ -51,13 +51,13 @@ void AmsStAbilityErrorL1::OnActive() void AmsStAbilityErrorL1::OnInactive() { - APP_LOGI("AmsStAbilityErrorL1::OnInactive"); + HILOG_INFO("AmsStAbilityErrorL1::OnInactive"); Ability::OnInactive(); } void AmsStAbilityErrorL1::OnBackground() { - APP_LOGI("AmsStAbilityErrorL1::OnBackground"); + HILOG_INFO("AmsStAbilityErrorL1::OnBackground"); Ability::OnBackground(); } diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/BUILD.gn index 7b2731e212..2360c8a4d5 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/BUILD.gn @@ -24,13 +24,14 @@ config("amsSystemTestFConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestF\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestF\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestF") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/include/amsstabilityf1.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/include/amsstabilityf1.h index 0cd56124ac..089f161dfb 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/include/amsstabilityf1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/include/amsstabilityf1.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/include/amsstabilityf2.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/include/amsstabilityf2.h index 09628fc83b..94c3fc1500 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/include/amsstabilityf2.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/include/amsstabilityf2.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/include/amsstabilityf3.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/include/amsstabilityf3.h index 21ec74798e..924ea968d8 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/include/amsstabilityf3.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/include/amsstabilityf3.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/src/amsstabilityf1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/src/amsstabilityf1.cpp index 8c3122a770..7a3613d5bc 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/src/amsstabilityf1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/src/amsstabilityf1.cpp @@ -21,7 +21,7 @@ void AmsStAbilityF1::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityF1::onStart"); + HILOG_INFO("AmsStAbilityF1::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityF1::OnStart(const Want &want) void AmsStAbilityF1::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityF1::OnForeground"); + HILOG_INFO("AmsStAbilityF1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityF1::OnForeground(const Want &want) void AmsStAbilityF1::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityF1::OnNewWant"); + HILOG_INFO("AmsStAbilityF1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityF1::OnNewWant(const Want &want) void AmsStAbilityF1::OnStop() { - APP_LOGI("AmsStAbilityF1::onStop"); + HILOG_INFO("AmsStAbilityF1::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityF1::OnStop() void AmsStAbilityF1::OnActive() { - APP_LOGI("AmsStAbilityF1::OnActive"); + HILOG_INFO("AmsStAbilityF1::OnActive"); Ability::OnActive(); if (!targetBundle.empty() && !targetAbility.empty()) { Want want; @@ -73,7 +73,7 @@ void AmsStAbilityF1::OnActive() void AmsStAbilityF1::OnInactive() { - APP_LOGI("AmsStAbilityF1::OnInactive"); + HILOG_INFO("AmsStAbilityF1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -81,7 +81,7 @@ void AmsStAbilityF1::OnInactive() void AmsStAbilityF1::OnBackground() { - APP_LOGI("AmsStAbilityF1::OnBackground"); + HILOG_INFO("AmsStAbilityF1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/src/amsstabilityf2.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/src/amsstabilityf2.cpp index d9e448a0be..ba889e2c10 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/src/amsstabilityf2.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/src/amsstabilityf2.cpp @@ -21,7 +21,7 @@ void AmsStAbilityF2::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityF2::onStart"); + HILOG_INFO("AmsStAbilityF2::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityF2::OnStart(const Want &want) void AmsStAbilityF2::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityF2::OnForeground"); + HILOG_INFO("AmsStAbilityF2::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityF2::OnForeground(const Want &want) void AmsStAbilityF2::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityF2::OnNewWant"); + HILOG_INFO("AmsStAbilityF2::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityF2::OnNewWant(const Want &want) void AmsStAbilityF2::OnStop() { - APP_LOGI("AmsStAbilityF2::onStop"); + HILOG_INFO("AmsStAbilityF2::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityF2::OnStop() void AmsStAbilityF2::OnActive() { - APP_LOGI("AmsStAbilityF2::OnActive"); + HILOG_INFO("AmsStAbilityF2::OnActive"); Ability::OnActive(); if (!targetBundle.empty() && !targetAbility.empty()) { Want want; @@ -73,7 +73,7 @@ void AmsStAbilityF2::OnActive() void AmsStAbilityF2::OnInactive() { - APP_LOGI("AmsStAbilityF2::OnInactive"); + HILOG_INFO("AmsStAbilityF2::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -81,7 +81,7 @@ void AmsStAbilityF2::OnInactive() void AmsStAbilityF2::OnBackground() { - APP_LOGI("AmsStAbilityF2::OnBackground"); + HILOG_INFO("AmsStAbilityF2::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/src/amsstabilityf3.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/src/amsstabilityf3.cpp index 710c33c97b..178e66cf5c 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/src/amsstabilityf3.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestF/src/amsstabilityf3.cpp @@ -21,7 +21,7 @@ void AmsStAbilityF3::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityF3::onStart"); + HILOG_INFO("AmsStAbilityF3::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityF3::OnStart(const Want &want) void AmsStAbilityF3::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityF3::OnForeground"); + HILOG_INFO("AmsStAbilityF3::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityF3::OnForeground(const Want &want) void AmsStAbilityF3::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityF2::OnNewWant"); + HILOG_INFO("AmsStAbilityF2::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityF3::OnNewWant(const Want &want) void AmsStAbilityF3::OnStop() { - APP_LOGI("AmsStAbilityF3::onStop"); + HILOG_INFO("AmsStAbilityF3::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityF3::OnStop() void AmsStAbilityF3::OnActive() { - APP_LOGI("AmsStAbilityF3::OnActive"); + HILOG_INFO("AmsStAbilityF3::OnActive"); Ability::OnActive(); if (!targetBundle.empty() && !targetAbility.empty()) { Want want; @@ -73,7 +73,7 @@ void AmsStAbilityF3::OnActive() void AmsStAbilityF3::OnInactive() { - APP_LOGI("AmsStAbilityF3::OnInactive"); + HILOG_INFO("AmsStAbilityF3::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -81,7 +81,7 @@ void AmsStAbilityF3::OnInactive() void AmsStAbilityF3::OnBackground() { - APP_LOGI("AmsStAbilityF3::OnBackground"); + HILOG_INFO("AmsStAbilityF3::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/BUILD.gn index 723f77e3c5..6929a4cc76 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/BUILD.gn @@ -24,13 +24,14 @@ config("amsSystemTestGConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestG\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestG\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestG") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/include/amsstabilityg1.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/include/amsstabilityg1.h index 8ee8564a1c..397a88dc09 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/include/amsstabilityg1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/include/amsstabilityg1.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/include/amsstabilityg2.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/include/amsstabilityg2.h index 134ad4524d..4928957e95 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/include/amsstabilityg2.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/include/amsstabilityg2.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/src/amsstabilityg1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/src/amsstabilityg1.cpp index acc830c02f..8918553a1d 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/src/amsstabilityg1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/src/amsstabilityg1.cpp @@ -21,7 +21,7 @@ void AmsStAbilityG1::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityG1::onStart"); + HILOG_INFO("AmsStAbilityG1::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityG1::OnStart(const Want &want) void AmsStAbilityG1::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityG1::OnNewWant"); + HILOG_INFO("AmsStAbilityG1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityG1::OnNewWant(const Want &want) void AmsStAbilityG1::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityG1::OnForeground"); + HILOG_INFO("AmsStAbilityG1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityG1::OnForeground(const Want &want) void AmsStAbilityG1::OnStop() { - APP_LOGI("AmsStAbilityG1::onStop"); + HILOG_INFO("AmsStAbilityG1::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityG1::OnStop() void AmsStAbilityG1::OnActive() { - APP_LOGI("AmsStAbilityG1::OnActive"); + HILOG_INFO("AmsStAbilityG1::OnActive"); Ability::OnActive(); if (!targetBundle.empty() && !targetAbility.empty()) { Want want; @@ -73,7 +73,7 @@ void AmsStAbilityG1::OnActive() void AmsStAbilityG1::OnInactive() { - APP_LOGI("AmsStAbilityG1::OnInactive"); + HILOG_INFO("AmsStAbilityG1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -81,7 +81,7 @@ void AmsStAbilityG1::OnInactive() void AmsStAbilityG1::OnBackground() { - APP_LOGI("AmsStAbilityG1::OnBackground"); + HILOG_INFO("AmsStAbilityG1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/src/amsstabilityg2.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/src/amsstabilityg2.cpp index a857a1fe77..a7d2b929c7 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/src/amsstabilityg2.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestG/src/amsstabilityg2.cpp @@ -21,7 +21,7 @@ void AmsStAbilityG2::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityG2::onStart"); + HILOG_INFO("AmsStAbilityG2::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityG2::OnStart(const Want &want) void AmsStAbilityG2::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityG2::OnNewWant"); + HILOG_INFO("AmsStAbilityG2::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityG2::OnNewWant(const Want &want) void AmsStAbilityG2::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityG2::OnForeground"); + HILOG_INFO("AmsStAbilityG2::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityG2::OnForeground(const Want &want) void AmsStAbilityG2::OnStop() { - APP_LOGI("AmsStAbilityG2::onStop"); + HILOG_INFO("AmsStAbilityG2::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityG2::OnStop() void AmsStAbilityG2::OnActive() { - APP_LOGI("AmsStAbilityG2::OnActive"); + HILOG_INFO("AmsStAbilityG2::OnActive"); Ability::OnActive(); if (std::string::npos != shouldReturn.find(GetAbilityName())) { TerminateAbility(); @@ -67,7 +67,7 @@ void AmsStAbilityG2::OnActive() void AmsStAbilityG2::OnInactive() { - APP_LOGI("AmsStAbilityG2::OnInactive"); + HILOG_INFO("AmsStAbilityG2::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -75,7 +75,7 @@ void AmsStAbilityG2::OnInactive() void AmsStAbilityG2::OnBackground() { - APP_LOGI("AmsStAbilityG2::OnBackground"); + HILOG_INFO("AmsStAbilityG2::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestH/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestH/BUILD.gn index c67ae7685d..19084e6ead 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestH/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestH/BUILD.gn @@ -24,13 +24,14 @@ config("amsSystemTestHConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestH\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestH\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestH") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestH/include/amsstabilityh1.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestH/include/amsstabilityh1.h index 7cc9c2bc61..dcfdaa3223 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestH/include/amsstabilityh1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestH/include/amsstabilityh1.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestH/src/amsstabilityh1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestH/src/amsstabilityh1.cpp index 46c9a8c21b..0d7a66dc11 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestH/src/amsstabilityh1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestH/src/amsstabilityh1.cpp @@ -21,7 +21,7 @@ void AmsStAbilityH1::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityH1::onStart"); + HILOG_INFO("AmsStAbilityH1::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityH1::OnStart(const Want &want) void AmsStAbilityH1::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityH1::OnNewWant"); + HILOG_INFO("AmsStAbilityH1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityH1::OnNewWant(const Want &want) void AmsStAbilityH1::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityH1::OnForeground"); + HILOG_INFO("AmsStAbilityH1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityH1::OnForeground(const Want &want) void AmsStAbilityH1::OnStop() { - APP_LOGI("AmsStAbilityH1::onStop"); + HILOG_INFO("AmsStAbilityH1::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityH1::OnStop() void AmsStAbilityH1::OnActive() { - APP_LOGI("AmsStAbilityH1::OnActive"); + HILOG_INFO("AmsStAbilityH1::OnActive"); Ability::OnActive(); if (std::string::npos != shouldReturn.find(GetAbilityName())) { TerminateAbility(); @@ -67,7 +67,7 @@ void AmsStAbilityH1::OnActive() void AmsStAbilityH1::OnInactive() { - APP_LOGI("AmsStAbilityH1::OnInactive"); + HILOG_INFO("AmsStAbilityH1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -75,7 +75,7 @@ void AmsStAbilityH1::OnInactive() void AmsStAbilityH1::OnBackground() { - APP_LOGI("AmsStAbilityH1::OnBackground"); + HILOG_INFO("AmsStAbilityH1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/BUILD.gn index 2a000be136..7063ad122f 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/BUILD.gn @@ -24,13 +24,14 @@ config("amsSystemTestIConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestI\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestI\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestI") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/include/amsstabilityi1.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/include/amsstabilityi1.h index 93502a8587..ddaeafb9d7 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/include/amsstabilityi1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/include/amsstabilityi1.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/include/amsstabilityi2.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/include/amsstabilityi2.h index 1c976ccb07..9654a09837 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/include/amsstabilityi2.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/include/amsstabilityi2.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/include/amsstabilityi3.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/include/amsstabilityi3.h index 8bfd96ed2e..fe6b5c6b7e 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/include/amsstabilityi3.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/include/amsstabilityi3.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/include/amsstabilityi4.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/include/amsstabilityi4.h index ae6cfafc53..e0dd54d673 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/include/amsstabilityi4.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/include/amsstabilityi4.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/src/amsstabilityi1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/src/amsstabilityi1.cpp index 796dee708c..f4835199a3 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/src/amsstabilityi1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/src/amsstabilityi1.cpp @@ -21,7 +21,7 @@ void AmsStAbilityI1::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityI1::onStart"); + HILOG_INFO("AmsStAbilityI1::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityI1::OnStart(const Want &want) void AmsStAbilityI1::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityI1::OnNewWant"); + HILOG_INFO("AmsStAbilityI1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityI1::OnNewWant(const Want &want) void AmsStAbilityI1::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityI1::OnForeground"); + HILOG_INFO("AmsStAbilityI1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityI1::OnForeground(const Want &want) void AmsStAbilityI1::OnStop() { - APP_LOGI("AmsStAbilityI1::onStop"); + HILOG_INFO("AmsStAbilityI1::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityI1::OnStop() void AmsStAbilityI1::OnActive() { - APP_LOGI("AmsStAbilityI1::OnActive"); + HILOG_INFO("AmsStAbilityI1::OnActive"); Ability::OnActive(); if (!targetBundle.empty() && !targetAbility.empty()) { Want want; @@ -73,7 +73,7 @@ void AmsStAbilityI1::OnActive() void AmsStAbilityI1::OnInactive() { - APP_LOGI("AmsStAbilityI1::OnInactive"); + HILOG_INFO("AmsStAbilityI1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -81,7 +81,7 @@ void AmsStAbilityI1::OnInactive() void AmsStAbilityI1::OnBackground() { - APP_LOGI("AmsStAbilityI1::OnBackground"); + HILOG_INFO("AmsStAbilityI1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/src/amsstabilityi2.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/src/amsstabilityi2.cpp index 4f2c8bc934..6828618804 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/src/amsstabilityi2.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/src/amsstabilityi2.cpp @@ -21,7 +21,7 @@ void AmsStAbilityI2::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityI2::onStart"); + HILOG_INFO("AmsStAbilityI2::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityI2::OnStart(const Want &want) void AmsStAbilityI2::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityI2::OnNewWant"); + HILOG_INFO("AmsStAbilityI2::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityI2::OnNewWant(const Want &want) void AmsStAbilityI2::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityI1::OnForeground"); + HILOG_INFO("AmsStAbilityI1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityI2::OnForeground(const Want &want) void AmsStAbilityI2::OnStop() { - APP_LOGI("AmsStAbilityI2::onStop"); + HILOG_INFO("AmsStAbilityI2::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityI2::OnStop() void AmsStAbilityI2::OnActive() { - APP_LOGI("AmsStAbilityI2::OnActive"); + HILOG_INFO("AmsStAbilityI2::OnActive"); Ability::OnActive(); if (!targetBundle.empty() && !targetAbility.empty()) { Want want; @@ -73,7 +73,7 @@ void AmsStAbilityI2::OnActive() void AmsStAbilityI2::OnInactive() { - APP_LOGI("AmsStAbilityI2::OnInactive"); + HILOG_INFO("AmsStAbilityI2::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -81,7 +81,7 @@ void AmsStAbilityI2::OnInactive() void AmsStAbilityI2::OnBackground() { - APP_LOGI("AmsStAbilityI2::OnBackground"); + HILOG_INFO("AmsStAbilityI2::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/src/amsstabilityi3.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/src/amsstabilityi3.cpp index b0758a5cae..4c2631fd6b 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/src/amsstabilityi3.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/src/amsstabilityi3.cpp @@ -21,7 +21,7 @@ void AmsStAbilityI3::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityI::onStart"); + HILOG_INFO("AmsStAbilityI::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityI3::OnStart(const Want &want) void AmsStAbilityI3::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityI3::OnNewWant"); + HILOG_INFO("AmsStAbilityI3::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityI3::OnNewWant(const Want &want) void AmsStAbilityI3::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityI1::OnForeground"); + HILOG_INFO("AmsStAbilityI1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityI3::OnForeground(const Want &want) void AmsStAbilityI3::OnStop() { - APP_LOGI("AmsStAbilityI3::onStop"); + HILOG_INFO("AmsStAbilityI3::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityI3::OnStop() void AmsStAbilityI3::OnActive() { - APP_LOGI("AmsStAbilityI3::OnActive"); + HILOG_INFO("AmsStAbilityI3::OnActive"); Ability::OnActive(); if (!targetBundle.empty() && !targetAbility.empty()) { Want want; @@ -73,7 +73,7 @@ void AmsStAbilityI3::OnActive() void AmsStAbilityI3::OnInactive() { - APP_LOGI("AmsStAbilityI3::OnInactive"); + HILOG_INFO("AmsStAbilityI3::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -81,7 +81,7 @@ void AmsStAbilityI3::OnInactive() void AmsStAbilityI3::OnBackground() { - APP_LOGI("AmsStAbilityI3::OnBackground"); + HILOG_INFO("AmsStAbilityI3::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/src/amsstabilityi4.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/src/amsstabilityi4.cpp index 566f97e306..8c17072f9e 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/src/amsstabilityi4.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestI/src/amsstabilityi4.cpp @@ -21,7 +21,7 @@ void AmsStAbilityI4::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityI::onStart"); + HILOG_INFO("AmsStAbilityI::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityI4::OnStart(const Want &want) void AmsStAbilityI4::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityI4::OnNewWant"); + HILOG_INFO("AmsStAbilityI4::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityI4::OnNewWant(const Want &want) void AmsStAbilityI4::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityI1::OnForeground"); + HILOG_INFO("AmsStAbilityI1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityI4::OnForeground(const Want &want) void AmsStAbilityI4::OnStop() { - APP_LOGI("AmsStAbilityI4::onStop"); + HILOG_INFO("AmsStAbilityI4::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityI4::OnStop() void AmsStAbilityI4::OnActive() { - APP_LOGI("AmsStAbilityI4::OnActive"); + HILOG_INFO("AmsStAbilityI4::OnActive"); Ability::OnActive(); if (!targetBundle.empty() && !targetAbility.empty()) { Want want; @@ -73,7 +73,7 @@ void AmsStAbilityI4::OnActive() void AmsStAbilityI4::OnInactive() { - APP_LOGI("AmsStAbilityI4::OnInactive"); + HILOG_INFO("AmsStAbilityI4::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -81,7 +81,7 @@ void AmsStAbilityI4::OnInactive() void AmsStAbilityI4::OnBackground() { - APP_LOGI("AmsStAbilityI4::OnBackground"); + HILOG_INFO("AmsStAbilityI4::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestM/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestM/BUILD.gn index 18eb514e15..26d3dd9501 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestM/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestM/BUILD.gn @@ -24,13 +24,14 @@ config("amsSystemTestMConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestM\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestM\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestM") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestM/include/amsstabilitym1.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestM/include/amsstabilitym1.h index a3c27f3db9..0718b1447e 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestM/include/amsstabilitym1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestM/include/amsstabilitym1.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestM/src/amsstabilitym1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestM/src/amsstabilitym1.cpp index 55728cd7ef..1f40c133ae 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestM/src/amsstabilitym1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestM/src/amsstabilitym1.cpp @@ -21,7 +21,7 @@ void AmsStAbilityM1::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AmsStAbilityM1::Init"); + HILOG_INFO("AmsStAbilityM1::Init"); Ability::Init(abilityInfo, application, handler, token); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); SendPath("Init"); @@ -30,7 +30,7 @@ void AmsStAbilityM1::Init(const std::shared_ptr &abilityInfo, void AmsStAbilityM1::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityM1::OnStart"); + HILOG_INFO("AmsStAbilityM1::OnStart"); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnStartCount(), eventData); @@ -39,7 +39,7 @@ void AmsStAbilityM1::OnStart(const Want &want) void AmsStAbilityM1::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityM1::OnNewWant"); + HILOG_INFO("AmsStAbilityM1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -48,7 +48,7 @@ void AmsStAbilityM1::OnNewWant(const Want &want) void AmsStAbilityM1::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityM1::OnForeground"); + HILOG_INFO("AmsStAbilityM1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -57,7 +57,7 @@ void AmsStAbilityM1::OnForeground(const Want &want) void AmsStAbilityM1::OnStop() { - APP_LOGI("AmsStAbilityM1::OnStop"); + HILOG_INFO("AmsStAbilityM1::OnStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -67,7 +67,7 @@ void AmsStAbilityM1::OnStop() void AmsStAbilityM1::OnActive() { - APP_LOGI("AmsStAbilityM1::OnActive"); + HILOG_INFO("AmsStAbilityM1::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle, ","); std::string startAbilityName = this->Split(targetAbility, ","); @@ -92,7 +92,7 @@ void AmsStAbilityM1::OnActive() void AmsStAbilityM1::OnInactive() { - APP_LOGI("AmsStAbilityM1::OnInactive"); + HILOG_INFO("AmsStAbilityM1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -101,7 +101,7 @@ void AmsStAbilityM1::OnInactive() void AmsStAbilityM1::OnBackground() { - APP_LOGI("AmsStAbilityM1::OnBackground"); + HILOG_INFO("AmsStAbilityM1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/BUILD.gn index 645a61af37..657255aad3 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/BUILD.gn @@ -24,13 +24,14 @@ config("amsSystemTestNConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestN\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestN\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestN") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/include/amsstabilityn1.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/include/amsstabilityn1.h index f8b3001de8..00e827c9cb 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/include/amsstabilityn1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/include/amsstabilityn1.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/include/amsstabilityn2.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/include/amsstabilityn2.h index bc36821783..fae108a697 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/include/amsstabilityn2.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/include/amsstabilityn2.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/include/amsstabilityn3.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/include/amsstabilityn3.h index d0f01e229d..bf88676b8f 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/include/amsstabilityn3.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/include/amsstabilityn3.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/include/amsstabilityn4.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/include/amsstabilityn4.h index f65693eedc..a9baea5548 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/include/amsstabilityn4.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/include/amsstabilityn4.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/src/amsstabilityn1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/src/amsstabilityn1.cpp index 862b20cc0b..dcc02defe4 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/src/amsstabilityn1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/src/amsstabilityn1.cpp @@ -21,7 +21,7 @@ void AmsStAbilityN1::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AmsStAbilityN1::Init"); + HILOG_INFO("AmsStAbilityN1::Init"); Ability::Init(abilityInfo, application, handler, token); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); SendPath("Init"); @@ -30,7 +30,7 @@ void AmsStAbilityN1::Init(const std::shared_ptr &abilityInfo, void AmsStAbilityN1::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityN1::onStart"); + HILOG_INFO("AmsStAbilityN1::onStart"); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnStartCount(), eventData); @@ -39,7 +39,7 @@ void AmsStAbilityN1::OnStart(const Want &want) void AmsStAbilityN1::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityN1::OnNewWant"); + HILOG_INFO("AmsStAbilityN1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -48,7 +48,7 @@ void AmsStAbilityN1::OnNewWant(const Want &want) void AmsStAbilityN1::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityN1::OnForeground"); + HILOG_INFO("AmsStAbilityN1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -57,7 +57,7 @@ void AmsStAbilityN1::OnForeground(const Want &want) void AmsStAbilityN1::OnStop() { - APP_LOGI("AmsStAbilityN1::onStop"); + HILOG_INFO("AmsStAbilityN1::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -67,7 +67,7 @@ void AmsStAbilityN1::OnStop() void AmsStAbilityN1::OnActive() { - APP_LOGI("AmsStAbilityN1::OnActive"); + HILOG_INFO("AmsStAbilityN1::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle, ","); std::string startAbilityName = this->Split(targetAbility, ","); @@ -92,7 +92,7 @@ void AmsStAbilityN1::OnActive() void AmsStAbilityN1::OnInactive() { - APP_LOGI("AmsStAbilityN1::OnInactive"); + HILOG_INFO("AmsStAbilityN1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -101,7 +101,7 @@ void AmsStAbilityN1::OnInactive() void AmsStAbilityN1::OnBackground() { - APP_LOGI("AmsStAbilityN1::OnBackground"); + HILOG_INFO("AmsStAbilityN1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/src/amsstabilityn2.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/src/amsstabilityn2.cpp index 374c494894..f1151d4766 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/src/amsstabilityn2.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/src/amsstabilityn2.cpp @@ -21,7 +21,7 @@ void AmsStAbilityN2::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AmsStAbilityN2::Init"); + HILOG_INFO("AmsStAbilityN2::Init"); Ability::Init(abilityInfo, application, handler, token); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); SendPath("Init"); @@ -30,7 +30,7 @@ void AmsStAbilityN2::Init(const std::shared_ptr &abilityInfo, void AmsStAbilityN2::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityN2::onStart"); + HILOG_INFO("AmsStAbilityN2::onStart"); Ability::OnStart(want); SendPath("OnStart"); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -39,7 +39,7 @@ void AmsStAbilityN2::OnStart(const Want &want) void AmsStAbilityN2::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityN2::OnNewWant"); + HILOG_INFO("AmsStAbilityN2::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -48,7 +48,7 @@ void AmsStAbilityN2::OnNewWant(const Want &want) void AmsStAbilityN2::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityN2::OnForeground"); + HILOG_INFO("AmsStAbilityN2::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -57,7 +57,7 @@ void AmsStAbilityN2::OnForeground(const Want &want) void AmsStAbilityN2::OnStop() { - APP_LOGI("AmsStAbilityN2::onStop"); + HILOG_INFO("AmsStAbilityN2::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -67,7 +67,7 @@ void AmsStAbilityN2::OnStop() void AmsStAbilityN2::OnActive() { - APP_LOGI("AmsStAbilityN2::OnActive"); + HILOG_INFO("AmsStAbilityN2::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle, ","); std::string startAbilityName = this->Split(targetAbility, ","); @@ -92,7 +92,7 @@ void AmsStAbilityN2::OnActive() void AmsStAbilityN2::OnInactive() { - APP_LOGI("AmsStAbilityN2::OnInactive"); + HILOG_INFO("AmsStAbilityN2::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -101,7 +101,7 @@ void AmsStAbilityN2::OnInactive() void AmsStAbilityN2::OnBackground() { - APP_LOGI("AmsStAbilityN2::OnBackground"); + HILOG_INFO("AmsStAbilityN2::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/src/amsstabilityn3.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/src/amsstabilityn3.cpp index 87aadf2b27..4ac52650cc 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/src/amsstabilityn3.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/src/amsstabilityn3.cpp @@ -20,7 +20,7 @@ namespace AppExecFwk { void AmsStAbilityN3::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityN3::onStart"); + HILOG_INFO("AmsStAbilityN3::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -29,7 +29,7 @@ void AmsStAbilityN3::OnStart(const Want &want) void AmsStAbilityN3::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityN3::OnNewWant"); + HILOG_INFO("AmsStAbilityN3::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -37,7 +37,7 @@ void AmsStAbilityN3::OnNewWant(const Want &want) void AmsStAbilityN3::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityN3::OnForeground"); + HILOG_INFO("AmsStAbilityN3::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -45,7 +45,7 @@ void AmsStAbilityN3::OnForeground(const Want &want) void AmsStAbilityN3::OnStop() { - APP_LOGI("AmsStAbilityN3::onStop"); + HILOG_INFO("AmsStAbilityN3::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -54,7 +54,7 @@ void AmsStAbilityN3::OnStop() void AmsStAbilityN3::OnActive() { - APP_LOGI("AmsStAbilityN3::OnActive"); + HILOG_INFO("AmsStAbilityN3::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle, ","); std::string startAbilityName = this->Split(targetAbility, ","); @@ -78,7 +78,7 @@ void AmsStAbilityN3::OnActive() void AmsStAbilityN3::OnInactive() { - APP_LOGI("AmsStAbilityN3::OnInactive"); + HILOG_INFO("AmsStAbilityN3::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -86,7 +86,7 @@ void AmsStAbilityN3::OnInactive() void AmsStAbilityN3::OnBackground() { - APP_LOGI("AmsStAbilityN3::OnBackground"); + HILOG_INFO("AmsStAbilityN3::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/src/amsstabilityn4.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/src/amsstabilityn4.cpp index b9618f49ed..ade852c4c0 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/src/amsstabilityn4.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestN/src/amsstabilityn4.cpp @@ -21,7 +21,7 @@ void AmsStAbilityN4::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityN4::onStart"); + HILOG_INFO("AmsStAbilityN4::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityN4::OnStart(const Want &want) void AmsStAbilityN4::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityN4::OnNewWant"); + HILOG_INFO("AmsStAbilityN4::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityN4::OnNewWant(const Want &want) void AmsStAbilityN4::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityN4::OnForeground"); + HILOG_INFO("AmsStAbilityN4::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityN4::OnForeground(const Want &want) void AmsStAbilityN4::OnStop() { - APP_LOGI("AmsStAbilityN4::onStop"); + HILOG_INFO("AmsStAbilityN4::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityN4::OnStop() void AmsStAbilityN4::OnActive() { - APP_LOGI("AmsStAbilityN4::OnActive"); + HILOG_INFO("AmsStAbilityN4::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle, ","); std::string startAbilityName = this->Split(targetAbility, ","); @@ -79,7 +79,7 @@ void AmsStAbilityN4::OnActive() void AmsStAbilityN4::OnInactive() { - APP_LOGI("AmsStAbilityN4::OnInactive"); + HILOG_INFO("AmsStAbilityN4::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -87,7 +87,7 @@ void AmsStAbilityN4::OnInactive() void AmsStAbilityN4::OnBackground() { - APP_LOGI("AmsStAbilityN4::OnBackground"); + HILOG_INFO("AmsStAbilityN4::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestO/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestO/BUILD.gn index 9c8df96b18..8571add5f0 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestO/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestO/BUILD.gn @@ -24,13 +24,14 @@ config("amsSystemTestOConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestO\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestO\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestO") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestO/include/amsstabilityo1.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestO/include/amsstabilityo1.h index af719d3f86..2e08fece86 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestO/include/amsstabilityo1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestO/include/amsstabilityo1.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "process_info.h" namespace OHOS { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestO/src/amsstabilityo1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestO/src/amsstabilityo1.cpp index aabf5e5003..f17698a94b 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestO/src/amsstabilityo1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestO/src/amsstabilityo1.cpp @@ -20,7 +20,7 @@ namespace AppExecFwk { void AmsStAbilityO1::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityO1::onStart"); + HILOG_INFO("AmsStAbilityO1::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -35,7 +35,7 @@ void AmsStAbilityO1::OnStart(const Want &want) void AmsStAbilityO1::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityO1::OnNewWant"); + HILOG_INFO("AmsStAbilityO1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -43,7 +43,7 @@ void AmsStAbilityO1::OnNewWant(const Want &want) void AmsStAbilityO1::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityO1::OnForeground"); + HILOG_INFO("AmsStAbilityO1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -51,7 +51,7 @@ void AmsStAbilityO1::OnForeground(const Want &want) void AmsStAbilityO1::OnStop() { - APP_LOGI("AmsStAbilityO1::onStop"); + HILOG_INFO("AmsStAbilityO1::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -60,7 +60,7 @@ void AmsStAbilityO1::OnStop() void AmsStAbilityO1::OnActive() { - APP_LOGI("AmsStAbilityO1::OnActive"); + HILOG_INFO("AmsStAbilityO1::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle, ","); std::string startAbilityName = this->Split(targetAbility, ","); @@ -84,7 +84,7 @@ void AmsStAbilityO1::OnActive() void AmsStAbilityO1::OnInactive() { - APP_LOGI("AmsStAbilityO1::OnInactive"); + HILOG_INFO("AmsStAbilityO1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -92,7 +92,7 @@ void AmsStAbilityO1::OnInactive() void AmsStAbilityO1::OnBackground() { - APP_LOGI("AmsStAbilityO1::OnBackground"); + HILOG_INFO("AmsStAbilityO1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestP/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestP/BUILD.gn index 6888da2869..fe271849fb 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestP/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestP/BUILD.gn @@ -24,13 +24,14 @@ config("amsSystemTestPConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestP\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestP\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestP") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestP/include/amsstabilityp1.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestP/include/amsstabilityp1.h index 28c566882c..cc10fec42c 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestP/include/amsstabilityp1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestP/include/amsstabilityp1.h @@ -18,7 +18,7 @@ #include "stpageabilityevent.h" #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "process_info.h" namespace OHOS { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestP/src/amsstabilityp1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestP/src/amsstabilityp1.cpp index afe9cc7c52..a708879bf3 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestP/src/amsstabilityp1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestP/src/amsstabilityp1.cpp @@ -20,7 +20,7 @@ namespace AppExecFwk { void AmsStAbilityP1::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityP1::onStart"); + HILOG_INFO("AmsStAbilityP1::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -35,7 +35,7 @@ void AmsStAbilityP1::OnStart(const Want &want) void AmsStAbilityP1::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityP1::OnNewWant"); + HILOG_INFO("AmsStAbilityP1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -43,7 +43,7 @@ void AmsStAbilityP1::OnNewWant(const Want &want) void AmsStAbilityP1::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityP1::OnForeground"); + HILOG_INFO("AmsStAbilityP1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -51,7 +51,7 @@ void AmsStAbilityP1::OnForeground(const Want &want) void AmsStAbilityP1::OnStop() { - APP_LOGI("AmsStAbilityP1::onStop"); + HILOG_INFO("AmsStAbilityP1::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -60,7 +60,7 @@ void AmsStAbilityP1::OnStop() void AmsStAbilityP1::OnActive() { - APP_LOGI("AmsStAbilityP1::OnActive"); + HILOG_INFO("AmsStAbilityP1::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle, ","); std::string startAbilityName = this->Split(targetAbility, ","); @@ -84,7 +84,7 @@ void AmsStAbilityP1::OnActive() void AmsStAbilityP1::OnInactive() { - APP_LOGI("AmsStAbilityP1::OnInactive"); + HILOG_INFO("AmsStAbilityP1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -92,7 +92,7 @@ void AmsStAbilityP1::OnInactive() void AmsStAbilityP1::OnBackground() { - APP_LOGI("AmsStAbilityP1::OnBackground"); + HILOG_INFO("AmsStAbilityP1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/BUILD.gn index aef172dd96..ab19ed7876 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/BUILD.gn @@ -24,13 +24,14 @@ config("amsSystemTestQConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestQ\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestQ\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestQ") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/include/amsstabilityq1.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/include/amsstabilityq1.h index bbed9633d9..58abee3f65 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/include/amsstabilityq1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/include/amsstabilityq1.h @@ -19,7 +19,7 @@ #include #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/include/amsstabilityq2.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/include/amsstabilityq2.h index 50537923cd..80747e55a8 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/include/amsstabilityq2.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/include/amsstabilityq2.h @@ -19,7 +19,7 @@ #include #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/include/amsstabilityq3.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/include/amsstabilityq3.h index e23c12cbe4..c475d6e8d1 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/include/amsstabilityq3.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/include/amsstabilityq3.h @@ -19,7 +19,7 @@ #include #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/include/amsstabilityq4.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/include/amsstabilityq4.h index 442542f736..bda8f87ff5 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/include/amsstabilityq4.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/include/amsstabilityq4.h @@ -19,7 +19,7 @@ #include #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/src/amsstabilityq1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/src/amsstabilityq1.cpp index 703b731635..21cc168252 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/src/amsstabilityq1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/src/amsstabilityq1.cpp @@ -21,7 +21,7 @@ void AmsStAbilityQ1::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AmsStAbilityQ1::Init"); + HILOG_INFO("AmsStAbilityQ1::Init"); Ability::Init(abilityInfo, application, handler, token); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); } @@ -29,7 +29,7 @@ void AmsStAbilityQ1::Init(const std::shared_ptr &abilityInfo, void AmsStAbilityQ1::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityQ1::onStart"); + HILOG_INFO("AmsStAbilityQ1::onStart"); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnStartCount(), eventData); @@ -37,7 +37,7 @@ void AmsStAbilityQ1::OnStart(const Want &want) void AmsStAbilityQ1::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityQ1::OnNewWant"); + HILOG_INFO("AmsStAbilityQ1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -45,7 +45,7 @@ void AmsStAbilityQ1::OnNewWant(const Want &want) void AmsStAbilityQ1::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityQ1::OnForeground"); + HILOG_INFO("AmsStAbilityQ1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -53,7 +53,7 @@ void AmsStAbilityQ1::OnForeground(const Want &want) void AmsStAbilityQ1::OnStop() { - APP_LOGI("AmsStAbilityQ1::onStop"); + HILOG_INFO("AmsStAbilityQ1::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -62,7 +62,7 @@ void AmsStAbilityQ1::OnStop() void AmsStAbilityQ1::OnActive() { - APP_LOGI("AmsStAbilityQ1::OnActive"); + HILOG_INFO("AmsStAbilityQ1::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle, ","); std::string startAbilityName = this->Split(targetAbility, ","); @@ -86,7 +86,7 @@ void AmsStAbilityQ1::OnActive() void AmsStAbilityQ1::OnInactive() { - APP_LOGI("AmsStAbilityQ1::OnInactive"); + HILOG_INFO("AmsStAbilityQ1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -94,7 +94,7 @@ void AmsStAbilityQ1::OnInactive() void AmsStAbilityQ1::OnBackground() { - APP_LOGI("AmsStAbilityQ1::OnBackground"); + HILOG_INFO("AmsStAbilityQ1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/src/amsstabilityq2.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/src/amsstabilityq2.cpp index c82d683341..4309c709d9 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/src/amsstabilityq2.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/src/amsstabilityq2.cpp @@ -21,7 +21,7 @@ void AmsStAbilityQ2::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AmsStAbilityQ2::Init"); + HILOG_INFO("AmsStAbilityQ2::Init"); Ability::Init(abilityInfo, application, handler, token); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); std::string eventData = GetAbilityName() + STEventName::g_abilityStateInit; @@ -32,7 +32,7 @@ void AmsStAbilityQ2::Init(const std::shared_ptr &abilityInfo, void AmsStAbilityQ2::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityQ2::onStart"); + HILOG_INFO("AmsStAbilityQ2::onStart"); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnStartCount(), eventData); @@ -40,7 +40,7 @@ void AmsStAbilityQ2::OnStart(const Want &want) void AmsStAbilityQ2::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityQ2::OnNewWant"); + HILOG_INFO("AmsStAbilityQ2::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -48,7 +48,7 @@ void AmsStAbilityQ2::OnNewWant(const Want &want) void AmsStAbilityQ2::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityQ2::OnForeground"); + HILOG_INFO("AmsStAbilityQ2::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -56,7 +56,7 @@ void AmsStAbilityQ2::OnForeground(const Want &want) void AmsStAbilityQ2::OnStop() { - APP_LOGI("AmsStAbilityQ2::onStop"); + HILOG_INFO("AmsStAbilityQ2::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -65,7 +65,7 @@ void AmsStAbilityQ2::OnStop() void AmsStAbilityQ2::OnActive() { - APP_LOGI("AmsStAbilityQ2::OnActive"); + HILOG_INFO("AmsStAbilityQ2::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle, ","); std::string startAbilityName = this->Split(targetAbility, ","); @@ -89,7 +89,7 @@ void AmsStAbilityQ2::OnActive() void AmsStAbilityQ2::OnInactive() { - APP_LOGI("AmsStAbilityQ2::OnInactive"); + HILOG_INFO("AmsStAbilityQ2::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -97,7 +97,7 @@ void AmsStAbilityQ2::OnInactive() void AmsStAbilityQ2::OnBackground() { - APP_LOGI("AmsStAbilityQ2::OnBackground"); + HILOG_INFO("AmsStAbilityQ2::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/src/amsstabilityq3.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/src/amsstabilityq3.cpp index fdf423c03d..71d270bee8 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/src/amsstabilityq3.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/src/amsstabilityq3.cpp @@ -20,7 +20,7 @@ namespace AppExecFwk { void AmsStAbilityQ3::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityQ3::onStart"); + HILOG_INFO("AmsStAbilityQ3::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -29,7 +29,7 @@ void AmsStAbilityQ3::OnStart(const Want &want) void AmsStAbilityQ3::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityQ3::OnNewWant"); + HILOG_INFO("AmsStAbilityQ3::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -37,7 +37,7 @@ void AmsStAbilityQ3::OnNewWant(const Want &want) void AmsStAbilityQ3::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityQ3::OnForeground"); + HILOG_INFO("AmsStAbilityQ3::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -45,7 +45,7 @@ void AmsStAbilityQ3::OnForeground(const Want &want) void AmsStAbilityQ3::OnStop() { - APP_LOGI("AmsStAbilityQ3::onStop"); + HILOG_INFO("AmsStAbilityQ3::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -54,7 +54,7 @@ void AmsStAbilityQ3::OnStop() void AmsStAbilityQ3::OnActive() { - APP_LOGI("AmsStAbilityQ3::OnActive"); + HILOG_INFO("AmsStAbilityQ3::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle, ","); std::string startAbilityName = this->Split(targetAbility, ","); @@ -78,7 +78,7 @@ void AmsStAbilityQ3::OnActive() void AmsStAbilityQ3::OnInactive() { - APP_LOGI("AmsStAbilityQ3::OnInactive"); + HILOG_INFO("AmsStAbilityQ3::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -86,7 +86,7 @@ void AmsStAbilityQ3::OnInactive() void AmsStAbilityQ3::OnBackground() { - APP_LOGI("AmsStAbilityQ3::OnBackground"); + HILOG_INFO("AmsStAbilityQ3::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/src/amsstabilityq4.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/src/amsstabilityq4.cpp index ae8b01fe01..a0b6e488fd 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/src/amsstabilityq4.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestQ/src/amsstabilityq4.cpp @@ -21,7 +21,7 @@ void AmsStAbilityQ4::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityQ4::onStart"); + HILOG_INFO("AmsStAbilityQ4::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityQ4::OnStart(const Want &want) void AmsStAbilityQ4::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityQ4::OnNewWant"); + HILOG_INFO("AmsStAbilityQ4::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityQ4::OnNewWant(const Want &want) void AmsStAbilityQ4::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityQ4::OnForeground"); + HILOG_INFO("AmsStAbilityQ4::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityQ4::OnForeground(const Want &want) void AmsStAbilityQ4::OnStop() { - APP_LOGI("AmsStAbilityQ4::onStop"); + HILOG_INFO("AmsStAbilityQ4::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityQ4::OnStop() void AmsStAbilityQ4::OnActive() { - APP_LOGI("AmsStAbilityQ4::OnActive"); + HILOG_INFO("AmsStAbilityQ4::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle, ","); std::string startAbilityName = this->Split(targetAbility, ","); @@ -79,7 +79,7 @@ void AmsStAbilityQ4::OnActive() void AmsStAbilityQ4::OnInactive() { - APP_LOGI("AmsStAbilityQ4::OnInactive"); + HILOG_INFO("AmsStAbilityQ4::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -87,7 +87,7 @@ void AmsStAbilityQ4::OnInactive() void AmsStAbilityQ4::OnBackground() { - APP_LOGI("AmsStAbilityQ4::OnBackground"); + HILOG_INFO("AmsStAbilityQ4::OnBackground"); Ability::OnBackground(); std::this_thread::sleep_for(std::chrono::milliseconds(STEventName::TERMINATE_TIMEOUT)); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/BUILD.gn index 477e9666fa..c967c50c88 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/BUILD.gn @@ -24,13 +24,14 @@ config("amsSystemTestRConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${SUBST_TOOLS_DIR}/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestR\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestR\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestR") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/include/amsstabilityr1.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/include/amsstabilityr1.h index 73e67b0d73..96ce024a25 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/include/amsstabilityr1.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/include/amsstabilityr1.h @@ -19,7 +19,7 @@ #include #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/include/amsstabilityr2.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/include/amsstabilityr2.h index 4d91d70134..a6f3f276c7 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/include/amsstabilityr2.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/include/amsstabilityr2.h @@ -19,7 +19,7 @@ #include #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/include/amsstabilityr3.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/include/amsstabilityr3.h index 9fd9bbda02..2aaecbb357 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/include/amsstabilityr3.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/include/amsstabilityr3.h @@ -19,7 +19,7 @@ #include #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/include/amsstabilityr4.h b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/include/amsstabilityr4.h index 4f0742445c..525c9c08c6 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/include/amsstabilityr4.h +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/include/amsstabilityr4.h @@ -19,7 +19,7 @@ #include #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/src/amsstabilityr1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/src/amsstabilityr1.cpp index 42b3d2879f..3767817ca9 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/src/amsstabilityr1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/src/amsstabilityr1.cpp @@ -21,7 +21,7 @@ void AmsStAbilityR1::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AmsStAbilityR1::Init"); + HILOG_INFO("AmsStAbilityR1::Init"); Ability::Init(abilityInfo, application, handler, token); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); std::string eventData = GetAbilityName() + STEventName::g_abilityStateInit; @@ -32,7 +32,7 @@ void AmsStAbilityR1::Init(const std::shared_ptr &abilityInfo, void AmsStAbilityR1::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityR1::onStart"); + HILOG_INFO("AmsStAbilityR1::onStart"); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnStartCount(), eventData); @@ -40,7 +40,7 @@ void AmsStAbilityR1::OnStart(const Want &want) void AmsStAbilityR1::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityR1::OnNewWant"); + HILOG_INFO("AmsStAbilityR1::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -48,7 +48,7 @@ void AmsStAbilityR1::OnNewWant(const Want &want) void AmsStAbilityR1::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityR1::OnForeground"); + HILOG_INFO("AmsStAbilityR1::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -56,7 +56,7 @@ void AmsStAbilityR1::OnForeground(const Want &want) void AmsStAbilityR1::OnStop() { - APP_LOGI("AmsStAbilityR1::onStop"); + HILOG_INFO("AmsStAbilityR1::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -65,7 +65,7 @@ void AmsStAbilityR1::OnStop() void AmsStAbilityR1::OnActive() { - APP_LOGI("AmsStAbilityR1::OnActive"); + HILOG_INFO("AmsStAbilityR1::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle, ","); std::string startAbilityName = this->Split(targetAbility, ","); @@ -89,7 +89,7 @@ void AmsStAbilityR1::OnActive() void AmsStAbilityR1::OnInactive() { - APP_LOGI("AmsStAbilityR1::OnInactive"); + HILOG_INFO("AmsStAbilityR1::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -97,7 +97,7 @@ void AmsStAbilityR1::OnInactive() void AmsStAbilityR1::OnBackground() { - APP_LOGI("AmsStAbilityR1::OnBackground"); + HILOG_INFO("AmsStAbilityR1::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/src/amsstabilityr2.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/src/amsstabilityr2.cpp index 75ee4caf38..4b665a1286 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/src/amsstabilityr2.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/src/amsstabilityr2.cpp @@ -24,7 +24,7 @@ void AmsStAbilityR2::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("AmsStAbilityR2::Init"); + HILOG_INFO("AmsStAbilityR2::Init"); Ability::Init(abilityInfo, application, handler, token); std::string eventData = GetAbilityName() + STEventName::g_abilityStateInit; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnStartCount(), eventData); @@ -34,7 +34,7 @@ void AmsStAbilityR2::Init(const std::shared_ptr &abilityInfo, void AmsStAbilityR2::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityR2::onStart"); + HILOG_INFO("AmsStAbilityR2::onStart"); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnStartCount(), eventData); @@ -42,7 +42,7 @@ void AmsStAbilityR2::OnStart(const Want &want) void AmsStAbilityR2::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityR2::OnNewWant"); + HILOG_INFO("AmsStAbilityR2::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -50,7 +50,7 @@ void AmsStAbilityR2::OnNewWant(const Want &want) void AmsStAbilityR2::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityR2::OnForeground"); + HILOG_INFO("AmsStAbilityR2::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -58,7 +58,7 @@ void AmsStAbilityR2::OnForeground(const Want &want) void AmsStAbilityR2::OnStop() { - APP_LOGI("AmsStAbilityR2::onStop"); + HILOG_INFO("AmsStAbilityR2::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -67,7 +67,7 @@ void AmsStAbilityR2::OnStop() void AmsStAbilityR2::OnActive() { - APP_LOGI("AmsStAbilityR2::OnActive"); + HILOG_INFO("AmsStAbilityR2::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle, ","); std::string startAbilityName = this->Split(targetAbility, ","); @@ -91,7 +91,7 @@ void AmsStAbilityR2::OnActive() void AmsStAbilityR2::OnInactive() { - APP_LOGI("AmsStAbilityR2::OnInactive"); + HILOG_INFO("AmsStAbilityR2::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -99,7 +99,7 @@ void AmsStAbilityR2::OnInactive() void AmsStAbilityR2::OnBackground() { - APP_LOGI("AmsStAbilityR2::OnBackground"); + HILOG_INFO("AmsStAbilityR2::OnBackground"); Ability::OnBackground(); std::this_thread::sleep_for(std::chrono::milliseconds(STEventName::BACKGROUND_TIMEOUT * multiple)); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/src/amsstabilityr3.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/src/amsstabilityr3.cpp index f8c1476c1f..b6b53af169 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/src/amsstabilityr3.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/src/amsstabilityr3.cpp @@ -23,7 +23,7 @@ constexpr uint32_t timeoutAdd = 5000; void AmsStAbilityR3::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityR3::onStart"); + HILOG_INFO("AmsStAbilityR3::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -32,7 +32,7 @@ void AmsStAbilityR3::OnStart(const Want &want) void AmsStAbilityR3::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityR3::OnNewWant"); + HILOG_INFO("AmsStAbilityR3::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -40,7 +40,7 @@ void AmsStAbilityR3::OnNewWant(const Want &want) void AmsStAbilityR3::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityR3::OnForeground"); + HILOG_INFO("AmsStAbilityR3::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -48,7 +48,7 @@ void AmsStAbilityR3::OnForeground(const Want &want) void AmsStAbilityR3::OnStop() { - APP_LOGI("AmsStAbilityR3::onStop"); + HILOG_INFO("AmsStAbilityR3::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -57,7 +57,7 @@ void AmsStAbilityR3::OnStop() void AmsStAbilityR3::OnActive() { - APP_LOGI("AmsStAbilityR3::OnActive"); + HILOG_INFO("AmsStAbilityR3::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle, ","); std::string startAbilityName = this->Split(targetAbility, ","); @@ -81,7 +81,7 @@ void AmsStAbilityR3::OnActive() void AmsStAbilityR3::OnInactive() { - APP_LOGI("AmsStAbilityR3::OnInactive"); + HILOG_INFO("AmsStAbilityR3::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -89,7 +89,7 @@ void AmsStAbilityR3::OnInactive() void AmsStAbilityR3::OnBackground() { - APP_LOGI("AmsStAbilityR3::OnBackground"); + HILOG_INFO("AmsStAbilityR3::OnBackground"); Ability::OnBackground(); std::this_thread::sleep_for(std::chrono::milliseconds(STEventName::TERMINATE_TIMEOUT + timeoutAdd)); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/src/amsstabilityr4.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/src/amsstabilityr4.cpp index 67730c5649..040d734559 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/src/amsstabilityr4.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestR/src/amsstabilityr4.cpp @@ -21,7 +21,7 @@ void AmsStAbilityR4::OnStart(const Want &want) { GetWantInfo(want); - APP_LOGI("AmsStAbilityR4::onStart"); + HILOG_INFO("AmsStAbilityR4::onStart"); pageAbilityEvent.SubscribeEvent(STEventName::g_eventList, shared_from_this()); Ability::OnStart(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStart; @@ -30,7 +30,7 @@ void AmsStAbilityR4::OnStart(const Want &want) void AmsStAbilityR4::OnNewWant(const Want &want) { - APP_LOGI("AmsStAbilityR4::OnNewWant"); + HILOG_INFO("AmsStAbilityR4::OnNewWant"); Ability::OnNewWant(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnNewWant; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnNewWantCount(), eventData); @@ -38,7 +38,7 @@ void AmsStAbilityR4::OnNewWant(const Want &want) void AmsStAbilityR4::OnForeground(const Want &want) { - APP_LOGI("AmsStAbilityR4::OnForeground"); + HILOG_INFO("AmsStAbilityR4::OnForeground"); Ability::OnForeground(want); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnForeground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnForegroundCount(), eventData); @@ -46,7 +46,7 @@ void AmsStAbilityR4::OnForeground(const Want &want) void AmsStAbilityR4::OnStop() { - APP_LOGI("AmsStAbilityR4::onStop"); + HILOG_INFO("AmsStAbilityR4::onStop"); Ability::OnStop(); pageAbilityEvent.UnsubscribeEvent(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnStop; @@ -55,7 +55,7 @@ void AmsStAbilityR4::OnStop() void AmsStAbilityR4::OnActive() { - APP_LOGI("AmsStAbilityR4::OnActive"); + HILOG_INFO("AmsStAbilityR4::OnActive"); Ability::OnActive(); std::string startBundleName = this->Split(targetBundle, ","); std::string startAbilityName = this->Split(targetAbility, ","); @@ -79,7 +79,7 @@ void AmsStAbilityR4::OnActive() void AmsStAbilityR4::OnInactive() { - APP_LOGI("AmsStAbilityR4::OnInactive"); + HILOG_INFO("AmsStAbilityR4::OnInactive"); Ability::OnInactive(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnInactive; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnInactiveCount(), eventData); @@ -87,7 +87,7 @@ void AmsStAbilityR4::OnInactive() void AmsStAbilityR4::OnBackground() { - APP_LOGI("AmsStAbilityR4::OnBackground"); + HILOG_INFO("AmsStAbilityR4::OnBackground"); Ability::OnBackground(); std::string eventData = GetAbilityName() + STEventName::g_abilityStateOnBackground; pageAbilityEvent.PublishEvent(STEventName::g_eventName, pageAbilityEvent.GetOnBackgroundCount(), eventData); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceA/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceA/BUILD.gn index 85cd9814e9..3c8d55fd6b 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceA/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceA/BUILD.gn @@ -25,12 +25,13 @@ config("amsSystemTestCConfig") { "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${appexecfwk_path}/services/bundlemgr/include", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestServiceA\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestServiceA\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestServiceA") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceA/src/ams_st_service_ability_a1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceA/src/ams_st_service_ability_a1.cpp index e09ade6303..81f3699cff 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceA/src/ams_st_service_ability_a1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceA/src/ams_st_service_ability_a1.cpp @@ -14,7 +14,7 @@ */ #include "ams_st_service_ability_a1.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" using namespace OHOS::EventFwk; @@ -38,7 +38,7 @@ AmsStServiceAbilityA1::~AmsStServiceAbilityA1() std::vector AmsStServiceAbilityA1::Split(std::string str, const std::string &token) { - APP_LOGI("AmsStServiceAbilityA1::Split"); + HILOG_INFO("AmsStServiceAbilityA1::Split"); std::vector splitString; while (str.size()) { @@ -58,10 +58,10 @@ std::vector AmsStServiceAbilityA1::Split(std::string str, const std } void AmsStServiceAbilityA1::StartOtherAbility() { - APP_LOGI("AmsStServiceAbilityA1::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", + HILOG_INFO("AmsStServiceAbilityA1::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", targetBundle_.c_str(), targetAbility_.c_str()); - APP_LOGI("AmsStServiceAbilityA1::StartOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("AmsStServiceAbilityA1::StartOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -84,11 +84,11 @@ void AmsStServiceAbilityA1::StartOtherAbility() } void AmsStServiceAbilityA1::ConnectOtherAbility() { - APP_LOGI( + HILOG_INFO( "AmsStServiceAbilityA1::ConnectOtherAbility begin targetBundleConn=%{public}s, targetAbilityConn=%{public}s", targetBundleConn_.c_str(), targetAbilityConn_.c_str()); - APP_LOGI("AmsStServiceAbilityA1::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("AmsStServiceAbilityA1::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -107,35 +107,35 @@ void AmsStServiceAbilityA1::ConnectOtherAbility() want.SetParam("targetAbilityConn", nextTargetAbilityConn_); stub_ = new (std::nothrow) AbilityConnectCallback(); connCallback_ = new (std::nothrow) AbilityConnectionProxy(stub_); - APP_LOGI("AmsStServiceAbilityA1::ConnectOtherAbility->ConnectAbility"); + HILOG_INFO("AmsStServiceAbilityA1::ConnectOtherAbility->ConnectAbility"); bool ret = ConnectAbility(want, connCallback_); sleep(1); if (!ret) { - APP_LOGE("AmsStServiceAbilityA1::ConnectAbility failed!"); + HILOG_ERROR("AmsStServiceAbilityA1::ConnectAbility failed!"); } } } } void AmsStServiceAbilityA1::DisConnectOtherAbility() { - APP_LOGI("AmsStServiceAbilityA1::DisConnectOtherAbility begin"); + HILOG_INFO("AmsStServiceAbilityA1::DisConnectOtherAbility begin"); if (connCallback_ != nullptr) { DisconnectAbility(connCallback_); sleep(1); } - APP_LOGI("AmsStServiceAbilityA1::DisConnectOtherAbility end"); + HILOG_INFO("AmsStServiceAbilityA1::DisConnectOtherAbility end"); } void AmsStServiceAbilityA1::StopSelfAbility() { - APP_LOGI("AmsStServiceAbilityA1::StopSelfAbility"); + HILOG_INFO("AmsStServiceAbilityA1::StopSelfAbility"); TerminateAbility(); } void AmsStServiceAbilityA1::OnStart(const Want &want) { - APP_LOGI("AmsStServiceAbilityA1::OnStart"); + HILOG_INFO("AmsStServiceAbilityA1::OnStart"); GetWantInfo(want); Ability::OnStart(want); @@ -150,7 +150,7 @@ void AmsStServiceAbilityA1::OnStart(const Want &want) } void AmsStServiceAbilityA1::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("AmsStServiceAbilityA1::OnCommand"); + HILOG_INFO("AmsStServiceAbilityA1::OnCommand"); GetWantInfo(want); Ability::OnCommand(want, restart, startId); @@ -158,35 +158,35 @@ void AmsStServiceAbilityA1::OnCommand(const AAFwk::Want &want, bool restart, int } void AmsStServiceAbilityA1::OnNewWant(const Want &want) { - APP_LOGI("AmsStServiceAbilityA1::OnNewWant"); + HILOG_INFO("AmsStServiceAbilityA1::OnNewWant"); GetWantInfo(want); Ability::OnNewWant(want); } void AmsStServiceAbilityA1::OnStop() { - APP_LOGI("AmsStServiceAbilityA1::OnStop"); + HILOG_INFO("AmsStServiceAbilityA1::OnStop"); Ability::OnStop(); PublishEvent(APP_A1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); } void AmsStServiceAbilityA1::OnActive() { - APP_LOGI("AmsStServiceAbilityA1::OnActive"); + HILOG_INFO("AmsStServiceAbilityA1::OnActive"); Ability::OnActive(); PublishEvent(APP_A1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); } void AmsStServiceAbilityA1::OnInactive() { - APP_LOGI("AmsStServiceAbilityA1::OnInactive"); + HILOG_INFO("AmsStServiceAbilityA1::OnInactive"); Ability::OnInactive(); PublishEvent(APP_A1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); } void AmsStServiceAbilityA1::OnBackground() { - APP_LOGI("AmsStServiceAbilityA1::OnBackground"); + HILOG_INFO("AmsStServiceAbilityA1::OnBackground"); Ability::OnBackground(); PublishEvent(APP_A1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); @@ -221,7 +221,7 @@ void AmsStServiceAbilityA1::GetWantInfo(const Want &want) } bool AmsStServiceAbilityA1::PublishEvent(const std::string &eventName, const int &code, const std::string &data) { - APP_LOGI("AmsStServiceAbilityA1::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("AmsStServiceAbilityA1::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), code, data.c_str()); @@ -236,7 +236,7 @@ bool AmsStServiceAbilityA1::PublishEvent(const std::string &eventName, const int } sptr AmsStServiceAbilityA1::OnConnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityA1::OnConnect"); + HILOG_INFO("AmsStServiceAbilityA1::OnConnect"); sptr ret = Ability::OnConnect(want); PublishEvent(APP_A1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnConnect"); @@ -244,7 +244,7 @@ sptr AmsStServiceAbilityA1::OnConnect(const Want &want) } void AmsStServiceAbilityA1::OnDisconnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityA1::OnDisconnect"); + HILOG_INFO("AmsStServiceAbilityA1::OnDisconnect"); Ability::OnDisconnect(want); PublishEvent(APP_A1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnDisconnect"); @@ -263,13 +263,13 @@ void AmsStServiceAbilityA1::AppEventSubscriber::OnReceiveEvent(const CommonEvent { auto eventName = data.GetWant().GetAction(); auto dataContent = data.GetData(); - APP_LOGI("AmsStServiceAbilityA1::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("AmsStServiceAbilityA1::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), dataContent.c_str()); if (APP_A1_REQ_EVENT_NAME.compare(eventName) == 0) { if (funcMap_.find(dataContent) == funcMap_.end()) { - APP_LOGI( + HILOG_INFO( "AmsStServiceAbilityA1::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceB/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceB/BUILD.gn index 807832bc53..63d9f46b1f 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceB/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceB/BUILD.gn @@ -25,12 +25,13 @@ config("amsSystemTestCConfig") { "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${appexecfwk_path}/services/bundlemgr/include", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestServiceB\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestServiceB\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestServiceB") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceB/src/ams_st_service_ability_b2.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceB/src/ams_st_service_ability_b2.cpp index 5ddaabfcbb..628a0a2da8 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceB/src/ams_st_service_ability_b2.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceB/src/ams_st_service_ability_b2.cpp @@ -14,7 +14,7 @@ */ #include "ams_st_service_ability_b2.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" using namespace OHOS::EventFwk; namespace OHOS { @@ -34,7 +34,7 @@ AmsStServiceAbilityB2::~AmsStServiceAbilityB2() std::vector AmsStServiceAbilityB2::Split(std::string str, const std::string &token) { - APP_LOGI("AmsStServiceAbilityB2::Split"); + HILOG_INFO("AmsStServiceAbilityB2::Split"); std::vector splitString; while (str.size()) { @@ -54,10 +54,10 @@ std::vector AmsStServiceAbilityB2::Split(std::string str, const std } void AmsStServiceAbilityB2::StartOtherAbility() { - APP_LOGI("AmsStServiceAbilityB2::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", + HILOG_INFO("AmsStServiceAbilityB2::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", targetBundle_.c_str(), targetAbility_.c_str()); - APP_LOGI("AmsStServiceAbilityB2::StartOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("AmsStServiceAbilityB2::StartOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -80,11 +80,11 @@ void AmsStServiceAbilityB2::StartOtherAbility() } void AmsStServiceAbilityB2::ConnectOtherAbility() { - APP_LOGI( + HILOG_INFO( "AmsStServiceAbilityB2::ConnectOtherAbility begin targetBundleConn=%{public}s, targetAbilityConn=%{public}s", targetBundleConn_.c_str(), targetAbilityConn_.c_str()); - APP_LOGI("AmsStServiceAbilityB2::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("AmsStServiceAbilityB2::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -103,36 +103,36 @@ void AmsStServiceAbilityB2::ConnectOtherAbility() want.SetParam("nextTargetAbilityConn", nextTargetAbilityConn_); stub_.push_back(new (std::nothrow) AbilityConnectCallback()); connCallback_.push_back(new (std::nothrow) AbilityConnectionProxy(stub_[i])); - APP_LOGI("AmsStAbilitySvcD1::ConnectOtherAbility->ConnectAbility"); + HILOG_INFO("AmsStAbilitySvcD1::ConnectOtherAbility->ConnectAbility"); bool ret = ConnectAbility(want, connCallback_[i]); sleep(1); if (!ret) { - APP_LOGE("AmsStServiceAbilityB2::ConnectAbility failed!"); + HILOG_ERROR("AmsStServiceAbilityB2::ConnectAbility failed!"); } } } - APP_LOGI("AmsStServiceAbilityB2::ConnectOtherAbility end"); + HILOG_INFO("AmsStServiceAbilityB2::ConnectOtherAbility end"); } void AmsStServiceAbilityB2::StopSelfAbility() { - APP_LOGI("AmsStServiceAbilityB2::StopSelfAbility"); + HILOG_INFO("AmsStServiceAbilityB2::StopSelfAbility"); TerminateAbility(); } void AmsStServiceAbilityB2::DisConnectOtherAbility() { - APP_LOGI("AmsStServiceAbilityB2::DisConnectOtherAbility begin"); + HILOG_INFO("AmsStServiceAbilityB2::DisConnectOtherAbility begin"); for (auto callBack : connCallback_) { DisconnectAbility(callBack); sleep(1); } - APP_LOGI("AmsStServiceAbilityB2::DisConnectOtherAbility end"); + HILOG_INFO("AmsStServiceAbilityB2::DisConnectOtherAbility end"); } void AmsStServiceAbilityB2::OnStart(const Want &want) { - APP_LOGI("AmsStServiceAbilityB2::OnStart"); + HILOG_INFO("AmsStServiceAbilityB2::OnStart"); GetWantInfo(want); Ability::OnStart(want); @@ -141,14 +141,14 @@ void AmsStServiceAbilityB2::OnStart(const Want &want) } void AmsStServiceAbilityB2::OnNewWant(const Want &want) { - APP_LOGI("AmsStServiceAbilityB2::OnNewWant"); + HILOG_INFO("AmsStServiceAbilityB2::OnNewWant"); GetWantInfo(want); Ability::OnNewWant(want); } void AmsStServiceAbilityB2::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("AmsStServiceAbilityB2::OnCommand"); + HILOG_INFO("AmsStServiceAbilityB2::OnCommand"); GetWantInfo(want); Ability::OnCommand(want, restart, startId); @@ -156,7 +156,7 @@ void AmsStServiceAbilityB2::OnCommand(const AAFwk::Want &want, bool restart, int } void AmsStServiceAbilityB2::OnStop() { - APP_LOGI("AmsStServiceAbilityB2::OnStop"); + HILOG_INFO("AmsStServiceAbilityB2::OnStop"); Ability::OnStop(); PublishEvent(APP_B2_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); @@ -164,21 +164,21 @@ void AmsStServiceAbilityB2::OnStop() } void AmsStServiceAbilityB2::OnActive() { - APP_LOGI("AmsStServiceAbilityB2::OnActive"); + HILOG_INFO("AmsStServiceAbilityB2::OnActive"); Ability::OnActive(); PublishEvent(APP_B2_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); } void AmsStServiceAbilityB2::OnInactive() { - APP_LOGI("AmsStServiceAbilityB2::OnInactive"); + HILOG_INFO("AmsStServiceAbilityB2::OnInactive"); Ability::OnInactive(); PublishEvent(APP_B2_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); } void AmsStServiceAbilityB2::OnBackground() { - APP_LOGI("AmsStServiceAbilityB2::OnBackground"); + HILOG_INFO("AmsStServiceAbilityB2::OnBackground"); Ability::OnBackground(); PublishEvent(APP_B2_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); @@ -186,7 +186,7 @@ void AmsStServiceAbilityB2::OnBackground() sptr AmsStServiceAbilityB2::OnConnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityB2::OnConnect"); + HILOG_INFO("AmsStServiceAbilityB2::OnConnect"); sptr remote = Ability::OnConnect(want); PublishEvent(APP_B2_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnConnect"); @@ -194,7 +194,7 @@ sptr AmsStServiceAbilityB2::OnConnect(const Want &want) } void AmsStServiceAbilityB2::OnDisconnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityB2::OnDisconnect"); + HILOG_INFO("AmsStServiceAbilityB2::OnDisconnect"); Ability::OnDisconnect(want); PublishEvent(APP_B2_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnDisconnect"); @@ -229,7 +229,7 @@ void AmsStServiceAbilityB2::GetWantInfo(const Want &want) } bool AmsStServiceAbilityB2::PublishEvent(const std::string &eventName, const int &code, const std::string &data) { - APP_LOGI("AmsStServiceAbilityB2::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("AmsStServiceAbilityB2::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), code, data.c_str()); @@ -256,14 +256,14 @@ void AmsStServiceAbilityB2::AppEventSubscriber::OnReceiveEvent(const CommonEvent { auto eventName = data.GetWant().GetAction(); auto dataContent = data.GetData(); - APP_LOGI( + HILOG_INFO( "AmsStServiceAbilityB2::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s is exist", eventName.c_str(), data.GetCode(), dataContent.c_str()); if (APP_B1_REQ_EVENT_NAME.compare(eventName) == 0) { if (funcMap_.find(dataContent) == funcMap_.end()) { - APP_LOGI("AmsStServiceAbilityB2::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = " + HILOG_INFO("AmsStServiceAbilityB2::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = " "%{public}s not find", eventName.c_str(), data.GetCode(), diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceB/src/ams_st_service_ability_b3.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceB/src/ams_st_service_ability_b3.cpp index dc11dea473..f5e3129610 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceB/src/ams_st_service_ability_b3.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceB/src/ams_st_service_ability_b3.cpp @@ -14,7 +14,7 @@ */ #include "ams_st_service_ability_b3.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" using namespace OHOS::EventFwk; @@ -36,7 +36,7 @@ AmsStServiceAbilityB3::~AmsStServiceAbilityB3() std::vector AmsStServiceAbilityB3::Split(std::string str, const std::string &token) { - APP_LOGI("AmsStServiceAbilityB3::Split"); + HILOG_INFO("AmsStServiceAbilityB3::Split"); std::vector splitString; while (str.size()) { @@ -56,10 +56,10 @@ std::vector AmsStServiceAbilityB3::Split(std::string str, const std } void AmsStServiceAbilityB3::StartOtherAbility() { - APP_LOGI("AmsStServiceAbilityB3::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", + HILOG_INFO("AmsStServiceAbilityB3::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", targetBundle_.c_str(), targetAbility_.c_str()); - APP_LOGI("AmsStServiceAbilityB3::StartOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("AmsStServiceAbilityB3::StartOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -82,11 +82,11 @@ void AmsStServiceAbilityB3::StartOtherAbility() } void AmsStServiceAbilityB3::ConnectOtherAbility() { - APP_LOGI( + HILOG_INFO( "AmsStServiceAbilityB3::ConnectOtherAbility begin targetBundleConn=%{public}s, targetAbilityConn=%{public}s", targetBundleConn_.c_str(), targetAbilityConn_.c_str()); - APP_LOGI("AmsStServiceAbilityB3::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("AmsStServiceAbilityB3::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -105,11 +105,11 @@ void AmsStServiceAbilityB3::ConnectOtherAbility() want.SetParam("targetAbilityConn", nextTargetAbilityConn_); stub_.push_back(new (std::nothrow) AbilityConnectCallback()); connCallback_.push_back(new (std::nothrow) AbilityConnectionProxy(stub_[i])); - APP_LOGI("AmsStAbilitySvcD1::ConnectOtherAbility->ConnectAbility"); + HILOG_INFO("AmsStAbilitySvcD1::ConnectOtherAbility->ConnectAbility"); bool ret = ConnectAbility(want, connCallback_[i]); sleep(1); if (!ret) { - APP_LOGE("AmsStServiceAbilityB3::ConnectAbility failed!"); + HILOG_ERROR("AmsStServiceAbilityB3::ConnectAbility failed!"); } } } @@ -117,24 +117,24 @@ void AmsStServiceAbilityB3::ConnectOtherAbility() void AmsStServiceAbilityB3::DisConnectOtherAbility() { - APP_LOGI("AmsStServiceAbilityB3::DisConnectOtherAbility begin"); + HILOG_INFO("AmsStServiceAbilityB3::DisConnectOtherAbility begin"); for (auto callBack : connCallback_) { DisconnectAbility(callBack); sleep(1); } - APP_LOGI("AmsStServiceAbilityB3::DisConnectOtherAbility end"); + HILOG_INFO("AmsStServiceAbilityB3::DisConnectOtherAbility end"); } void AmsStServiceAbilityB3::StopSelfAbility() { - APP_LOGI("AmsStServiceAbilityB3::StopSelfAbility"); + HILOG_INFO("AmsStServiceAbilityB3::StopSelfAbility"); TerminateAbility(); } void AmsStServiceAbilityB3::OnStart(const Want &want) { - APP_LOGI("AmsStServiceAbilityB3::onStart"); + HILOG_INFO("AmsStServiceAbilityB3::onStart"); GetWantInfo(want); Ability::OnStart(want); @@ -143,14 +143,14 @@ void AmsStServiceAbilityB3::OnStart(const Want &want) } void AmsStServiceAbilityB3::OnNewWant(const Want &want) { - APP_LOGI("AmsStServiceAbilityB3::OnNewWant"); + HILOG_INFO("AmsStServiceAbilityB3::OnNewWant"); GetWantInfo(want); Ability::OnNewWant(want); } void AmsStServiceAbilityB3::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("AmsStServiceAbilityB3::OnCommand"); + HILOG_INFO("AmsStServiceAbilityB3::OnCommand"); GetWantInfo(want); Ability::OnCommand(want, restart, startId); @@ -158,35 +158,35 @@ void AmsStServiceAbilityB3::OnCommand(const AAFwk::Want &want, bool restart, int } void AmsStServiceAbilityB3::OnStop() { - APP_LOGI("AmsStServiceAbilityB3::onStop"); + HILOG_INFO("AmsStServiceAbilityB3::onStop"); Ability::OnStop(); PublishEvent(APP_B3_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); } void AmsStServiceAbilityB3::OnActive() { - APP_LOGI("AmsStServiceAbilityB3::OnActive"); + HILOG_INFO("AmsStServiceAbilityB3::OnActive"); Ability::OnActive(); PublishEvent(APP_B3_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); } void AmsStServiceAbilityB3::OnInactive() { - APP_LOGI("AmsStServiceAbilityB3::OnInactive"); + HILOG_INFO("AmsStServiceAbilityB3::OnInactive"); Ability::OnInactive(); PublishEvent(APP_B3_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); } void AmsStServiceAbilityB3::OnBackground() { - APP_LOGI("AmsStServiceAbilityB3::OnBackground"); + HILOG_INFO("AmsStServiceAbilityB3::OnBackground"); Ability::OnBackground(); PublishEvent(APP_B3_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); } sptr AmsStServiceAbilityB3::OnConnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityB3::OnConnect"); + HILOG_INFO("AmsStServiceAbilityB3::OnConnect"); sptr remote = Ability::OnConnect(want); PublishEvent(APP_B3_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnConnect"); @@ -194,7 +194,7 @@ sptr AmsStServiceAbilityB3::OnConnect(const Want &want) } void AmsStServiceAbilityB3::OnDisconnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityB3::OnDisconnect"); + HILOG_INFO("AmsStServiceAbilityB3::OnDisconnect"); Ability::OnDisconnect(want); PublishEvent(APP_B3_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnDisconnect"); @@ -228,7 +228,7 @@ void AmsStServiceAbilityB3::GetWantInfo(const Want &want) } bool AmsStServiceAbilityB3::PublishEvent(const std::string &eventName, const int &code, const std::string &data) { - APP_LOGI("AmsStServiceAbilityB3::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("AmsStServiceAbilityB3::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), code, data.c_str()); @@ -243,7 +243,7 @@ bool AmsStServiceAbilityB3::PublishEvent(const std::string &eventName, const int } bool AmsStServiceAbilityB3::SubscribeEvent() { - APP_LOGI("AmsStServiceAbilityB3::SubscribeEvent"); + HILOG_INFO("AmsStServiceAbilityB3::SubscribeEvent"); MatchingSkills matchingSkills; matchingSkills.AddEvent(APP_B3_REQ_EVENT_NAME); @@ -257,13 +257,13 @@ void AmsStServiceAbilityB3::AppEventSubscriber::OnReceiveEvent(const CommonEvent { auto eventName = data.GetWant().GetAction(); auto dataContent = data.GetData(); - APP_LOGI("AmsStServiceAbilityB3::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("AmsStServiceAbilityB3::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), dataContent.c_str()); if (APP_B3_REQ_EVENT_NAME.compare(eventName) == 0) { if (funcMap_.find(dataContent) == funcMap_.end()) { - APP_LOGI( + HILOG_INFO( "AmsStServiceAbilityB3::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceC/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceC/BUILD.gn index 9c0eb349f7..c03c17660d 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceC/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceC/BUILD.gn @@ -25,12 +25,13 @@ config("amsSystemTestCConfig") { "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${appexecfwk_path}/services/bundlemgr/include", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestServiceC\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestServiceC\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestServiceC") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceC/src/ams_st_service_ability_c4.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceC/src/ams_st_service_ability_c4.cpp index 01c32d69cf..8c9308a626 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceC/src/ams_st_service_ability_c4.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceC/src/ams_st_service_ability_c4.cpp @@ -14,7 +14,7 @@ */ #include "ams_st_service_ability_c4.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" using namespace OHOS::EventFwk; @@ -36,7 +36,7 @@ AmsStServiceAbilityC4::~AmsStServiceAbilityC4() void AmsStServiceAbilityC4::OnStart(const Want &want) { - APP_LOGI("AmsStServiceAbilityC4::OnStart"); + HILOG_INFO("AmsStServiceAbilityC4::OnStart"); GetWantInfo(want); Ability::OnStart(want); @@ -45,7 +45,7 @@ void AmsStServiceAbilityC4::OnStart(const Want &want) } void AmsStServiceAbilityC4::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("AmsStServiceAbilityC4::OnCommand"); + HILOG_INFO("AmsStServiceAbilityC4::OnCommand"); GetWantInfo(want); Ability::OnCommand(want, restart, startId); @@ -53,42 +53,42 @@ void AmsStServiceAbilityC4::OnCommand(const AAFwk::Want &want, bool restart, int } void AmsStServiceAbilityC4::OnNewWant(const Want &want) { - APP_LOGI("AmsStServiceAbilityC4::OnNewWant"); + HILOG_INFO("AmsStServiceAbilityC4::OnNewWant"); GetWantInfo(want); Ability::OnNewWant(want); } void AmsStServiceAbilityC4::OnStop() { - APP_LOGI("AmsStServiceAbilityC4::OnStop"); + HILOG_INFO("AmsStServiceAbilityC4::OnStop"); Ability::OnStop(); PublishEvent(APP_C4_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); } void AmsStServiceAbilityC4::OnActive() { - APP_LOGI("AmsStServiceAbilityC4::OnActive"); + HILOG_INFO("AmsStServiceAbilityC4::OnActive"); Ability::OnActive(); PublishEvent(APP_C4_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); } void AmsStServiceAbilityC4::OnInactive() { - APP_LOGI("AmsStServiceAbilityC4::OnInactive"); + HILOG_INFO("AmsStServiceAbilityC4::OnInactive"); Ability::OnInactive(); PublishEvent(APP_C4_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); } void AmsStServiceAbilityC4::OnBackground() { - APP_LOGI("AmsStServiceAbilityC4::OnBackground"); + HILOG_INFO("AmsStServiceAbilityC4::OnBackground"); Ability::OnBackground(); PublishEvent(APP_C4_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); } sptr AmsStServiceAbilityC4::OnConnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityC4::OnConnect"); + HILOG_INFO("AmsStServiceAbilityC4::OnConnect"); sptr ret = Ability::OnConnect(want); PublishEvent(APP_C4_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnConnect"); @@ -96,22 +96,22 @@ sptr AmsStServiceAbilityC4::OnConnect(const Want &want) } void AmsStServiceAbilityC4::OnDisconnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityC4::OnDisconnect"); + HILOG_INFO("AmsStServiceAbilityC4::OnDisconnect"); Ability::OnDisconnect(want); PublishEvent(APP_C4_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnDisconnect"); } void AmsStServiceAbilityC4::StopSelfAbility() { - APP_LOGI("AmsStServiceAbilityC4::StopSelfAbility"); + HILOG_INFO("AmsStServiceAbilityC4::StopSelfAbility"); TerminateAbility(); } void AmsStServiceAbilityC4::DisConnectOtherAbility() { - APP_LOGI("AmsStServiceAbilityC4::DisConnectOtherAbility begin"); + HILOG_INFO("AmsStServiceAbilityC4::DisConnectOtherAbility begin"); - APP_LOGI("AmsStServiceAbilityB3::DisConnectOtherAbility end"); + HILOG_INFO("AmsStServiceAbilityB3::DisConnectOtherAbility end"); } void AmsStServiceAbilityC4::Clear() { @@ -128,7 +128,7 @@ void AmsStServiceAbilityC4::GetWantInfo(const Want &want) } bool AmsStServiceAbilityC4::PublishEvent(const std::string &eventName, const int &code, const std::string &data) { - APP_LOGI("AmsStServiceAbilityC4::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("AmsStServiceAbilityC4::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), code, data.c_str()); @@ -157,13 +157,13 @@ void AmsStServiceAbilityC4::AppEventSubscriber::OnReceiveEvent(const CommonEvent { auto eventName = data.GetWant().GetAction(); auto dataContent = data.GetData(); - APP_LOGI("AmsStServiceAbilityC4::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("AmsStServiceAbilityC4::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), dataContent.c_str()); if (APP_C4_REQ_EVENT_NAME.compare(eventName) == 0) { if (funcMap_.find(dataContent) == funcMap_.end()) { - APP_LOGI( + HILOG_INFO( "AmsStServiceAbilityC4::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceD/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceD/BUILD.gn index 64f9c56205..e9e6dba364 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceD/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceD/BUILD.gn @@ -25,12 +25,13 @@ config("amsSystemTestCConfig") { "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${appexecfwk_path}/services/bundlemgr/include", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestServiceD\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestServiceD\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestServiceD") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceD/src/ams_st_service_ability_d1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceD/src/ams_st_service_ability_d1.cpp index e2a7c0f243..28580675bf 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceD/src/ams_st_service_ability_d1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceD/src/ams_st_service_ability_d1.cpp @@ -14,7 +14,7 @@ */ #include "ams_st_service_ability_d1.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" using namespace OHOS::EventFwk; namespace OHOS { @@ -37,7 +37,7 @@ AmsStServiceAbilityD1::~AmsStServiceAbilityD1() std::vector AmsStServiceAbilityD1::Split(std::string str, const std::string &token) { - APP_LOGI("AmsStServiceAbilityD1::Split"); + HILOG_INFO("AmsStServiceAbilityD1::Split"); std::vector splitString; while (str.size()) { @@ -57,10 +57,10 @@ std::vector AmsStServiceAbilityD1::Split(std::string str, const std } void AmsStServiceAbilityD1::StartOtherAbility() { - APP_LOGI("AmsStServiceAbilityD1::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", + HILOG_INFO("AmsStServiceAbilityD1::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", targetBundle_.c_str(), targetAbility_.c_str()); - APP_LOGI("AmsStServiceAbilityD1::StartOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("AmsStServiceAbilityD1::StartOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -83,11 +83,11 @@ void AmsStServiceAbilityD1::StartOtherAbility() } void AmsStServiceAbilityD1::ConnectOtherAbility() { - APP_LOGI( + HILOG_INFO( "AmsStServiceAbilityD1::ConnectOtherAbility begin targetBundleConn=%{public}s, targetAbilityConn=%{public}s", targetBundleConn_.c_str(), targetAbilityConn_.c_str()); - APP_LOGI("AmsStServiceAbilityD1::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("AmsStServiceAbilityD1::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -106,37 +106,37 @@ void AmsStServiceAbilityD1::ConnectOtherAbility() want.SetParam("nextTargetAbilityConn", nextTargetAbilityConn_); stub_.push_back(new (std::nothrow) AbilityConnectCallback()); connCallback_.push_back(new (std::nothrow) AbilityConnectionProxy(stub_[i])); - APP_LOGI("AmsStServiceAbilityD1::ConnectOtherAbility->ConnectAbility"); + HILOG_INFO("AmsStServiceAbilityD1::ConnectOtherAbility->ConnectAbility"); bool ret = ConnectAbility(want, connCallback_[i]); sleep(1); if (!ret) { - APP_LOGE("AmsStServiceAbilityD1::ConnectAbility failed!"); + HILOG_ERROR("AmsStServiceAbilityD1::ConnectAbility failed!"); } } } - APP_LOGI("AmsStServiceAbilityD1::ConnectOtherAbility end"); + HILOG_INFO("AmsStServiceAbilityD1::ConnectOtherAbility end"); } void AmsStServiceAbilityD1::DisConnectOtherAbility() { - APP_LOGI("AmsStServiceAbilityD1::DisConnectOtherAbility begin"); + HILOG_INFO("AmsStServiceAbilityD1::DisConnectOtherAbility begin"); for (auto callBack : connCallback_) { DisconnectAbility(callBack); sleep(1); } - APP_LOGI("AmsStServiceAbilityD1::DisConnectOtherAbility end"); + HILOG_INFO("AmsStServiceAbilityD1::DisConnectOtherAbility end"); } void AmsStServiceAbilityD1::StopSelfAbility() { - APP_LOGI("AmsStServiceAbilityD1::StopSelfAbility"); + HILOG_INFO("AmsStServiceAbilityD1::StopSelfAbility"); TerminateAbility(); } void AmsStServiceAbilityD1::OnStart(const Want &want) { - APP_LOGI("AmsStServiceAbilityD1::OnStart"); + HILOG_INFO("AmsStServiceAbilityD1::OnStart"); GetWantInfo(want); Ability::OnStart(want); @@ -145,14 +145,14 @@ void AmsStServiceAbilityD1::OnStart(const Want &want) } void AmsStServiceAbilityD1::OnNewWant(const Want &want) { - APP_LOGI("AmsStServiceAbilityD1::OnNewWant"); + HILOG_INFO("AmsStServiceAbilityD1::OnNewWant"); GetWantInfo(want); Ability::OnNewWant(want); } void AmsStServiceAbilityD1::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("AmsStServiceAbilityD1::OnCommand"); + HILOG_INFO("AmsStServiceAbilityD1::OnCommand"); GetWantInfo(want); Ability::OnCommand(want, restart, startId); @@ -160,18 +160,18 @@ void AmsStServiceAbilityD1::OnCommand(const AAFwk::Want &want, bool restart, int } void AmsStServiceAbilityD1::OnStop() { - APP_LOGI("AmsStServiceAbilityD1::OnStop"); + HILOG_INFO("AmsStServiceAbilityD1::OnStop"); Ability::OnStop(); PublishEvent(APP_D1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); } void AmsStServiceAbilityD1::GetDataByDataAbility() { - APP_LOGI("AmsStServiceAbilityD1::GetDataByDataAbility"); + HILOG_INFO("AmsStServiceAbilityD1::GetDataByDataAbility"); std::shared_ptr helper = DataAbilityHelper::Creator(GetContext()); if (helper == nullptr) { - APP_LOGE("AmsStServiceAbilityD1::GetDataByDataAbility:helper == nullptr"); + HILOG_ERROR("AmsStServiceAbilityD1::GetDataByDataAbility:helper == nullptr"); return; } @@ -181,30 +181,30 @@ void AmsStServiceAbilityD1::GetDataByDataAbility() int count = result.size(); if (count > 0) { - APP_LOGI("AmsStServiceAbilityD1::GetDataByDataAbility get data ability data info result > 0!"); + HILOG_INFO("AmsStServiceAbilityD1::GetDataByDataAbility get data ability data info result > 0!"); PublishEvent(APP_D1_RESP_EVENT_NAME, 1, "GetDataByDataAbility"); } else { - APP_LOGI("AmsStServiceAbilityD1::GetDataByDataAbility get data ability data info result = 0!"); + HILOG_INFO("AmsStServiceAbilityD1::GetDataByDataAbility get data ability data info result = 0!"); PublishEvent(APP_D1_RESP_EVENT_NAME, 0, "GetDataByDataAbility"); } } void AmsStServiceAbilityD1::OnActive() { - APP_LOGI("AmsStServiceAbilityD1::OnActive"); + HILOG_INFO("AmsStServiceAbilityD1::OnActive"); Ability::OnActive(); PublishEvent(APP_D1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); } void AmsStServiceAbilityD1::OnInactive() { - APP_LOGI("AmsStServiceAbilityD1::OnInactive"); + HILOG_INFO("AmsStServiceAbilityD1::OnInactive"); Ability::OnInactive(); PublishEvent(APP_D1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); } void AmsStServiceAbilityD1::OnBackground() { - APP_LOGI("AmsStServiceAbilityD1::OnBackground"); + HILOG_INFO("AmsStServiceAbilityD1::OnBackground"); Ability::OnBackground(); PublishEvent(APP_D1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); @@ -239,7 +239,7 @@ void AmsStServiceAbilityD1::GetWantInfo(const Want &want) } bool AmsStServiceAbilityD1::PublishEvent(const std::string &eventName, const int &code, const std::string &data) { - APP_LOGI("AmsStServiceAbilityD1::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("AmsStServiceAbilityD1::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), code, data.c_str()); @@ -266,13 +266,13 @@ void AmsStServiceAbilityD1::AppEventSubscriber::OnReceiveEvent(const CommonEvent { auto eventName = data.GetWant().GetAction(); auto dataContent = data.GetData(); - APP_LOGI("AmsStServiceAbilityD1::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("AmsStServiceAbilityD1::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), dataContent.c_str()); if (APP_D1_REQ_EVENTNAME.compare(eventName) == 0) { if (funcMap_.find(dataContent) == funcMap_.end()) { - APP_LOGI( + HILOG_INFO( "AmsStServiceAbilityD1::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceE/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceE/BUILD.gn index 399429bd6e..d3068fc490 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceE/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceE/BUILD.gn @@ -25,12 +25,13 @@ config("amsSystemTestCConfig") { "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${appexecfwk_path}/services/bundlemgr/include", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestServiceE\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestServiceE\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestServiceE") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceE/src/ams_st_service_ability_e2.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceE/src/ams_st_service_ability_e2.cpp index 72f58c8812..b77b187617 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceE/src/ams_st_service_ability_e2.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceE/src/ams_st_service_ability_e2.cpp @@ -14,7 +14,7 @@ */ #include "ams_st_service_ability_e2.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ability_context.h" #include "ability.h" @@ -36,7 +36,7 @@ AmsStServiceAbilityE2::~AmsStServiceAbilityE2() std::vector AmsStServiceAbilityE2::Split(std::string str, const std::string &token) { - APP_LOGI("AmsStServiceAbilityE2::Split"); + HILOG_INFO("AmsStServiceAbilityE2::Split"); std::vector splitString; while (str.size()) { @@ -56,10 +56,10 @@ std::vector AmsStServiceAbilityE2::Split(std::string str, const std } void AmsStServiceAbilityE2::StartOtherAbility() { - APP_LOGI("AmsStServiceAbilityE2::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", + HILOG_INFO("AmsStServiceAbilityE2::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", targetBundle_.c_str(), targetAbility_.c_str()); - APP_LOGI("AmsStServiceAbilityE2::StartOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("AmsStServiceAbilityE2::StartOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -82,11 +82,11 @@ void AmsStServiceAbilityE2::StartOtherAbility() } void AmsStServiceAbilityE2::ConnectOtherAbility() { - APP_LOGI( + HILOG_INFO( "AmsStServiceAbilityE2::ConnectOtherAbility begin targetBundleConn=%{public}s, targetAbilityConn=%{public}s", targetBundleConn_.c_str(), targetAbilityConn_.c_str()); - APP_LOGI("AmsStServiceAbilityE2::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("AmsStServiceAbilityE2::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -105,19 +105,19 @@ void AmsStServiceAbilityE2::ConnectOtherAbility() want.SetParam("nextTargetAbilityConn", nextTargetAbilityConn_); stub_.push_back(new (std::nothrow) AbilityConnectCallback()); connCallback_.push_back(new (std::nothrow) AbilityConnectionProxy(stub_[i])); - APP_LOGI("AmsStServiceAbilityE2::ConnectOtherAbility->ConnectAbility"); + HILOG_INFO("AmsStServiceAbilityE2::ConnectOtherAbility->ConnectAbility"); bool ret = ConnectAbility(want, connCallback_[i]); sleep(1); if (!ret) { - APP_LOGE("AmsStServiceAbilityE2::ConnectAbility failed!"); + HILOG_ERROR("AmsStServiceAbilityE2::ConnectAbility failed!"); } } } - APP_LOGI("AmsStServiceAbilityE2::ConnectOtherAbility end"); + HILOG_INFO("AmsStServiceAbilityE2::ConnectOtherAbility end"); } void AmsStServiceAbilityE2::OnStart(const Want &want) { - APP_LOGI("AmsStServiceAbilityE2::OnStart"); + HILOG_INFO("AmsStServiceAbilityE2::OnStart"); GetWantInfo(want); Ability::OnStart(want); @@ -126,7 +126,7 @@ void AmsStServiceAbilityE2::OnStart(const Want &want) } void AmsStServiceAbilityE2::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("AmsStServiceAbilityE2::OnCommand"); + HILOG_INFO("AmsStServiceAbilityE2::OnCommand"); GetWantInfo(want); Ability::OnCommand(want, restart, startId); @@ -134,24 +134,24 @@ void AmsStServiceAbilityE2::OnCommand(const AAFwk::Want &want, bool restart, int } void AmsStServiceAbilityE2::OnNewWant(const Want &want) { - APP_LOGI("AmsStServiceAbilityE2::OnNewWant"); + HILOG_INFO("AmsStServiceAbilityE2::OnNewWant"); GetWantInfo(want); Ability::OnNewWant(want); } void AmsStServiceAbilityE2::DisConnectOtherAbility() { - APP_LOGI("AmsStServiceAbilityE2::DisConnectOtherAbility begin"); + HILOG_INFO("AmsStServiceAbilityE2::DisConnectOtherAbility begin"); if (connCallback_.size() > 0) { DisconnectAbility(connCallback_[0]); sleep(1); } - APP_LOGI("AmsStServiceAbilityE2::DisConnectOtherAbility end"); + HILOG_INFO("AmsStServiceAbilityE2::DisConnectOtherAbility end"); } void AmsStServiceAbilityE2::OnStop() { - APP_LOGI("AmsStServiceAbilityE2::onStop"); + HILOG_INFO("AmsStServiceAbilityE2::onStop"); Ability::OnStop(); PublishEvent(APP_E2_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); @@ -160,7 +160,7 @@ void AmsStServiceAbilityE2::GetDataByDataAbility() { std::shared_ptr helper = DataAbilityHelper::Creator(GetContext()); if (helper == nullptr) { - APP_LOGE("AmsStServiceAbilityE2::GetDataByDataAbility:helper == nullptr"); + HILOG_ERROR("AmsStServiceAbilityE2::GetDataByDataAbility:helper == nullptr"); return; } @@ -170,37 +170,37 @@ void AmsStServiceAbilityE2::GetDataByDataAbility() int count = result.size(); if (count > 0) { - APP_LOGI("AmsStServiceAbilityE2::OnBackground get data ability data info result > 0!"); + HILOG_INFO("AmsStServiceAbilityE2::OnBackground get data ability data info result > 0!"); PublishEvent(APP_E2_RESP_EVENT_NAME, 1, "GetDataByDataAbility"); } else { - APP_LOGI("AmsStServiceAbilityE2::OnBackground get data ability data info result = 0!"); + HILOG_INFO("AmsStServiceAbilityE2::OnBackground get data ability data info result = 0!"); PublishEvent(APP_E2_RESP_EVENT_NAME, 0, "GetDataByDataAbility"); } } void AmsStServiceAbilityE2::OnActive() { - APP_LOGI("AmsStServiceAbilityE2::OnActive"); + HILOG_INFO("AmsStServiceAbilityE2::OnActive"); Ability::OnActive(); PublishEvent(APP_E2_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); } void AmsStServiceAbilityE2::OnInactive() { - APP_LOGI("AmsStServiceAbilityE2::OnInactive"); + HILOG_INFO("AmsStServiceAbilityE2::OnInactive"); Ability::OnInactive(); PublishEvent(APP_E2_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); } void AmsStServiceAbilityE2::OnBackground() { - APP_LOGI("AmsStServiceAbilityE2::OnBackground"); + HILOG_INFO("AmsStServiceAbilityE2::OnBackground"); Ability::OnBackground(); PublishEvent(APP_E2_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); } sptr AmsStServiceAbilityE2::OnConnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityE2::OnConnect"); + HILOG_INFO("AmsStServiceAbilityE2::OnConnect"); Ability::OnConnect(want); PublishEvent(APP_E2_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnConnect"); @@ -208,7 +208,7 @@ sptr AmsStServiceAbilityE2::OnConnect(const Want &want) } void AmsStServiceAbilityE2::OnDisconnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityE2::OnDisconnect"); + HILOG_INFO("AmsStServiceAbilityE2::OnDisconnect"); Ability::OnDisconnect(want); PublishEvent(APP_E2_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnDisconnect"); @@ -242,7 +242,7 @@ void AmsStServiceAbilityE2::GetWantInfo(const Want &want) } bool AmsStServiceAbilityE2::PublishEvent(const std::string &eventName, const int &code, const std::string &data) { - APP_LOGI("AmsStServiceAbilityE2::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("AmsStServiceAbilityE2::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), code, data.c_str()); @@ -269,13 +269,13 @@ void AmsStServiceAbilityE2::AppEventSubscriber::OnReceiveEvent(const CommonEvent { auto eventName = data.GetWant().GetAction(); auto dataContent = data.GetData(); - APP_LOGI("AmsStServiceAbilityE2::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("AmsStServiceAbilityE2::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), dataContent.c_str()); if (APP_E2_REQ_EVENT_NAME.compare(eventName) == 0) { if (funcMap_.find(dataContent) == funcMap_.end()) { - APP_LOGI( + HILOG_INFO( "AmsStServiceAbilityE2::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceF/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceF/BUILD.gn index 1ed9d4fcf9..cc73375349 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceF/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceF/BUILD.gn @@ -25,12 +25,13 @@ config("amsSystemTestCConfig") { "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${appexecfwk_path}/services/bundlemgr/include", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestServiceF\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestServiceF\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestServiceF") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceF/src/ams_st_service_ability_f3.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceF/src/ams_st_service_ability_f3.cpp index 8d420fe0e4..5ad88c511e 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceF/src/ams_st_service_ability_f3.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceF/src/ams_st_service_ability_f3.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ams_st_service_ability_f3.h" #include "common_event.h" #include "common_event_manager.h" @@ -25,7 +25,7 @@ const std::string APP_F3_RESP_EVENT_NAME = "resp_com_ohos_amsst_service_app_f3"; std::vector AmsStServiceAbilityF3::GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) { - APP_LOGI("AmsStServiceAbilityF3 <<<>>>"); + HILOG_INFO("AmsStServiceAbilityF3 <<<>>>"); PublishEvent(APP_F3_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "GetFileTypes"); std::vector fileType = {"filetypes"}; return fileType; @@ -33,7 +33,7 @@ std::vector AmsStServiceAbilityF3::GetFileTypes(const Uri &uri, con void AmsStServiceAbilityF3::OnStart(const Want &want) { - APP_LOGI("AmsStServiceAbilityF3::onStart"); + HILOG_INFO("AmsStServiceAbilityF3::onStart"); GetWantInfo(want); Ability::OnStart(want); @@ -41,14 +41,14 @@ void AmsStServiceAbilityF3::OnStart(const Want &want) } void AmsStServiceAbilityF3::OnNewWant(const Want &want) { - APP_LOGI("AmsStServiceAbilityF3::OnNewWant"); + HILOG_INFO("AmsStServiceAbilityF3::OnNewWant"); GetWantInfo(want); Ability::OnNewWant(want); } void AmsStServiceAbilityF3::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("AmsStServiceAbilityF3::OnCommand"); + HILOG_INFO("AmsStServiceAbilityF3::OnCommand"); GetWantInfo(want); Ability::OnCommand(want, restart, startId); @@ -56,28 +56,28 @@ void AmsStServiceAbilityF3::OnCommand(const AAFwk::Want &want, bool restart, int } void AmsStServiceAbilityF3::OnStop() { - APP_LOGI("AmsStServiceAbilityF3::onStop"); + HILOG_INFO("AmsStServiceAbilityF3::onStop"); Ability::OnStop(); PublishEvent(APP_F3_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); } void AmsStServiceAbilityF3::OnActive() { - APP_LOGI("AmsStServiceAbilityF3::OnActive"); + HILOG_INFO("AmsStServiceAbilityF3::OnActive"); Ability::OnActive(); PublishEvent(APP_F3_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); } void AmsStServiceAbilityF3::OnInactive() { - APP_LOGI("AmsStServiceAbilityF3::OnInactive"); + HILOG_INFO("AmsStServiceAbilityF3::OnInactive"); Ability::OnInactive(); PublishEvent(APP_F3_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); } void AmsStServiceAbilityF3::OnBackground() { - APP_LOGI("AmsStServiceAbilityF3::OnBackground"); + HILOG_INFO("AmsStServiceAbilityF3::OnBackground"); Ability::OnBackground(); PublishEvent(APP_F3_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); @@ -98,7 +98,7 @@ void AmsStServiceAbilityF3::GetWantInfo(const Want &want) } bool AmsStServiceAbilityF3::PublishEvent(const std::string &eventName, const int &code, const std::string &data) { - APP_LOGI("AmsStServiceAbilityF3::PublishEvent eventName = %s, code = %d, data = %s", + HILOG_INFO("AmsStServiceAbilityF3::PublishEvent eventName = %s, code = %d, data = %s", eventName.c_str(), code, data.c_str()); diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceG/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceG/BUILD.gn index 9d37ee6270..dec0f18021 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceG/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceG/BUILD.gn @@ -25,12 +25,13 @@ config("amsSystemTestCConfig") { "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${appexecfwk_path}/services/bundlemgr/include", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestServiceG\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestServiceG\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestServiceG") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceG/src/ams_st_service_ability_g1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceG/src/ams_st_service_ability_g1.cpp index 398c08ea02..44b5651ab1 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceG/src/ams_st_service_ability_g1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceG/src/ams_st_service_ability_g1.cpp @@ -14,7 +14,7 @@ */ #include "ams_st_service_ability_g1.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ability_context.h" #include "ability.h" @@ -36,7 +36,7 @@ AmsStServiceAbilityG1::~AmsStServiceAbilityG1() std::vector AmsStServiceAbilityG1::Split(std::string str, const std::string &token) { - APP_LOGI("AmsStServiceAbilityG1::Split"); + HILOG_INFO("AmsStServiceAbilityG1::Split"); std::vector splitString; while (str.size()) { @@ -56,10 +56,10 @@ std::vector AmsStServiceAbilityG1::Split(std::string str, const std } void AmsStServiceAbilityG1::StartOtherAbility() { - APP_LOGI("AmsStServiceAbilityG1::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", + HILOG_INFO("AmsStServiceAbilityG1::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", targetBundle_.c_str(), targetAbility_.c_str()); - APP_LOGI("AmsStServiceAbilityG1::StartOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("AmsStServiceAbilityG1::StartOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -82,11 +82,11 @@ void AmsStServiceAbilityG1::StartOtherAbility() } void AmsStServiceAbilityG1::ConnectOtherAbility() { - APP_LOGI( + HILOG_INFO( "AmsStServiceAbilityG1::ConnectOtherAbility begin targetBundleConn=%{public}s, targetAbilityConn=%{public}s", targetBundleConn_.c_str(), targetAbilityConn_.c_str()); - APP_LOGI("AmsStServiceAbilityG1::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("AmsStServiceAbilityG1::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -105,19 +105,19 @@ void AmsStServiceAbilityG1::ConnectOtherAbility() want.SetParam("nextTargetAbilityConn", nextTargetAbilityConn_); stub_.push_back(new (std::nothrow) AbilityConnectCallback()); connCallback_.push_back(new (std::nothrow) AbilityConnectionProxy(stub_[i])); - APP_LOGI("AmsStServiceAbilityG1::ConnectOtherAbility->ConnectAbility"); + HILOG_INFO("AmsStServiceAbilityG1::ConnectOtherAbility->ConnectAbility"); bool ret = ConnectAbility(want, connCallback_[i]); sleep(1); if (!ret) { - APP_LOGE("AmsStServiceAbilityG1::ConnectAbility failed!"); + HILOG_ERROR("AmsStServiceAbilityG1::ConnectAbility failed!"); } } } - APP_LOGI("AmsStServiceAbilityG1::ConnectOtherAbility end"); + HILOG_INFO("AmsStServiceAbilityG1::ConnectOtherAbility end"); } void AmsStServiceAbilityG1::OnStart(const Want &want) { - APP_LOGI("AmsStServiceAbilityG1::OnStart"); + HILOG_INFO("AmsStServiceAbilityG1::OnStart"); GetWantInfo(want); Ability::OnStart(want); @@ -126,7 +126,7 @@ void AmsStServiceAbilityG1::OnStart(const Want &want) } void AmsStServiceAbilityG1::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("AmsStServiceAbilityG1::OnCommand"); + HILOG_INFO("AmsStServiceAbilityG1::OnCommand"); GetWantInfo(want); Ability::OnCommand(want, restart, startId); @@ -134,24 +134,24 @@ void AmsStServiceAbilityG1::OnCommand(const AAFwk::Want &want, bool restart, int } void AmsStServiceAbilityG1::OnNewWant(const Want &want) { - APP_LOGI("AmsStServiceAbilityG1::OnNewWant"); + HILOG_INFO("AmsStServiceAbilityG1::OnNewWant"); GetWantInfo(want); Ability::OnNewWant(want); } void AmsStServiceAbilityG1::DisConnectOtherAbility() { - APP_LOGI("AmsStServiceAbilityG1::DisConnectOtherAbility begin"); + HILOG_INFO("AmsStServiceAbilityG1::DisConnectOtherAbility begin"); for (auto &callback : connCallback_) { DisconnectAbility(callback); sleep(1); } - APP_LOGI("AmsStServiceAbilityG1::DisConnectOtherAbility end"); + HILOG_INFO("AmsStServiceAbilityG1::DisConnectOtherAbility end"); } void AmsStServiceAbilityG1::OnStop() { - APP_LOGI("AmsStServiceAbilityG1::onStop"); + HILOG_INFO("AmsStServiceAbilityG1::onStop"); Ability::OnStop(); PublishEvent(APP_G1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); @@ -160,7 +160,7 @@ void AmsStServiceAbilityG1::GetDataByDataAbility() { std::shared_ptr helper = DataAbilityHelper::Creator(std::shared_ptr(this)); if (helper == nullptr) { - APP_LOGE("AmsStServiceAbilityG1::GetDataByDataAbility:helper == nullptr"); + HILOG_ERROR("AmsStServiceAbilityG1::GetDataByDataAbility:helper == nullptr"); return; } @@ -170,37 +170,37 @@ void AmsStServiceAbilityG1::GetDataByDataAbility() int count = result.size(); if (count > 0) { - APP_LOGI("AmsStServiceAbilityG1::OnBackground get data ability data info result > 0!"); + HILOG_INFO("AmsStServiceAbilityG1::OnBackground get data ability data info result > 0!"); PublishEvent(APP_G1_RESP_EVENT_NAME, 1, "GetDataByDataAbility"); } else { - APP_LOGI("AmsStServiceAbilityG1::OnBackground get data ability data info result = 0!"); + HILOG_INFO("AmsStServiceAbilityG1::OnBackground get data ability data info result = 0!"); PublishEvent(APP_G1_RESP_EVENT_NAME, 0, "GetDataByDataAbility"); } } void AmsStServiceAbilityG1::OnActive() { - APP_LOGI("AmsStServiceAbilityG1::OnActive"); + HILOG_INFO("AmsStServiceAbilityG1::OnActive"); Ability::OnActive(); PublishEvent(APP_G1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); } void AmsStServiceAbilityG1::OnInactive() { - APP_LOGI("AmsStServiceAbilityG1::OnInactive"); + HILOG_INFO("AmsStServiceAbilityG1::OnInactive"); Ability::OnInactive(); PublishEvent(APP_G1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); } void AmsStServiceAbilityG1::OnBackground() { - APP_LOGI("AmsStServiceAbilityG1::OnBackground"); + HILOG_INFO("AmsStServiceAbilityG1::OnBackground"); Ability::OnBackground(); PublishEvent(APP_G1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); } sptr AmsStServiceAbilityG1::OnConnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityG1::OnConnect"); + HILOG_INFO("AmsStServiceAbilityG1::OnConnect"); Ability::OnConnect(want); PublishEvent(APP_G1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnConnect"); @@ -208,7 +208,7 @@ sptr AmsStServiceAbilityG1::OnConnect(const Want &want) } void AmsStServiceAbilityG1::OnDisconnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityG1::OnDisconnect"); + HILOG_INFO("AmsStServiceAbilityG1::OnDisconnect"); Ability::OnDisconnect(want); PublishEvent(APP_G1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnDisconnect"); @@ -242,7 +242,7 @@ void AmsStServiceAbilityG1::GetWantInfo(const Want &want) } bool AmsStServiceAbilityG1::PublishEvent(const std::string &eventName, const int &code, const std::string &data) { - APP_LOGI("AmsStServiceAbilityG1::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("AmsStServiceAbilityG1::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), code, data.c_str()); @@ -269,13 +269,13 @@ void AmsStServiceAbilityG1::AppEventSubscriber::OnReceiveEvent(const CommonEvent { auto eventName = data.GetWant().GetAction(); auto dataContent = data.GetData(); - APP_LOGI("AmsStServiceAbilityG1::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("AmsStServiceAbilityG1::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), dataContent.c_str()); if (APP_G1_REQ_EVENT_NAME.compare(eventName) == 0) { if (funcMap_.find(dataContent) == funcMap_.end()) { - APP_LOGI( + HILOG_INFO( "AmsStServiceAbilityG1::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceH/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceH/BUILD.gn index 4828337bf8..8fbf81d012 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceH/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceH/BUILD.gn @@ -25,12 +25,13 @@ config("amsSystemTestCConfig") { "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${appexecfwk_path}/services/bundlemgr/include", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"amsSystemTestServiceH\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"amsSystemTestServiceH\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("amsSystemTestServiceH") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceH/src/ams_st_service_ability_h1.cpp b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceH/src/ams_st_service_ability_h1.cpp index 85e4e90e41..80d609c5e0 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceH/src/ams_st_service_ability_h1.cpp +++ b/test/resource/amssystemtestability/abilitySrc/amsSystemTestServiceH/src/ams_st_service_ability_h1.cpp @@ -14,7 +14,7 @@ */ #include "ams_st_service_ability_h1.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ability_context.h" #include "ability.h" @@ -36,7 +36,7 @@ AmsStServiceAbilityH1::~AmsStServiceAbilityH1() std::vector AmsStServiceAbilityH1::Split(std::string str, const std::string &token) { - APP_LOGI("AmsStServiceAbilityH1::Split"); + HILOG_INFO("AmsStServiceAbilityH1::Split"); std::vector splitString; while (str.size()) { @@ -56,10 +56,10 @@ std::vector AmsStServiceAbilityH1::Split(std::string str, const std } void AmsStServiceAbilityH1::StartOtherAbility() { - APP_LOGI("AmsStServiceAbilityH1::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", + HILOG_INFO("AmsStServiceAbilityH1::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", targetBundle_.c_str(), targetAbility_.c_str()); - APP_LOGI("AmsStServiceAbilityH1::StartOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("AmsStServiceAbilityH1::StartOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -82,11 +82,11 @@ void AmsStServiceAbilityH1::StartOtherAbility() } void AmsStServiceAbilityH1::ConnectOtherAbility() { - APP_LOGI( + HILOG_INFO( "AmsStServiceAbilityH1::ConnectOtherAbility begin targetBundleConn=%{public}s, targetAbilityConn=%{public}s", targetBundleConn_.c_str(), targetAbilityConn_.c_str()); - APP_LOGI("AmsStServiceAbilityH1::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("AmsStServiceAbilityH1::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -105,19 +105,19 @@ void AmsStServiceAbilityH1::ConnectOtherAbility() want.SetParam("nextTargetAbilityConn", nextTargetAbilityConn_); stub_.push_back(new (std::nothrow) AbilityConnectCallback()); connCallback_.push_back(new (std::nothrow) AbilityConnectionProxy(stub_[i])); - APP_LOGI("AmsStServiceAbilityH1::ConnectOtherAbility->ConnectAbility"); + HILOG_INFO("AmsStServiceAbilityH1::ConnectOtherAbility->ConnectAbility"); bool ret = ConnectAbility(want, connCallback_[i]); sleep(1); if (!ret) { - APP_LOGE("AmsStServiceAbilityH1::ConnectAbility failed!"); + HILOG_ERROR("AmsStServiceAbilityH1::ConnectAbility failed!"); } } } - APP_LOGI("AmsStServiceAbilityH1::ConnectOtherAbility end"); + HILOG_INFO("AmsStServiceAbilityH1::ConnectOtherAbility end"); } void AmsStServiceAbilityH1::OnStart(const Want &want) { - APP_LOGI("AmsStServiceAbilityH1::OnStart"); + HILOG_INFO("AmsStServiceAbilityH1::OnStart"); GetWantInfo(want); Ability::OnStart(want); @@ -126,7 +126,7 @@ void AmsStServiceAbilityH1::OnStart(const Want &want) } void AmsStServiceAbilityH1::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("AmsStServiceAbilityH1::OnCommand"); + HILOG_INFO("AmsStServiceAbilityH1::OnCommand"); GetWantInfo(want); Ability::OnCommand(want, restart, startId); @@ -134,24 +134,24 @@ void AmsStServiceAbilityH1::OnCommand(const AAFwk::Want &want, bool restart, int } void AmsStServiceAbilityH1::OnNewWant(const Want &want) { - APP_LOGI("AmsStServiceAbilityH1::OnNewWant"); + HILOG_INFO("AmsStServiceAbilityH1::OnNewWant"); GetWantInfo(want); Ability::OnNewWant(want); } void AmsStServiceAbilityH1::DisConnectOtherAbility() { - APP_LOGI("AmsStServiceAbilityH1::DisConnectOtherAbility begin"); + HILOG_INFO("AmsStServiceAbilityH1::DisConnectOtherAbility begin"); for (auto &callback : connCallback_) { DisconnectAbility(callback); sleep(1); } - APP_LOGI("AmsStServiceAbilityH1::DisConnectOtherAbility end"); + HILOG_INFO("AmsStServiceAbilityH1::DisConnectOtherAbility end"); } void AmsStServiceAbilityH1::OnStop() { - APP_LOGI("AmsStServiceAbilityH1::onStop"); + HILOG_INFO("AmsStServiceAbilityH1::onStop"); Ability::OnStop(); PublishEvent(APP_H1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); @@ -160,7 +160,7 @@ void AmsStServiceAbilityH1::GetDataByDataAbility() { std::shared_ptr helper = DataAbilityHelper::Creator(std::shared_ptr(this)); if (helper == nullptr) { - APP_LOGE("AmsStServiceAbilityH1::GetDataByDataAbility:helper == nullptr"); + HILOG_ERROR("AmsStServiceAbilityH1::GetDataByDataAbility:helper == nullptr"); return; } @@ -170,37 +170,37 @@ void AmsStServiceAbilityH1::GetDataByDataAbility() int count = result.size(); if (count > 0) { - APP_LOGI("AmsStServiceAbilityH1::OnBackground get data ability data info result > 0!"); + HILOG_INFO("AmsStServiceAbilityH1::OnBackground get data ability data info result > 0!"); PublishEvent(APP_H1_RESP_EVENT_NAME, 1, "GetDataByDataAbility"); } else { - APP_LOGI("AmsStServiceAbilityH1::OnBackground get data ability data info result = 0!"); + HILOG_INFO("AmsStServiceAbilityH1::OnBackground get data ability data info result = 0!"); PublishEvent(APP_H1_RESP_EVENT_NAME, 0, "GetDataByDataAbility"); } } void AmsStServiceAbilityH1::OnActive() { - APP_LOGI("AmsStServiceAbilityH1::OnActive"); + HILOG_INFO("AmsStServiceAbilityH1::OnActive"); Ability::OnActive(); PublishEvent(APP_H1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); } void AmsStServiceAbilityH1::OnInactive() { - APP_LOGI("AmsStServiceAbilityH1::OnInactive"); + HILOG_INFO("AmsStServiceAbilityH1::OnInactive"); Ability::OnInactive(); PublishEvent(APP_H1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); } void AmsStServiceAbilityH1::OnBackground() { - APP_LOGI("AmsStServiceAbilityH1::OnBackground"); + HILOG_INFO("AmsStServiceAbilityH1::OnBackground"); Ability::OnBackground(); PublishEvent(APP_H1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); } sptr AmsStServiceAbilityH1::OnConnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityH1::OnConnect"); + HILOG_INFO("AmsStServiceAbilityH1::OnConnect"); Ability::OnConnect(want); PublishEvent(APP_H1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnConnect"); @@ -208,7 +208,7 @@ sptr AmsStServiceAbilityH1::OnConnect(const Want &want) } void AmsStServiceAbilityH1::OnDisconnect(const Want &want) { - APP_LOGI("AmsStServiceAbilityH1::OnDisconnect"); + HILOG_INFO("AmsStServiceAbilityH1::OnDisconnect"); Ability::OnDisconnect(want); PublishEvent(APP_H1_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnDisconnect"); @@ -242,7 +242,7 @@ void AmsStServiceAbilityH1::GetWantInfo(const Want &want) } bool AmsStServiceAbilityH1::PublishEvent(const std::string &eventName, const int &code, const std::string &data) { - APP_LOGI("AmsStServiceAbilityH1::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("AmsStServiceAbilityH1::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), code, data.c_str()); @@ -269,13 +269,13 @@ void AmsStServiceAbilityH1::AppEventSubscriber::OnReceiveEvent(const CommonEvent { auto eventName = data.GetWant().GetAction(); auto dataContent = data.GetData(); - APP_LOGI("AmsStServiceAbilityH1::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("AmsStServiceAbilityH1::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), dataContent.c_str()); if (APP_H1_REQ_EVENT_NAME.compare(eventName) == 0) { if (funcMap_.find(dataContent) == funcMap_.end()) { - APP_LOGI( + HILOG_INFO( "AmsStServiceAbilityH1::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), diff --git a/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/BUILD.gn index 76d32ba7e7..b3abe3e871 100644 --- a/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/BUILD.gn @@ -24,12 +24,13 @@ config("amsSystemTestAConfig") { "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include", "//foundation/appexecfwk/standard/services/bundlemgr/include", "//foundation/aafwk/standard/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "//foundation/appexecfwk/standard/common/log/include", "${TOOLS_DIR}/include", ] defines = [ - "APP_LOG_TAG = \"fwkAbilityState\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"fwkAbilityState\"", + "AMS_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { diff --git a/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/include/ability_state_main.h b/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/include/ability_state_main.h index c354eda18e..8cc41353f4 100755 --- a/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/include/ability_state_main.h +++ b/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/include/ability_state_main.h @@ -18,7 +18,7 @@ #include #include "ability.h" #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" #include "pac_map.h" diff --git a/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/include/ability_state_second.h b/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/include/ability_state_second.h index 015757e668..f7656a3166 100755 --- a/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/include/ability_state_second.h +++ b/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/include/ability_state_second.h @@ -17,7 +17,7 @@ #define FWK_ABILITY_STATE_ABILITY_B_H #include #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" #include "pac_map.h" diff --git a/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/src/ability_state_main.cpp b/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/src/ability_state_main.cpp index 85831e3eec..2d4b45f2ab 100755 --- a/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/src/ability_state_main.cpp +++ b/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/src/ability_state_main.cpp @@ -39,7 +39,7 @@ FwkAbilityStateMain::~FwkAbilityStateMain() void FwkAbilityStateMain::OnStart(const Want &want) { - APP_LOGI("FwkAbilityStateMain::onStart"); + HILOG_INFO("FwkAbilityStateMain::onStart"); SubscribeEvent(); bIsBlockRestore = want.HasParameter("StartType1"); bIsBlockSave = false; @@ -49,21 +49,21 @@ void FwkAbilityStateMain::OnStart(const Want &want) void FwkAbilityStateMain::OnNewWant(const Want &want) { - APP_LOGI("FwkAbilityStateMain::OnNewWant"); + HILOG_INFO("FwkAbilityStateMain::OnNewWant"); Ability::OnNewWant(want); callback_seq += "OnNewWant"; } void FwkAbilityStateMain::OnForeground(const Want &want) { - APP_LOGI("FwkAbilityStateMain::OnForeground"); + HILOG_INFO("FwkAbilityStateMain::OnForeground"); Ability::OnForeground(want); callback_seq += "OnForeground"; } void FwkAbilityStateMain::OnStop() { - APP_LOGI("FwkAbilityStateMain::onStop"); + HILOG_INFO("FwkAbilityStateMain::onStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); callback_seq += "OnStop"; @@ -73,7 +73,7 @@ void FwkAbilityStateMain::OnStop() void FwkAbilityStateMain::OnActive() { - APP_LOGI("FwkAbilityStateMain::OnActive"); + HILOG_INFO("FwkAbilityStateMain::OnActive"); Ability::OnActive(); callback_seq += "OnActive"; TestUtils::PublishEvent(FwkAbilityState_Event_Resp_A, OnActiveCode, callback_seq); @@ -82,14 +82,14 @@ void FwkAbilityStateMain::OnActive() void FwkAbilityStateMain::OnInactive() { - APP_LOGI("FwkAbilityStateMain::OnInactive"); + HILOG_INFO("FwkAbilityStateMain::OnInactive"); Ability::OnInactive(); callback_seq += "OnInactive"; } void FwkAbilityStateMain::OnBackground() { - APP_LOGI("FwkAbilityStateMain::OnBackground"); + HILOG_INFO("FwkAbilityStateMain::OnBackground"); Ability::OnBackground(); callback_seq += "OnBackground"; TestUtils::PublishEvent(FwkAbilityState_Event_Resp_A, OnBackgroundCode, callback_seq); @@ -102,7 +102,7 @@ void FwkAbilityStateMain::OnBlockProcess(bool &bIsBlockFlag) if (bIsBlockFlag) { while (i-- > 0) { - APP_LOGI("FwkAbilityStateMain::OnBlockProcess time left %{public}d", i); + HILOG_INFO("FwkAbilityStateMain::OnBlockProcess time left %{public}d", i); sleep(1); } bIsBlockFlag = false; @@ -111,7 +111,7 @@ void FwkAbilityStateMain::OnBlockProcess(bool &bIsBlockFlag) void FwkAbilityStateMain::OnSaveAbilityState(PacMap &outState) { - APP_LOGI("FwkAbilityStateMain::OnSaveAbilityState"); + HILOG_INFO("FwkAbilityStateMain::OnSaveAbilityState"); OnBlockProcess(bIsBlockSave); outState.PutIntValue(FwkAbilityState_SaveData_Int, iSaveData); Ability::OnSaveAbilityState(outState); @@ -123,16 +123,16 @@ void FwkAbilityStateMain::OnRestoreAbilityState(const PacMap &inState) int iGetSaveData; PacMap tmpPacMap; - APP_LOGI("FwkAbilityStateMain::OnRestoreAbilityState"); + HILOG_INFO("FwkAbilityStateMain::OnRestoreAbilityState"); OnBlockProcess(bIsBlockRestore); Ability::OnRestoreAbilityState(inState); tmpPacMap = (PacMap)inState; iGetSaveData = tmpPacMap.GetIntValue(FwkAbilityState_SaveData_Int); if (iSaveData != iGetSaveData) { TestUtils::PublishEvent(FwkAbilityState_Event_Resp_A, OnRestoreCheckCode, "NotEqual"); - APP_LOGI("FwkAbilityStateMain::restore not equal %{public}d", iGetSaveData); + HILOG_INFO("FwkAbilityStateMain::restore not equal %{public}d", iGetSaveData); } else { - APP_LOGI("FwkAbilityStateMain::restore equal %{public}d", iGetSaveData); + HILOG_INFO("FwkAbilityStateMain::restore equal %{public}d", iGetSaveData); } callback_seq += "OnRestoreAbilityState"; } @@ -161,14 +161,14 @@ void FwkAbilityStateMainSubscriber::OnReceiveEvent(const CommonEventData &data) if (mapAction_.find(target) != mapAction_.end()) { mapAction_[target](target, data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } void FwkAbilityStateMain::Action(std::string action, int code) { - APP_LOGI("FwkAbilityStateMain::Action Called"); + HILOG_INFO("FwkAbilityStateMain::Action Called"); if (mapAction_.find(action) != mapAction_.end()) { mapAction_[action](code); } @@ -176,10 +176,10 @@ void FwkAbilityStateMain::Action(std::string action, int code) void FwkAbilityStateMain::DoCrash(std::string action, int code) { - APP_LOGI("FwkAbilityStateMain::DoCrash Called"); + HILOG_INFO("FwkAbilityStateMain::DoCrash Called"); CrashMaker *pcCrashMaker = nullptr; int a = pcCrashMaker->CrashTry(); - APP_LOGI("FwkAbilityStateMain::DoCrash Process %{public}d", a); + HILOG_INFO("FwkAbilityStateMain::DoCrash Process %{public}d", a); } void FwkAbilityStateMain::StartNextAbility(int code) diff --git a/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/src/ability_state_second.cpp b/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/src/ability_state_second.cpp index 67d56766fb..d41914e668 100755 --- a/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/src/ability_state_second.cpp +++ b/test/resource/amssystemtestability/abilitySrc/fwkAbilityState/src/ability_state_second.cpp @@ -32,32 +32,32 @@ FwkAbilityStateSecond::~FwkAbilityStateSecond() void FwkAbilityStateSecond::OnStart(const Want &want) { SubscribeEvent(); - APP_LOGI("FwkAbilityStateSecond::onStart"); + HILOG_INFO("FwkAbilityStateSecond::onStart"); Ability::OnStart(want); callback_seq += "OnStart"; } void FwkAbilityStateSecond::OnForeground(const Want &want) { - APP_LOGI("FwkAbilityStateSecond::OnForeground"); + HILOG_INFO("FwkAbilityStateSecond::OnForeground"); Ability::OnForeground(want); } void FwkAbilityStateSecond::OnNewWant(const Want &want) { - APP_LOGI("FwkAbilityStateSecond::OnNewWant"); + HILOG_INFO("FwkAbilityStateSecond::OnNewWant"); Ability::OnNewWant(want); } void FwkAbilityStateSecond::OnStop() { - APP_LOGI("FwkAbilityStateSecond::onStop"); + HILOG_INFO("FwkAbilityStateSecond::onStop"); Ability::OnStop(); } void FwkAbilityStateSecond::OnActive() { - APP_LOGI("FwkAbilityStateSecond::OnActive"); + HILOG_INFO("FwkAbilityStateSecond::OnActive"); Ability::OnActive(); callback_seq += "OnActive"; TestUtils::PublishEvent(FwkAbilityState_Event_Resp_B, OnActiveCode, callback_seq); @@ -66,25 +66,25 @@ void FwkAbilityStateSecond::OnActive() void FwkAbilityStateSecond::OnInactive() { - APP_LOGI("FwkAbilityStateSecond::OnInactive"); + HILOG_INFO("FwkAbilityStateSecond::OnInactive"); Ability::OnInactive(); } void FwkAbilityStateSecond::OnBackground() { - APP_LOGI("FwkAbilityStateSecond::OnBackground"); + HILOG_INFO("FwkAbilityStateSecond::OnBackground"); Ability::OnBackground(); } void FwkAbilityStateSecond::OnSaveAbilityState(PacMap &outState) { - APP_LOGI("FwkAbilityStateSecond::OnSaveAbilityState"); + HILOG_INFO("FwkAbilityStateSecond::OnSaveAbilityState"); Ability::OnSaveAbilityState(outState); } void FwkAbilityStateSecond::OnRestoreAbilityState(const PacMap &inState) { - APP_LOGI("FwkAbilityStateSecond::OnRestoreAbilityState"); + HILOG_INFO("FwkAbilityStateSecond::OnRestoreAbilityState"); Ability::OnRestoreAbilityState(inState); } @@ -113,7 +113,7 @@ void FwkAbilityStateSecondSubscriber::OnReceiveEvent(const CommonEventData &data if (mapAction_.find(target) != mapAction_.end()) { mapAction_[target](target, data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } diff --git a/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/BUILD.gn index 010aeffdfb..45fc7d3ac2 100644 --- a/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/BUILD.gn @@ -19,8 +19,8 @@ config("service_ability_a_config") { visibility = [ ":*" ] include_dirs = [ "${SUBDEMOSYSTEM_DIR}/include" ] defines = [ - "APP_LOG_TAG = \"serviceAbilityA\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"serviceAbilityA\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("serviceAbilityA") { diff --git a/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/include/service_ability_a.h b/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/include/service_ability_a.h index bc495fab41..a357da7891 100644 --- a/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/include/service_ability_a.h +++ b/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/include/service_ability_a.h @@ -14,7 +14,7 @@ */ #ifndef MAIN_SERVICE_ABILITY_H #define MAIN_SERVICE_ABILITY_H -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "iremote_broker.h" #include "iremote_object.h" #include "iremote_proxy.h" diff --git a/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/include/verify_act_first_ability.h b/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/include/verify_act_first_ability.h index 4f4926ec6e..8aec600d37 100644 --- a/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/include/verify_act_first_ability.h +++ b/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/include/verify_act_first_ability.h @@ -17,7 +17,7 @@ #define VERIFY_ACT_FIRST_ABILITY #include "ability_loader.h" #include "common_event.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event_manager.h" #include "ability_connect_callback_stub.h" diff --git a/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/src/service_ability_a.cpp b/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/src/service_ability_a.cpp index e03b4a9416..123e907fad 100644 --- a/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/src/service_ability_a.cpp +++ b/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/src/service_ability_a.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "service_ability_a.h" -// #include "app_log_wrapper.h" +// #include "hilog_wrapper.h" // #include "iremote_broker.h" // #include "iremote_object.h" // #include "iremote_proxy.h" @@ -25,17 +25,17 @@ namespace OHOS { namespace AppExecFwk { void ServiceAbilityA::OnStart(const Want &want) { - APP_LOGI("ServiceAbilityA OnStart"); + HILOG_INFO("ServiceAbilityA OnStart"); Ability::OnStart(want); } void ServiceAbilityA::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("ServiceAbilityA::OnCommand"); + HILOG_INFO("ServiceAbilityA::OnCommand"); Ability::OnCommand(want, restart, startId); } sptr ServiceAbilityA::OnConnect(const Want &want) { - APP_LOGI("ServiceAbilityA::OnConnect"); + HILOG_INFO("ServiceAbilityA::OnConnect"); sptr remoteObject = sptr(new (std::nothrow) TestAbilityConnection()); Ability::OnConnect(want); @@ -43,12 +43,12 @@ sptr ServiceAbilityA::OnConnect(const Want &want) } void ServiceAbilityA::OnDisconnect(const Want &want) { - APP_LOGI("ServiceAbilityA::OnDisconnect"); + HILOG_INFO("ServiceAbilityA::OnDisconnect"); Ability::OnDisconnect(want); } void ServiceAbilityA::OnStop() { - APP_LOGI("ServiceAbilityA::OnStop"); + HILOG_INFO("ServiceAbilityA::OnStop"); Ability::OnStop(); } REGISTER_AA(ServiceAbilityA); diff --git a/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/src/verify_act_first_ability.cpp b/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/src/verify_act_first_ability.cpp index 555ad8d112..f47ad90b8a 100644 --- a/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/src/verify_act_first_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/serviceAbilityA/src/verify_act_first_ability.cpp @@ -14,69 +14,69 @@ */ #include "verify_act_first_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" namespace OHOS { namespace AppExecFwk { void AbilityConnectionActFirst::OnAbilityConnectDone( const AppExecFwk::ElementName &element, const sptr &remoteObject, int resultCode) { - APP_LOGI("AbilityConnectionActFirst OnAbilityConnectDone resultCode: %{public}d", resultCode); - APP_LOGI("AbilityConnectionActFirst OnAbilityConnectDone %{public}s", element.GetAbilityName().c_str()); - APP_LOGI("AbilityConnectionActFirst OnAbilityConnectDone %{public}p", remoteObject.GetRefPtr()); + HILOG_INFO("AbilityConnectionActFirst OnAbilityConnectDone resultCode: %{public}d", resultCode); + HILOG_INFO("AbilityConnectionActFirst OnAbilityConnectDone %{public}s", element.GetAbilityName().c_str()); + HILOG_INFO("AbilityConnectionActFirst OnAbilityConnectDone %{public}p", remoteObject.GetRefPtr()); } void AbilityConnectionActFirst::OnAbilityDisconnectDone(const AppExecFwk::ElementName &element, int resultCode) { - APP_LOGI("AbilityConnectionActFirst OnAbilityDisconnectDone resultCode: %{public}d", resultCode); - APP_LOGI("AbilityConnectionActFirst OnAbilityDisconnectDone : %{public}s", element.GetAbilityName().c_str()); + HILOG_INFO("AbilityConnectionActFirst OnAbilityDisconnectDone resultCode: %{public}d", resultCode); + HILOG_INFO("AbilityConnectionActFirst OnAbilityDisconnectDone : %{public}s", element.GetAbilityName().c_str()); } void VerifyIOAbilityLifecycleCallbacks::OnAbilityStart(const std::shared_ptr &ability) { - APP_LOGI("----------VerifyIOAbilityLifecycleCallbacks::OnAbilityStart called. AbilityName is %{public}s----------", + HILOG_INFO("----------VerifyIOAbilityLifecycleCallbacks::OnAbilityStart called. AbilityName is %{public}s", ability->GetAbilityName().c_str()); } void VerifyIOAbilityLifecycleCallbacks::OnAbilityInactive(const std::shared_ptr &ability) { - APP_LOGI( + HILOG_INFO( "----------VerifyIOAbilityLifecycleCallbacks::OnAbilityInactive called. AbilityName is %{public}s----------", ability->GetAbilityName().c_str()); } void VerifyIOAbilityLifecycleCallbacks::OnAbilityBackground(const std::shared_ptr &ability) { - APP_LOGI( + HILOG_INFO( "----------VerifyIOAbilityLifecycleCallbacks::OnAbilityBackground called. AbilityName is %{public}s----------", ability->GetAbilityName().c_str()); } void VerifyIOAbilityLifecycleCallbacks::OnAbilityForeground(const std::shared_ptr &ability) { - APP_LOGI( + HILOG_INFO( "----------VerifyIOAbilityLifecycleCallbacks::OnAbilityForeground called. AbilityName is %{public}s----------", ability->GetAbilityName().c_str()); } void VerifyIOAbilityLifecycleCallbacks::OnAbilityActive(const std::shared_ptr &ability) { - APP_LOGI("----------VerifyIOAbilityLifecycleCallbacks::OnAbilityActive called. AbilityName is %{public}s----------", + HILOG_INFO("----------VerifyIOAbilityLifecycleCallbacks::OnAbilityActive called. AbilityName is %{public}s", ability->GetAbilityName().c_str()); } void VerifyIOAbilityLifecycleCallbacks::OnAbilityStop(const std::shared_ptr &ability) { - APP_LOGI("----------VerifyIOAbilityLifecycleCallbacks::OnAbilityStop called. AbilityName is %{public}s----------", + HILOG_INFO("----------VerifyIOAbilityLifecycleCallbacks::OnAbilityStop called. AbilityName is %{public}s----------", ability->GetAbilityName().c_str()); } void VerifyIOAbilityLifecycleCallbacks::OnAbilitySaveState(const PacMap &outState) { - APP_LOGI("----------VerifyIOAbilityLifecycleCallbacks::OnAbilitySaveState called.----------"); + HILOG_INFO("----------VerifyIOAbilityLifecycleCallbacks::OnAbilitySaveState called.----------"); } void VerifyActFirstAbility::OnStart(const Want &want) { - APP_LOGI("----------VerifyActFirstAbility::onStart begin----------"); + HILOG_INFO("----------VerifyActFirstAbility::onStart begin----------"); std::shared_ptr callback = std::make_shared(); Ability::GetApplication()->RegisterAbilityLifecycleCallbacks(callback); @@ -94,39 +94,39 @@ void VerifyActFirstAbility::OnStart(const Want &want) std::shared_ptr serviceSubscriber = std::make_shared(subscriberInfoService, Ability::GetContext(), conne); EventFwk::CommonEventManager::SubscribeCommonEvent(serviceSubscriber); - APP_LOGI("----------VerifyActFirstAbility::onStart end----------"); + HILOG_INFO("----------VerifyActFirstAbility::onStart end----------"); Ability::OnStart(want); } void VerifyActFirstAbility::OnStop() { - APP_LOGI("----------VerifyActFirstAbility::onStop begin----------"); - APP_LOGI("----------VerifyActFirstAbility::onStop end----------"); + HILOG_INFO("----------VerifyActFirstAbility::onStop begin----------"); + HILOG_INFO("----------VerifyActFirstAbility::onStop end----------"); Ability::OnStop(); } void VerifyActFirstAbility::OnActive() { - APP_LOGI("----------VerifyActFirstAbility::OnActive begin----------"); - APP_LOGI("----------VerifyActFirstAbility::OnActive end----------"); + HILOG_INFO("----------VerifyActFirstAbility::OnActive begin----------"); + HILOG_INFO("----------VerifyActFirstAbility::OnActive end----------"); Ability::OnActive(); } void VerifyActFirstAbility::OnInactive() { - APP_LOGI("----------VerifyActFirstAbility::OnInactive begin----------"); - APP_LOGI("----------VerifyActFirstAbility::OnInactive end----------"); + HILOG_INFO("----------VerifyActFirstAbility::OnInactive begin----------"); + HILOG_INFO("----------VerifyActFirstAbility::OnInactive end----------"); Ability::OnInactive(); } void VerifyActFirstAbility::OnBackground() { - APP_LOGI("----------VerifyActFirstAbility::OnBackground begin----------"); - APP_LOGI("----------VerifyActFirstAbility::OnBackground end----------"); + HILOG_INFO("----------VerifyActFirstAbility::OnBackground begin----------"); + HILOG_INFO("----------VerifyActFirstAbility::OnBackground end----------"); Ability::OnBackground(); } void AbilityContextStartAbilityTest::OnReceiveEvent(const EventFwk::CommonEventData &data) { - APP_LOGI("---------- VerifyActFirstAbility AbilityContextStartAbilityTest begin----------"); - APP_LOGI("---------- VerifyActFirstAbility AbilityContextStartAbilityTest start ability----------"); + HILOG_INFO("---------- VerifyActFirstAbility AbilityContextStartAbilityTest begin----------"); + HILOG_INFO("---------- VerifyActFirstAbility AbilityContextStartAbilityTest start ability----------"); auto abilityContext = std::make_shared(); int requestCode = -1; Want want; @@ -134,14 +134,14 @@ void AbilityContextStartAbilityTest::OnReceiveEvent(const EventFwk::CommonEventD std::string targetAbility = "MainServiceAbilityDemo"; want.SetElementName(targetBundle, targetAbility); abilityContext->StartAbility(want, requestCode); - APP_LOGI("---------- VerifyActFirstAbility AbilityContextStartAbilityTest start ability end----------"); - APP_LOGI("---------- VerifyActFirstAbility AbilityContextStartAbilityTest end----------"); + HILOG_INFO("---------- VerifyActFirstAbility AbilityContextStartAbilityTest start ability end----------"); + HILOG_INFO("---------- VerifyActFirstAbility AbilityContextStartAbilityTest end----------"); } void ConnectServiceAbilityTest::OnReceiveEvent(const EventFwk::CommonEventData &data) { if (abilityContext_ == nullptr) { - APP_LOGI("----------ConnectServiceAbilityTest::OnReceiveEvent abilityContext_ == nullptr----------"); + HILOG_INFO("----------ConnectServiceAbilityTest::OnReceiveEvent abilityContext_ == nullptr----------"); return; } @@ -152,7 +152,7 @@ void ConnectServiceAbilityTest::OnReceiveEvent(const EventFwk::CommonEventData & switch (data.GetCode()) { case CONNECT_SERVICE_ABILITY: { auto ret = abilityContext_->ConnectAbility(want_service, conne_); - APP_LOGI("connect ability return %{public}d", ret); + HILOG_INFO("connect ability return %{public}d", ret); break; } case DISCONNECT_SERVICE_ABILITY: { @@ -165,11 +165,11 @@ void ConnectServiceAbilityTest::OnReceiveEvent(const EventFwk::CommonEventData & } case STOP_SERVICE_ABILITY: { auto ret = abilityContext_->StopAbility(want_service); - APP_LOGI("stop ability return %{public}d", ret); + HILOG_INFO("stop ability return %{public}d", ret); break; } default: - APP_LOGI("---------- ConnectServiceAbilityTest OnReceiveEvent default----------"); + HILOG_INFO("---------- ConnectServiceAbilityTest OnReceiveEvent default----------"); break; } } diff --git a/test/resource/amssystemtestability/abilitySrc/taskDispatcherTestA/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/taskDispatcherTestA/BUILD.gn index 1afbdb9fea..b910da0f53 100644 --- a/test/resource/amssystemtestability/abilitySrc/taskDispatcherTestA/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/taskDispatcherTestA/BUILD.gn @@ -32,8 +32,8 @@ config("taskDispatcherTestAConfig") { "//foundation/appexecfwk/standard/test/systemtest/common/task_dispatcher/include", ] defines = [ - "APP_LOG_TAG = \"taskDispatcherTestA\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"taskDispatcherTestA\"", + "AMS_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { diff --git a/test/resource/amssystemtestability/abilitySrc/taskDispatcherTestA/src/main_ability.cpp b/test/resource/amssystemtestability/abilitySrc/taskDispatcherTestA/src/main_ability.cpp index 8ce8b83fe2..8d31c788ce 100644 --- a/test/resource/amssystemtestability/abilitySrc/taskDispatcherTestA/src/main_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/taskDispatcherTestA/src/main_ability.cpp @@ -14,7 +14,7 @@ */ #include "main_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" #include #include @@ -91,7 +91,7 @@ bool IsAscend(const std::vector &vec) bool OuterTaskExecuted(TestSetting setting) { - APP_LOGI("-- -- -- -- -- --MainAbility::OuterTaskExecuted begin"); + HILOG_INFO("-- -- -- -- -- --MainAbility::OuterTaskExecuted begin"); std::string expectedTaskId; bool executed = true; for (int i = 0; i < testTaskCount; i++) { @@ -113,13 +113,13 @@ bool OuterTaskExecuted(TestSetting setting) expectedTaskId = delimiter + outerGroupNotifyId + delimiter; executed = executed && (task_execution_sequence.find(expectedTaskId) != string::npos); } - APP_LOGI("-- -- -- -- -- --MainAbility::OuterTaskExecuted end result:%{public}d", executed); + HILOG_INFO("-- -- -- -- -- --MainAbility::OuterTaskExecuted end result:%{public}d", executed); return executed; } bool InnerTaskExecuted(TestSetting setting) { - APP_LOGI("-- -- -- -- -- --MainAbility::InnerTaskExecuted begin"); + HILOG_INFO("-- -- -- -- -- --MainAbility::InnerTaskExecuted begin"); std::string expectedTaskId; bool executed = true; for (int i = 0; i < testTaskCount; i++) { @@ -149,7 +149,7 @@ bool InnerTaskExecuted(TestSetting setting) executed = executed && (task_execution_sequence.find(expectedTaskId) != string::npos); } } - APP_LOGI("-- -- -- -- -- --MainAbility::InnerTaskExecuted end result:%{public}d", executed); + HILOG_INFO("-- -- -- -- -- --MainAbility::InnerTaskExecuted end result:%{public}d", executed); return executed; } @@ -263,14 +263,14 @@ void GetTaskIndex(std::vector &outerTaskIndex, std::vector &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("MainAbility::Init"); + HILOG_INFO("MainAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } @@ -281,7 +281,7 @@ MainAbility::~MainAbility() void MainAbility::OnStart(const Want &want) { - APP_LOGI("MainAbility::onStart"); + HILOG_INFO("MainAbility::onStart"); SubscribeEvent(); Ability::OnStart(want); TestUtils::PublishEvent(g_EVENT_RESP_FIRST, Ability::GetState(), "onStart"); @@ -289,7 +289,7 @@ void MainAbility::OnStart(const Want &want) void MainAbility::OnStop() { - APP_LOGI("MainAbility::OnStop"); + HILOG_INFO("MainAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); TestUtils::PublishEvent(g_EVENT_RESP_FIRST, Ability::GetState(), "OnStop"); @@ -297,28 +297,28 @@ void MainAbility::OnStop() void MainAbility::OnActive() { - APP_LOGI("MainAbility::OnActive"); + HILOG_INFO("MainAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent(g_EVENT_RESP_FIRST, 0, "OnActive"); } void MainAbility::OnInactive() { - APP_LOGI("MainAbility::OnInactive"); + HILOG_INFO("MainAbility::OnInactive"); Ability::OnInactive(); TestUtils::PublishEvent(g_EVENT_RESP_FIRST, Ability::GetState(), "OnInactive"); } void MainAbility::OnBackground() { - APP_LOGI("MainAbility::OnBackground"); + HILOG_INFO("MainAbility::OnBackground"); Ability::OnBackground(); TestUtils::PublishEvent(g_EVENT_RESP_FIRST, Ability::GetState(), "OnBackground"); } void MainAbility::OnForeground(const Want &want) { - APP_LOGI("MainAbility::OnForeground"); + HILOG_INFO("MainAbility::OnForeground"); Ability::OnForeground(want); TestUtils::PublishEvent(g_EVENT_RESP_FIRST, Ability::GetState(), "OnForeground"); } @@ -345,14 +345,14 @@ void FirstEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (std::strcmp(eventName.c_str(), g_EVENT_REQU_FIRST.c_str()) == 0) { auto target = data.GetData(); auto caseInfo = TestUtils::split(target, "_"); - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:caseInfo.size()=%{public}zu", caseInfo.size()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:caseInfo.size()=%{public}zu", caseInfo.size()); if (caseInfo.size() < numThree) { return; } if (mapTestFunc_.find(caseInfo[numZero]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[numZero]](std::stoi(caseInfo[numOne]), std::stoi(caseInfo[numTwo]), data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } @@ -500,7 +500,7 @@ int MainAbility::Dispatch(TestSetting outerSetting, TestSetting innerSetting) // level1:global, sync level2:parallel, sync void MainAbility::GlobalCase1(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -530,7 +530,7 @@ void MainAbility::GlobalCase1(int code) // level1:global, sync level2:parallel, async void MainAbility::GlobalCase2(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -556,7 +556,7 @@ void MainAbility::GlobalCase2(int code) // level1:global, sync level2:parallel, delay void MainAbility::GlobalCase3(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -583,7 +583,7 @@ void MainAbility::GlobalCase3(int code) // level1:global, sync level2:parallel, group void MainAbility::GlobalCase4(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -610,7 +610,7 @@ void MainAbility::GlobalCase4(int code) // level1:global, sync level2:parallel, group wait void MainAbility::GlobalCase5(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -639,7 +639,7 @@ void MainAbility::GlobalCase5(int code) // level1:global, sync level2:parallel, group notify void MainAbility::GlobalCase6(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -668,7 +668,7 @@ void MainAbility::GlobalCase6(int code) // level1:global, sync level2:parallel, sync barrier void MainAbility::GlobalCase7(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -697,7 +697,7 @@ void MainAbility::GlobalCase7(int code) // level1:global, sync level2:parallel, async barrier void MainAbility::GlobalCase8(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -726,7 +726,7 @@ void MainAbility::GlobalCase8(int code) // level1:global, sync level2:parallel, apply void MainAbility::GlobalCase9(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -753,7 +753,7 @@ void MainAbility::GlobalCase9(int code) // level1:global, sync level2:serial, sync void MainAbility::GlobalCase10(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -782,7 +782,7 @@ void MainAbility::GlobalCase10(int code) // level1:global, sync level2:serial, async void MainAbility::GlobalCase11(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -811,7 +811,7 @@ void MainAbility::GlobalCase11(int code) // level1:global, sync level2:serial, delay void MainAbility::GlobalCase12(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -841,7 +841,7 @@ void MainAbility::GlobalCase12(int code) // level1:global, sync level2:serial, apply void MainAbility::GlobalCase13(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -868,7 +868,7 @@ void MainAbility::GlobalCase13(int code) // level1:global, async level2:parallel, sync void MainAbility::GlobalCase14(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -896,7 +896,7 @@ void MainAbility::GlobalCase14(int code) // level1:global, async level2:parallel, async void MainAbility::GlobalCase15(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -918,7 +918,7 @@ void MainAbility::GlobalCase15(int code) // level1:global, async level2:parallel, delay void MainAbility::GlobalCase16(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -941,7 +941,7 @@ void MainAbility::GlobalCase16(int code) // level1:global, async level2:parallel, group void MainAbility::GlobalCase17(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -964,7 +964,7 @@ void MainAbility::GlobalCase17(int code) // level1:global, async level2:parallel, group wait void MainAbility::GlobalCase18(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -989,7 +989,7 @@ void MainAbility::GlobalCase18(int code) // level1:global, async level2:parallel, group notify void MainAbility::GlobalCase19(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1014,7 +1014,7 @@ void MainAbility::GlobalCase19(int code) // level1:global, async level2:parallel, sync barrier void MainAbility::GlobalCase20(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1039,7 +1039,7 @@ void MainAbility::GlobalCase20(int code) // level1:global, async level2:parallel, async barrier void MainAbility::GlobalCase21(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1064,7 +1064,7 @@ void MainAbility::GlobalCase21(int code) // level1:global, async level2:parallel, apply void MainAbility::GlobalCase22(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1087,7 +1087,7 @@ void MainAbility::GlobalCase22(int code) // level1:global, async level2:serial, sync void MainAbility::GlobalCase23(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1115,7 +1115,7 @@ void MainAbility::GlobalCase23(int code) // level1:global, async level2:serial, async void MainAbility::GlobalCase24(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1143,7 +1143,7 @@ void MainAbility::GlobalCase24(int code) // level1:global, async level2:serial, delay void MainAbility::GlobalCase25(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1172,7 +1172,7 @@ void MainAbility::GlobalCase25(int code) // level1:global, async level2:serial, apply void MainAbility::GlobalCase26(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1195,7 +1195,7 @@ void MainAbility::GlobalCase26(int code) // level1:global, delay level2:parallel, sync void MainAbility::GlobalCase27(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1224,7 +1224,7 @@ void MainAbility::GlobalCase27(int code) // level1:global, delay level2:parallel, async void MainAbility::GlobalCase28(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1247,7 +1247,7 @@ void MainAbility::GlobalCase28(int code) // level1:global, delay level2:parallel, delay void MainAbility::GlobalCase29(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1271,7 +1271,7 @@ void MainAbility::GlobalCase29(int code) // level1:global, delay level2:parallel, group void MainAbility::GlobalCase30(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1295,7 +1295,7 @@ void MainAbility::GlobalCase30(int code) // level1:global, delay level2:parallel, group wait void MainAbility::GlobalCase31(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1321,7 +1321,7 @@ void MainAbility::GlobalCase31(int code) // level1:global, delay level2:parallel, group notify void MainAbility::GlobalCase32(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1347,7 +1347,7 @@ void MainAbility::GlobalCase32(int code) // level1:global, delay level2:parallel, sync barrier void MainAbility::GlobalCase33(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1373,7 +1373,7 @@ void MainAbility::GlobalCase33(int code) // level1:global, delay level2:parallel, async barrier void MainAbility::GlobalCase34(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1399,7 +1399,7 @@ void MainAbility::GlobalCase34(int code) // level1:global, delay level2:parallel, apply void MainAbility::GlobalCase35(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1423,7 +1423,7 @@ void MainAbility::GlobalCase35(int code) // level1:global, delay level2:serial, sync void MainAbility::GlobalCase36(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1452,7 +1452,7 @@ void MainAbility::GlobalCase36(int code) // level1:global, delay level2:serial, async void MainAbility::GlobalCase37(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1481,7 +1481,7 @@ void MainAbility::GlobalCase37(int code) // level1:global, delay level2:serial, delay void MainAbility::GlobalCase38(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1511,7 +1511,7 @@ void MainAbility::GlobalCase38(int code) // level1:global, delay level2:serial, apply void MainAbility::GlobalCase39(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1535,7 +1535,7 @@ void MainAbility::GlobalCase39(int code) // level1:global, group level2:parallel, sync void MainAbility::GlobalCase40(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1564,7 +1564,7 @@ void MainAbility::GlobalCase40(int code) // level1:global, group level2:parallel, async void MainAbility::GlobalCase41(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1587,7 +1587,7 @@ void MainAbility::GlobalCase41(int code) // level1:global, group level2:parallel, delay void MainAbility::GlobalCase42(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1611,7 +1611,7 @@ void MainAbility::GlobalCase42(int code) // level1:global, group level2:parallel, group void MainAbility::GlobalCase43(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1635,7 +1635,7 @@ void MainAbility::GlobalCase43(int code) // level1:global, group level2:parallel, group wait void MainAbility::GlobalCase44(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1661,7 +1661,7 @@ void MainAbility::GlobalCase44(int code) // level1:global, group level2:parallel, group notify void MainAbility::GlobalCase45(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1687,7 +1687,7 @@ void MainAbility::GlobalCase45(int code) // level1:global, group level2:parallel, sync barrier void MainAbility::GlobalCase46(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1713,7 +1713,7 @@ void MainAbility::GlobalCase46(int code) // level1:global, group level2:parallel, async barrier void MainAbility::GlobalCase47(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1739,7 +1739,7 @@ void MainAbility::GlobalCase47(int code) // level1:global, group level2:parallel, apply void MainAbility::GlobalCase48(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1763,7 +1763,7 @@ void MainAbility::GlobalCase48(int code) // level1:global, group level2:serial, sync void MainAbility::GlobalCase49(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1792,7 +1792,7 @@ void MainAbility::GlobalCase49(int code) // level1:global, group level2:serial, async void MainAbility::GlobalCase50(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1821,7 +1821,7 @@ void MainAbility::GlobalCase50(int code) // level1:global, group level2:serial, delay void MainAbility::GlobalCase51(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1851,7 +1851,7 @@ void MainAbility::GlobalCase51(int code) // level1:global, group level2:serial, apply void MainAbility::GlobalCase52(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1875,7 +1875,7 @@ void MainAbility::GlobalCase52(int code) // level1:global, group wait level2:parallel, sync void MainAbility::GlobalCase53(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1906,7 +1906,7 @@ void MainAbility::GlobalCase53(int code) // level1:global, group wait level2:parallel, async void MainAbility::GlobalCase54(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1931,7 +1931,7 @@ void MainAbility::GlobalCase54(int code) // level1:global, group wait level2:parallel, delay void MainAbility::GlobalCase55(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1957,7 +1957,7 @@ void MainAbility::GlobalCase55(int code) // level1:global, group wait level2:parallel, group void MainAbility::GlobalCase56(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -1983,7 +1983,7 @@ void MainAbility::GlobalCase56(int code) // level1:global, group wait level2:parallel, group wait void MainAbility::GlobalCase57(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2011,7 +2011,7 @@ void MainAbility::GlobalCase57(int code) // level1:global, group wait level2:parallel, group notify void MainAbility::GlobalCase58(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2039,7 +2039,7 @@ void MainAbility::GlobalCase58(int code) // level1:global, group wait level2:parallel, sync barrier void MainAbility::GlobalCase59(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2067,7 +2067,7 @@ void MainAbility::GlobalCase59(int code) // level1:global, group wait level2:parallel, async barrier void MainAbility::GlobalCase60(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2095,7 +2095,7 @@ void MainAbility::GlobalCase60(int code) // level1:global, group wait level2:parallel, apply void MainAbility::GlobalCase61(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2121,7 +2121,7 @@ void MainAbility::GlobalCase61(int code) // level1:global, group wait level2:serial, sync void MainAbility::GlobalCase62(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2152,7 +2152,7 @@ void MainAbility::GlobalCase62(int code) // level1:global, group wait level2:serial, async void MainAbility::GlobalCase63(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2183,7 +2183,7 @@ void MainAbility::GlobalCase63(int code) // level1:global, group wait level2:serial, delay void MainAbility::GlobalCase64(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2215,7 +2215,7 @@ void MainAbility::GlobalCase64(int code) // level1:global, group wait level2:serial, apply void MainAbility::GlobalCase65(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2241,7 +2241,7 @@ void MainAbility::GlobalCase65(int code) // level1:global, group notify level2:parallel, sync void MainAbility::GlobalCase66(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2272,7 +2272,7 @@ void MainAbility::GlobalCase66(int code) // level1:global, group notify level2:parallel, async void MainAbility::GlobalCase67(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2297,7 +2297,7 @@ void MainAbility::GlobalCase67(int code) // level1:global, group notify level2:parallel, delay void MainAbility::GlobalCase68(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2323,7 +2323,7 @@ void MainAbility::GlobalCase68(int code) // level1:global, group notify level2:parallel, group void MainAbility::GlobalCase69(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2349,7 +2349,7 @@ void MainAbility::GlobalCase69(int code) // level1:global, group notify level2:parallel, group wait void MainAbility::GlobalCase70(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2377,7 +2377,7 @@ void MainAbility::GlobalCase70(int code) // level1:global, group notify level2:parallel, group notify void MainAbility::GlobalCase71(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2405,7 +2405,7 @@ void MainAbility::GlobalCase71(int code) // level1:global, group notify level2:parallel, sync barrier void MainAbility::GlobalCase72(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2433,7 +2433,7 @@ void MainAbility::GlobalCase72(int code) // level1:global, group notify level2:parallel, async barrier void MainAbility::GlobalCase73(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2461,7 +2461,7 @@ void MainAbility::GlobalCase73(int code) // level1:global, group notify level2:parallel, apply void MainAbility::GlobalCase74(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2487,7 +2487,7 @@ void MainAbility::GlobalCase74(int code) // level1:global, group notify level2:serial, sync void MainAbility::GlobalCase75(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2518,7 +2518,7 @@ void MainAbility::GlobalCase75(int code) // level1:global, group notify level2:serial, async void MainAbility::GlobalCase76(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2549,7 +2549,7 @@ void MainAbility::GlobalCase76(int code) // level1:global, group notify level2:serial, delay void MainAbility::GlobalCase77(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2581,7 +2581,7 @@ void MainAbility::GlobalCase77(int code) // level1:global, group notify level2:serial, apply void MainAbility::GlobalCase78(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2607,7 +2607,7 @@ void MainAbility::GlobalCase78(int code) // level1:global, apply level2:parallel, sync void MainAbility::GlobalCase79(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2636,7 +2636,7 @@ void MainAbility::GlobalCase79(int code) // level1:global, apply level2:parallel, async void MainAbility::GlobalCase80(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2659,7 +2659,7 @@ void MainAbility::GlobalCase80(int code) // level1:global, apply level2:parallel, delay void MainAbility::GlobalCase81(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2683,7 +2683,7 @@ void MainAbility::GlobalCase81(int code) // level1:global, apply level2:parallel, group void MainAbility::GlobalCase82(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2707,7 +2707,7 @@ void MainAbility::GlobalCase82(int code) // level1:global, apply level2:parallel, group wait void MainAbility::GlobalCase83(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2733,7 +2733,7 @@ void MainAbility::GlobalCase83(int code) // level1:global, apply level2:parallel, group notify void MainAbility::GlobalCase84(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2759,7 +2759,7 @@ void MainAbility::GlobalCase84(int code) // level1:global, apply level2:parallel, sync barrier void MainAbility::GlobalCase85(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2785,7 +2785,7 @@ void MainAbility::GlobalCase85(int code) // level1:global, apply level2:parallel, async barrier void MainAbility::GlobalCase86(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2811,7 +2811,7 @@ void MainAbility::GlobalCase86(int code) // level1:global, apply level2:parallel, apply void MainAbility::GlobalCase87(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2835,7 +2835,7 @@ void MainAbility::GlobalCase87(int code) // level1:global, apply level2:serial, sync void MainAbility::GlobalCase88(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2864,7 +2864,7 @@ void MainAbility::GlobalCase88(int code) // level1:global, apply level2:serial, async void MainAbility::GlobalCase89(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2893,7 +2893,7 @@ void MainAbility::GlobalCase89(int code) // level1:global, apply level2:serial, delay void MainAbility::GlobalCase90(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2923,7 +2923,7 @@ void MainAbility::GlobalCase90(int code) // level1:global, apply level2:serial, apply void MainAbility::GlobalCase91(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2947,7 +2947,7 @@ void MainAbility::GlobalCase91(int code) // level1:parallel, sync level2:parallel, sync void MainAbility::ParallelCase1(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -2976,7 +2976,7 @@ void MainAbility::ParallelCase1(int code) // level1:parallel, sync level2:parallel, async void MainAbility::ParallelCase2(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3002,7 +3002,7 @@ void MainAbility::ParallelCase2(int code) // level1:parallel, sync level2:parallel, delay void MainAbility::ParallelCase3(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3029,7 +3029,7 @@ void MainAbility::ParallelCase3(int code) // level1:parallel, sync level2:parallel, group void MainAbility::ParallelCase4(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3056,7 +3056,7 @@ void MainAbility::ParallelCase4(int code) // level1:parallel, sync level2:parallel, group wait void MainAbility::ParallelCase5(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3085,7 +3085,7 @@ void MainAbility::ParallelCase5(int code) // level1:parallel, sync level2:parallel, group notify void MainAbility::ParallelCase6(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3114,7 +3114,7 @@ void MainAbility::ParallelCase6(int code) // level1:parallel, sync level2:parallel, sync barrier void MainAbility::ParallelCase7(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3143,7 +3143,7 @@ void MainAbility::ParallelCase7(int code) // level1:parallel, sync level2:parallel, async barrier void MainAbility::ParallelCase8(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3172,7 +3172,7 @@ void MainAbility::ParallelCase8(int code) // level1:parallel, sync level2:parallel, apply void MainAbility::ParallelCase9(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3199,7 +3199,7 @@ void MainAbility::ParallelCase9(int code) // level1:parallel, sync level2:serial, sync void MainAbility::ParallelCase10(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3228,7 +3228,7 @@ void MainAbility::ParallelCase10(int code) // level1:parallel, sync level2:serial, async void MainAbility::ParallelCase11(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3257,7 +3257,7 @@ void MainAbility::ParallelCase11(int code) // level1:parallel, sync level2:serial, delay void MainAbility::ParallelCase12(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3287,7 +3287,7 @@ void MainAbility::ParallelCase12(int code) // level1:parallel, sync level2:serial, apply void MainAbility::ParallelCase13(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3314,7 +3314,7 @@ void MainAbility::ParallelCase13(int code) // level1:parallel, async level2:parallel, sync void MainAbility::ParallelCase14(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3342,7 +3342,7 @@ void MainAbility::ParallelCase14(int code) // level1:parallel, async level2:parallel, async void MainAbility::ParallelCase15(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3364,7 +3364,7 @@ void MainAbility::ParallelCase15(int code) // level1:parallel, async level2:parallel, delay void MainAbility::ParallelCase16(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3387,7 +3387,7 @@ void MainAbility::ParallelCase16(int code) // level1:parallel, async level2:parallel, group void MainAbility::ParallelCase17(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3410,7 +3410,7 @@ void MainAbility::ParallelCase17(int code) // level1:parallel, async level2:parallel, group wait void MainAbility::ParallelCase18(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3435,7 +3435,7 @@ void MainAbility::ParallelCase18(int code) // level1:parallel, async level2:parallel, group notify void MainAbility::ParallelCase19(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3460,7 +3460,7 @@ void MainAbility::ParallelCase19(int code) // level1:parallel, async level2:parallel, sync barrier void MainAbility::ParallelCase20(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3485,7 +3485,7 @@ void MainAbility::ParallelCase20(int code) // level1:parallel, async level2:parallel, async barrier void MainAbility::ParallelCase21(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3510,7 +3510,7 @@ void MainAbility::ParallelCase21(int code) // level1:parallel, async level2:parallel, apply void MainAbility::ParallelCase22(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3533,7 +3533,7 @@ void MainAbility::ParallelCase22(int code) // level1:parallel, async level2:serial, sync void MainAbility::ParallelCase23(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3561,7 +3561,7 @@ void MainAbility::ParallelCase23(int code) // level1:parallel, async level2:serial, async void MainAbility::ParallelCase24(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3589,7 +3589,7 @@ void MainAbility::ParallelCase24(int code) // level1:parallel, async level2:serial, delay void MainAbility::ParallelCase25(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3618,7 +3618,7 @@ void MainAbility::ParallelCase25(int code) // level1:parallel, async level2:serial, apply void MainAbility::ParallelCase26(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3641,7 +3641,7 @@ void MainAbility::ParallelCase26(int code) // level1:parallel, delay level2:parallel, sync void MainAbility::ParallelCase27(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3670,7 +3670,7 @@ void MainAbility::ParallelCase27(int code) // level1:parallel, delay level2:parallel, async void MainAbility::ParallelCase28(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3693,7 +3693,7 @@ void MainAbility::ParallelCase28(int code) // level1:parallel, delay level2:parallel, delay void MainAbility::ParallelCase29(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3717,7 +3717,7 @@ void MainAbility::ParallelCase29(int code) // level1:parallel, delay level2:parallel, group void MainAbility::ParallelCase30(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3741,7 +3741,7 @@ void MainAbility::ParallelCase30(int code) // level1:parallel, delay level2:parallel, group wait void MainAbility::ParallelCase31(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3767,7 +3767,7 @@ void MainAbility::ParallelCase31(int code) // level1:parallel, delay level2:parallel, group notify void MainAbility::ParallelCase32(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3793,7 +3793,7 @@ void MainAbility::ParallelCase32(int code) // level1:parallel, delay level2:parallel, sync barrier void MainAbility::ParallelCase33(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3819,7 +3819,7 @@ void MainAbility::ParallelCase33(int code) // level1:parallel, delay level2:parallel, async barrier void MainAbility::ParallelCase34(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3845,7 +3845,7 @@ void MainAbility::ParallelCase34(int code) // level1:parallel, delay level2:parallel, apply void MainAbility::ParallelCase35(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3869,7 +3869,7 @@ void MainAbility::ParallelCase35(int code) // level1:parallel, delay level2:serial, sync void MainAbility::ParallelCase36(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3898,7 +3898,7 @@ void MainAbility::ParallelCase36(int code) // level1:parallel, delay level2:serial, async void MainAbility::ParallelCase37(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3927,7 +3927,7 @@ void MainAbility::ParallelCase37(int code) // level1:parallel, delay level2:serial, delay void MainAbility::ParallelCase38(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3957,7 +3957,7 @@ void MainAbility::ParallelCase38(int code) // level1:parallel, delay level2:serial, apply void MainAbility::ParallelCase39(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -3981,7 +3981,7 @@ void MainAbility::ParallelCase39(int code) // level1:parallel, group level2:parallel, sync void MainAbility::ParallelCase40(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4010,7 +4010,7 @@ void MainAbility::ParallelCase40(int code) // level1:parallel, group level2:parallel, async void MainAbility::ParallelCase41(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4033,7 +4033,7 @@ void MainAbility::ParallelCase41(int code) // level1:parallel, group level2:parallel, delay void MainAbility::ParallelCase42(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4057,7 +4057,7 @@ void MainAbility::ParallelCase42(int code) // level1:parallel, group level2:parallel, group void MainAbility::ParallelCase43(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4081,7 +4081,7 @@ void MainAbility::ParallelCase43(int code) // level1:parallel, group level2:parallel, group wait void MainAbility::ParallelCase44(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4107,7 +4107,7 @@ void MainAbility::ParallelCase44(int code) // level1:parallel, group level2:parallel, group notify void MainAbility::ParallelCase45(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4133,7 +4133,7 @@ void MainAbility::ParallelCase45(int code) // level1:parallel, group level2:parallel, sync barrier void MainAbility::ParallelCase46(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4159,7 +4159,7 @@ void MainAbility::ParallelCase46(int code) // level1:parallel, group level2:parallel, async barrier void MainAbility::ParallelCase47(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4185,7 +4185,7 @@ void MainAbility::ParallelCase47(int code) // level1:parallel, group level2:parallel, apply void MainAbility::ParallelCase48(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4209,7 +4209,7 @@ void MainAbility::ParallelCase48(int code) // level1:parallel, group level2:serial, sync void MainAbility::ParallelCase49(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4238,7 +4238,7 @@ void MainAbility::ParallelCase49(int code) // level1:parallel, group level2:serial, async void MainAbility::ParallelCase50(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4267,7 +4267,7 @@ void MainAbility::ParallelCase50(int code) // level1:parallel, group level2:serial, delay void MainAbility::ParallelCase51(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4297,7 +4297,7 @@ void MainAbility::ParallelCase51(int code) // level1:parallel, group level2:serial, apply void MainAbility::ParallelCase52(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4321,7 +4321,7 @@ void MainAbility::ParallelCase52(int code) // level1:parallel, group wait level2:parallel, sync void MainAbility::ParallelCase53(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4352,7 +4352,7 @@ void MainAbility::ParallelCase53(int code) // level1:parallel, group wait level2:parallel, async void MainAbility::ParallelCase54(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4377,7 +4377,7 @@ void MainAbility::ParallelCase54(int code) // level1:parallel, group wait level2:parallel, delay void MainAbility::ParallelCase55(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4403,7 +4403,7 @@ void MainAbility::ParallelCase55(int code) // level1:parallel, group wait level2:parallel, group void MainAbility::ParallelCase56(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4429,7 +4429,7 @@ void MainAbility::ParallelCase56(int code) // level1:parallel, group wait level2:parallel, group wait void MainAbility::ParallelCase57(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4457,7 +4457,7 @@ void MainAbility::ParallelCase57(int code) // level1:parallel, group wait level2:parallel, group notify void MainAbility::ParallelCase58(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4485,7 +4485,7 @@ void MainAbility::ParallelCase58(int code) // level1:parallel, group wait level2:parallel, sync barrier void MainAbility::ParallelCase59(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4513,7 +4513,7 @@ void MainAbility::ParallelCase59(int code) // level1:parallel, group wait level2:parallel, async barrier void MainAbility::ParallelCase60(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4541,7 +4541,7 @@ void MainAbility::ParallelCase60(int code) // level1:parallel, group wait level2:parallel, apply void MainAbility::ParallelCase61(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4567,7 +4567,7 @@ void MainAbility::ParallelCase61(int code) // level1:parallel, group wait level2:serial, sync void MainAbility::ParallelCase62(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4598,7 +4598,7 @@ void MainAbility::ParallelCase62(int code) // level1:parallel, group wait level2:serial, async void MainAbility::ParallelCase63(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4629,7 +4629,7 @@ void MainAbility::ParallelCase63(int code) // level1:parallel, group wait level2:serial, delay void MainAbility::ParallelCase64(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4661,7 +4661,7 @@ void MainAbility::ParallelCase64(int code) // level1:parallel, group wait level2:serial, apply void MainAbility::ParallelCase65(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4687,7 +4687,7 @@ void MainAbility::ParallelCase65(int code) // level1:parallel, group notify level2:parallel, sync void MainAbility::ParallelCase66(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4718,7 +4718,7 @@ void MainAbility::ParallelCase66(int code) // level1:parallel, group notify level2:parallel, async void MainAbility::ParallelCase67(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4743,7 +4743,7 @@ void MainAbility::ParallelCase67(int code) // level1:parallel, group notify level2:parallel, delay void MainAbility::ParallelCase68(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4769,7 +4769,7 @@ void MainAbility::ParallelCase68(int code) // level1:parallel, group notify level2:parallel, group void MainAbility::ParallelCase69(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4795,7 +4795,7 @@ void MainAbility::ParallelCase69(int code) // level1:parallel, group notify level2:parallel, group wait void MainAbility::ParallelCase70(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4823,7 +4823,7 @@ void MainAbility::ParallelCase70(int code) // level1:parallel, group notify level2:parallel, group notify void MainAbility::ParallelCase71(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4851,7 +4851,7 @@ void MainAbility::ParallelCase71(int code) // level1:parallel, group notify level2:parallel, sync barrier void MainAbility::ParallelCase72(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4879,7 +4879,7 @@ void MainAbility::ParallelCase72(int code) // level1:parallel, group notify level2:parallel, async barrier void MainAbility::ParallelCase73(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4907,7 +4907,7 @@ void MainAbility::ParallelCase73(int code) // level1:parallel, group notify level2:parallel, apply void MainAbility::ParallelCase74(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4933,7 +4933,7 @@ void MainAbility::ParallelCase74(int code) // level1:parallel, group notify level2:serial, sync void MainAbility::ParallelCase75(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4964,7 +4964,7 @@ void MainAbility::ParallelCase75(int code) // level1:parallel, group notify level2:serial, async void MainAbility::ParallelCase76(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -4995,7 +4995,7 @@ void MainAbility::ParallelCase76(int code) // level1:parallel, group notify level2:serial, delay void MainAbility::ParallelCase77(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5027,7 +5027,7 @@ void MainAbility::ParallelCase77(int code) // level1:parallel, group notify level2:serial, apply void MainAbility::ParallelCase78(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5053,7 +5053,7 @@ void MainAbility::ParallelCase78(int code) // level1:parallel, sync barrier level2:parallel, sync void MainAbility::ParallelCase79(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5084,7 +5084,7 @@ void MainAbility::ParallelCase79(int code) // level1:parallel, sync barrier level2:parallel, async void MainAbility::ParallelCase80(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5109,7 +5109,7 @@ void MainAbility::ParallelCase80(int code) // level1:parallel, sync barrier level2:parallel, delay void MainAbility::ParallelCase81(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5135,7 +5135,7 @@ void MainAbility::ParallelCase81(int code) // level1:parallel, sync barrier level2:parallel, group void MainAbility::ParallelCase82(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5161,7 +5161,7 @@ void MainAbility::ParallelCase82(int code) // level1:parallel, sync barrier level2:parallel, group wait void MainAbility::ParallelCase83(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5189,7 +5189,7 @@ void MainAbility::ParallelCase83(int code) // level1:parallel, sync barrier level2:parallel, group notify void MainAbility::ParallelCase84(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5217,7 +5217,7 @@ void MainAbility::ParallelCase84(int code) // level1:parallel, sync barrier level2:parallel, sync barrier void MainAbility::ParallelCase85(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5245,7 +5245,7 @@ void MainAbility::ParallelCase85(int code) // level1:parallel, sync barrier level2:parallel, async barrier void MainAbility::ParallelCase86(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5273,7 +5273,7 @@ void MainAbility::ParallelCase86(int code) // level1:parallel, sync barrier level2:parallel, apply void MainAbility::ParallelCase87(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5299,7 +5299,7 @@ void MainAbility::ParallelCase87(int code) // level1:parallel, sync barrier level2:serial, sync void MainAbility::ParallelCase88(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5330,7 +5330,7 @@ void MainAbility::ParallelCase88(int code) // level1:parallel, sync barrier level2:serial, async void MainAbility::ParallelCase89(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5361,7 +5361,7 @@ void MainAbility::ParallelCase89(int code) // level1:parallel, sync barrier level2:serial, delay void MainAbility::ParallelCase90(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5393,7 +5393,7 @@ void MainAbility::ParallelCase90(int code) // level1:parallel, sync barrier level2:serial, apply void MainAbility::ParallelCase91(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5419,7 +5419,7 @@ void MainAbility::ParallelCase91(int code) // level1:parallel, async barrier level2:parallel, sync void MainAbility::ParallelCase92(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5450,7 +5450,7 @@ void MainAbility::ParallelCase92(int code) // level1:parallel, async barrier level2:parallel, async void MainAbility::ParallelCase93(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5475,7 +5475,7 @@ void MainAbility::ParallelCase93(int code) // level1:parallel, async barrier level2:parallel, delay void MainAbility::ParallelCase94(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5501,7 +5501,7 @@ void MainAbility::ParallelCase94(int code) // level1:parallel, async barrier level2:parallel, group void MainAbility::ParallelCase95(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5527,7 +5527,7 @@ void MainAbility::ParallelCase95(int code) // level1:parallel, async barrier level2:parallel, group wait void MainAbility::ParallelCase96(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5555,7 +5555,7 @@ void MainAbility::ParallelCase96(int code) // level1:parallel, async barrier level2:parallel, group notify void MainAbility::ParallelCase97(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5583,7 +5583,7 @@ void MainAbility::ParallelCase97(int code) // level1:parallel, async barrier level2:parallel, sync barrier void MainAbility::ParallelCase98(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5611,7 +5611,7 @@ void MainAbility::ParallelCase98(int code) // level1:parallel, async barrier level2:parallel, async barrier void MainAbility::ParallelCase99(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5639,7 +5639,7 @@ void MainAbility::ParallelCase99(int code) // level1:parallel, async barrier level2:parallel, apply void MainAbility::ParallelCase100(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5665,7 +5665,7 @@ void MainAbility::ParallelCase100(int code) // level1:parallel, async barrier level2:serial, sync void MainAbility::ParallelCase101(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5696,7 +5696,7 @@ void MainAbility::ParallelCase101(int code) // level1:parallel, async barrier level2:serial, async void MainAbility::ParallelCase102(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5727,7 +5727,7 @@ void MainAbility::ParallelCase102(int code) // level1:parallel, async barrier level2:serial, delay void MainAbility::ParallelCase103(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5759,7 +5759,7 @@ void MainAbility::ParallelCase103(int code) // level1:parallel, async barrier level2:serial, apply void MainAbility::ParallelCase104(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5785,7 +5785,7 @@ void MainAbility::ParallelCase104(int code) // level1:parallel, apply level2:parallel, sync void MainAbility::ParallelCase105(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5814,7 +5814,7 @@ void MainAbility::ParallelCase105(int code) // level1:parallel, apply level2:parallel, async void MainAbility::ParallelCase106(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5837,7 +5837,7 @@ void MainAbility::ParallelCase106(int code) // level1:parallel, apply level2:parallel, delay void MainAbility::ParallelCase107(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5861,7 +5861,7 @@ void MainAbility::ParallelCase107(int code) // level1:parallel, apply level2:parallel, group void MainAbility::ParallelCase108(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5885,7 +5885,7 @@ void MainAbility::ParallelCase108(int code) // level1:parallel, apply level2:parallel, group wait void MainAbility::ParallelCase109(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5911,7 +5911,7 @@ void MainAbility::ParallelCase109(int code) // level1:parallel, apply level2:parallel, group notify void MainAbility::ParallelCase110(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5937,7 +5937,7 @@ void MainAbility::ParallelCase110(int code) // level1:parallel, apply level2:parallel, sync barrier void MainAbility::ParallelCase111(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5963,7 +5963,7 @@ void MainAbility::ParallelCase111(int code) // level1:parallel, apply level2:parallel, async barrier void MainAbility::ParallelCase112(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -5989,7 +5989,7 @@ void MainAbility::ParallelCase112(int code) // level1:parallel, apply level2:parallel, apply void MainAbility::ParallelCase113(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6013,7 +6013,7 @@ void MainAbility::ParallelCase113(int code) // level1:parallel, apply level2:serial, sync void MainAbility::ParallelCase114(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6042,7 +6042,7 @@ void MainAbility::ParallelCase114(int code) // level1:parallel, apply level2:serial, async void MainAbility::ParallelCase115(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6071,7 +6071,7 @@ void MainAbility::ParallelCase115(int code) // level1:parallel, apply level2:serial, delay void MainAbility::ParallelCase116(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6101,7 +6101,7 @@ void MainAbility::ParallelCase116(int code) // level1:parallel, apply level2:serial, apply void MainAbility::ParallelCase117(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6125,7 +6125,7 @@ void MainAbility::ParallelCase117(int code) // level1:serial, sync level2:parallel, sync void MainAbility::SerialCase1(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6154,7 +6154,7 @@ void MainAbility::SerialCase1(int code) // level1:serial, sync level2:parallel, async void MainAbility::SerialCase2(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6180,7 +6180,7 @@ void MainAbility::SerialCase2(int code) // level1:serial, sync level2:parallel, delay void MainAbility::SerialCase3(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6207,7 +6207,7 @@ void MainAbility::SerialCase3(int code) // level1:serial, sync level2:parallel, group void MainAbility::SerialCase4(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6234,7 +6234,7 @@ void MainAbility::SerialCase4(int code) // level1:serial, sync level2:parallel, group wait void MainAbility::SerialCase5(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6263,7 +6263,7 @@ void MainAbility::SerialCase5(int code) // level1:serial, sync level2:parallel, group notify void MainAbility::SerialCase6(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6292,7 +6292,7 @@ void MainAbility::SerialCase6(int code) // level1:serial, sync level2:parallel, sync barrier void MainAbility::SerialCase7(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6321,7 +6321,7 @@ void MainAbility::SerialCase7(int code) // level1:serial, sync level2:parallel, async barrier void MainAbility::SerialCase8(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6350,7 +6350,7 @@ void MainAbility::SerialCase8(int code) // level1:serial, sync level2:parallel, apply void MainAbility::SerialCase9(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6377,7 +6377,7 @@ void MainAbility::SerialCase9(int code) // level1:serial, sync level2:serial, sync void MainAbility::SerialCase10(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6406,7 +6406,7 @@ void MainAbility::SerialCase10(int code) // level1:serial, sync level2:serial, async void MainAbility::SerialCase11(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6435,7 +6435,7 @@ void MainAbility::SerialCase11(int code) // level1:serial, sync level2:serial, delay void MainAbility::SerialCase12(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6465,7 +6465,7 @@ void MainAbility::SerialCase12(int code) // level1:serial, sync level2:serial, apply void MainAbility::SerialCase13(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6492,7 +6492,7 @@ void MainAbility::SerialCase13(int code) // level1:serial, async level2:parallel, sync void MainAbility::SerialCase14(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6521,7 +6521,7 @@ void MainAbility::SerialCase14(int code) // level1:serial, async level2:parallel, async void MainAbility::SerialCase15(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6547,7 +6547,7 @@ void MainAbility::SerialCase15(int code) // level1:serial, async level2:parallel, delay void MainAbility::SerialCase16(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6574,7 +6574,7 @@ void MainAbility::SerialCase16(int code) // level1:serial, async level2:parallel, group void MainAbility::SerialCase17(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6601,7 +6601,7 @@ void MainAbility::SerialCase17(int code) // level1:serial, async level2:parallel, group wait void MainAbility::SerialCase18(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6630,7 +6630,7 @@ void MainAbility::SerialCase18(int code) // level1:serial, async level2:parallel, group notify void MainAbility::SerialCase19(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6659,7 +6659,7 @@ void MainAbility::SerialCase19(int code) // level1:serial, async level2:parallel, sync barrier void MainAbility::SerialCase20(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6688,7 +6688,7 @@ void MainAbility::SerialCase20(int code) // level1:serial, async level2:parallel, async barrier void MainAbility::SerialCase21(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6717,7 +6717,7 @@ void MainAbility::SerialCase21(int code) // level1:serial, async level2:parallel, apply void MainAbility::SerialCase22(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6744,7 +6744,7 @@ void MainAbility::SerialCase22(int code) // level1:serial, async level2:serial, sync void MainAbility::SerialCase23(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6773,7 +6773,7 @@ void MainAbility::SerialCase23(int code) // level1:serial, async level2:serial, async void MainAbility::SerialCase24(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6802,7 +6802,7 @@ void MainAbility::SerialCase24(int code) // level1:serial, async level2:serial, delay void MainAbility::SerialCase25(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6832,7 +6832,7 @@ void MainAbility::SerialCase25(int code) // level1:serial, async level2:serial, apply void MainAbility::SerialCase26(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6859,7 +6859,7 @@ void MainAbility::SerialCase26(int code) // level1:serial, delay level2:parallel, sync void MainAbility::SerialCase27(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6889,7 +6889,7 @@ void MainAbility::SerialCase27(int code) // level1:serial, delay level2:parallel, async void MainAbility::SerialCase28(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6916,7 +6916,7 @@ void MainAbility::SerialCase28(int code) // level1:serial, delay level2:parallel, delay void MainAbility::SerialCase29(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6944,7 +6944,7 @@ void MainAbility::SerialCase29(int code) // level1:serial, delay level2:parallel, group void MainAbility::SerialCase30(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -6972,7 +6972,7 @@ void MainAbility::SerialCase30(int code) // level1:serial, delay level2:parallel, group wait void MainAbility::SerialCase31(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7002,7 +7002,7 @@ void MainAbility::SerialCase31(int code) // level1:serial, delay level2:parallel, group notify void MainAbility::SerialCase32(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7032,7 +7032,7 @@ void MainAbility::SerialCase32(int code) // level1:serial, delay level2:parallel, sync barrier void MainAbility::SerialCase33(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7062,7 +7062,7 @@ void MainAbility::SerialCase33(int code) // level1:serial, delay level2:parallel, async barrier void MainAbility::SerialCase34(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7092,7 +7092,7 @@ void MainAbility::SerialCase34(int code) // level1:serial, delay level2:parallel, apply void MainAbility::SerialCase35(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7120,7 +7120,7 @@ void MainAbility::SerialCase35(int code) // level1:serial, delay level2:serial, sync void MainAbility::SerialCase36(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7150,7 +7150,7 @@ void MainAbility::SerialCase36(int code) // level1:serial, delay level2:serial, async void MainAbility::SerialCase37(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7180,7 +7180,7 @@ void MainAbility::SerialCase37(int code) // level1:serial, delay level2:serial, delay void MainAbility::SerialCase38(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7211,7 +7211,7 @@ void MainAbility::SerialCase38(int code) // level1:serial, delay level2:serial, apply void MainAbility::SerialCase39(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7239,7 +7239,7 @@ void MainAbility::SerialCase39(int code) // level1:serial, apply level2:parallel, sync void MainAbility::SerialCase40(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7268,7 +7268,7 @@ void MainAbility::SerialCase40(int code) // level1:serial, apply level2:parallel, async void MainAbility::SerialCase41(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7291,7 +7291,7 @@ void MainAbility::SerialCase41(int code) // level1:serial, apply level2:parallel, delay void MainAbility::SerialCase42(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7315,7 +7315,7 @@ void MainAbility::SerialCase42(int code) // level1:serial, apply level2:parallel, group void MainAbility::SerialCase43(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7339,7 +7339,7 @@ void MainAbility::SerialCase43(int code) // level1:serial, apply level2:parallel, group wait void MainAbility::SerialCase44(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7365,7 +7365,7 @@ void MainAbility::SerialCase44(int code) // level1:serial, apply level2:parallel, group notify void MainAbility::SerialCase45(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7391,7 +7391,7 @@ void MainAbility::SerialCase45(int code) // level1:serial, apply level2:parallel, sync barrier void MainAbility::SerialCase46(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7417,7 +7417,7 @@ void MainAbility::SerialCase46(int code) // level1:serial, apply level2:parallel, async barrier void MainAbility::SerialCase47(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7443,7 +7443,7 @@ void MainAbility::SerialCase47(int code) // level1:serial, apply level2:parallel, apply void MainAbility::SerialCase48(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7467,7 +7467,7 @@ void MainAbility::SerialCase48(int code) // level1:serial, apply level2:serial, sync void MainAbility::SerialCase49(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7496,7 +7496,7 @@ void MainAbility::SerialCase49(int code) // level1:serial, apply level2:serial, async void MainAbility::SerialCase50(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7525,7 +7525,7 @@ void MainAbility::SerialCase50(int code) // level1:serial, apply level2:serial, delay void MainAbility::SerialCase51(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7555,7 +7555,7 @@ void MainAbility::SerialCase51(int code) // level1:serial, apply level2:serial, apply void MainAbility::SerialCase52(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7579,7 +7579,7 @@ void MainAbility::SerialCase52(int code) // level1:spec, sync level2:parallel, sync void MainAbility::SpecCase1(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7608,7 +7608,7 @@ void MainAbility::SpecCase1(int code) // level1:spec, sync level2:parallel, async void MainAbility::SpecCase2(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7634,7 +7634,7 @@ void MainAbility::SpecCase2(int code) // level1:spec, sync level2:parallel, delay void MainAbility::SpecCase3(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7661,7 +7661,7 @@ void MainAbility::SpecCase3(int code) // level1:spec, sync level2:parallel, group void MainAbility::SpecCase4(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7688,7 +7688,7 @@ void MainAbility::SpecCase4(int code) // level1:spec, sync level2:parallel, group wait void MainAbility::SpecCase5(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7717,7 +7717,7 @@ void MainAbility::SpecCase5(int code) // level1:spec, sync level2:parallel, group notify void MainAbility::SpecCase6(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7746,7 +7746,7 @@ void MainAbility::SpecCase6(int code) // level1:spec, sync level2:parallel, sync barrier void MainAbility::SpecCase7(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7775,7 +7775,7 @@ void MainAbility::SpecCase7(int code) // level1:spec, sync level2:parallel, async barrier void MainAbility::SpecCase8(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7804,7 +7804,7 @@ void MainAbility::SpecCase8(int code) // level1:spec, sync level2:parallel, apply void MainAbility::SpecCase9(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7831,7 +7831,7 @@ void MainAbility::SpecCase9(int code) // level1:spec, sync level2:serial, sync void MainAbility::SpecCase10(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7860,7 +7860,7 @@ void MainAbility::SpecCase10(int code) // level1:spec, sync level2:serial, async void MainAbility::SpecCase11(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7889,7 +7889,7 @@ void MainAbility::SpecCase11(int code) // level1:spec, sync level2:serial, delay void MainAbility::SpecCase12(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7919,7 +7919,7 @@ void MainAbility::SpecCase12(int code) // level1:spec, sync level2:serial, apply void MainAbility::SpecCase13(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7946,7 +7946,7 @@ void MainAbility::SpecCase13(int code) // level1:spec, async level2:parallel, sync void MainAbility::SpecCase14(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7974,7 +7974,7 @@ void MainAbility::SpecCase14(int code) // level1:spec, async level2:parallel, async void MainAbility::SpecCase15(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -7996,7 +7996,7 @@ void MainAbility::SpecCase15(int code) // level1:spec, async level2:parallel, delay void MainAbility::SpecCase16(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8019,7 +8019,7 @@ void MainAbility::SpecCase16(int code) // level1:spec, async level2:parallel, group void MainAbility::SpecCase17(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8042,7 +8042,7 @@ void MainAbility::SpecCase17(int code) // level1:spec, async level2:parallel, group wait void MainAbility::SpecCase18(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8067,7 +8067,7 @@ void MainAbility::SpecCase18(int code) // level1:spec, async level2:parallel, group notify void MainAbility::SpecCase19(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8092,7 +8092,7 @@ void MainAbility::SpecCase19(int code) // level1:spec, async level2:parallel, sync barrier void MainAbility::SpecCase20(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8117,7 +8117,7 @@ void MainAbility::SpecCase20(int code) // level1:spec, async level2:parallel, async barrier void MainAbility::SpecCase21(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8142,7 +8142,7 @@ void MainAbility::SpecCase21(int code) // level1:spec, async level2:parallel, apply void MainAbility::SpecCase22(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8165,7 +8165,7 @@ void MainAbility::SpecCase22(int code) // level1:spec, async level2:serial, sync void MainAbility::SpecCase23(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8193,7 +8193,7 @@ void MainAbility::SpecCase23(int code) // level1:spec, async level2:serial, async void MainAbility::SpecCase24(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8221,7 +8221,7 @@ void MainAbility::SpecCase24(int code) // level1:spec, async level2:serial, delay void MainAbility::SpecCase25(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8250,7 +8250,7 @@ void MainAbility::SpecCase25(int code) // level1:spec, async level2:serial, apply void MainAbility::SpecCase26(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8273,7 +8273,7 @@ void MainAbility::SpecCase26(int code) // level1:spec, delay level2:parallel, sync void MainAbility::SpecCase27(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8302,7 +8302,7 @@ void MainAbility::SpecCase27(int code) // level1:spec, delay level2:parallel, async void MainAbility::SpecCase28(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8325,7 +8325,7 @@ void MainAbility::SpecCase28(int code) // level1:spec, delay level2:parallel, delay void MainAbility::SpecCase29(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8349,7 +8349,7 @@ void MainAbility::SpecCase29(int code) // level1:spec, delay level2:parallel, group void MainAbility::SpecCase30(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8373,7 +8373,7 @@ void MainAbility::SpecCase30(int code) // level1:spec, delay level2:parallel, group wait void MainAbility::SpecCase31(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8399,7 +8399,7 @@ void MainAbility::SpecCase31(int code) // level1:spec, delay level2:parallel, group notify void MainAbility::SpecCase32(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8425,7 +8425,7 @@ void MainAbility::SpecCase32(int code) // level1:spec, delay level2:parallel, sync barrier void MainAbility::SpecCase33(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8451,7 +8451,7 @@ void MainAbility::SpecCase33(int code) // level1:spec, delay level2:parallel, async barrier void MainAbility::SpecCase34(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8477,7 +8477,7 @@ void MainAbility::SpecCase34(int code) // level1:spec, delay level2:parallel, apply void MainAbility::SpecCase35(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8501,7 +8501,7 @@ void MainAbility::SpecCase35(int code) // level1:spec, delay level2:serial, sync void MainAbility::SpecCase36(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8530,7 +8530,7 @@ void MainAbility::SpecCase36(int code) // level1:spec, delay level2:serial, async void MainAbility::SpecCase37(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8559,7 +8559,7 @@ void MainAbility::SpecCase37(int code) // level1:spec, delay level2:serial, delay void MainAbility::SpecCase38(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8589,7 +8589,7 @@ void MainAbility::SpecCase38(int code) // level1:spec, delay level2:serial, apply void MainAbility::SpecCase39(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8613,7 +8613,7 @@ void MainAbility::SpecCase39(int code) // level1:spec, apply level2:parallel, sync void MainAbility::SpecCase40(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8642,7 +8642,7 @@ void MainAbility::SpecCase40(int code) // level1:spec, apply level2:parallel, async void MainAbility::SpecCase41(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8665,7 +8665,7 @@ void MainAbility::SpecCase41(int code) // level1:spec, apply level2:parallel, delay void MainAbility::SpecCase42(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8689,7 +8689,7 @@ void MainAbility::SpecCase42(int code) // level1:spec, apply level2:parallel, group void MainAbility::SpecCase43(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8713,7 +8713,7 @@ void MainAbility::SpecCase43(int code) // level1:spec, apply level2:parallel, group wait void MainAbility::SpecCase44(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8739,7 +8739,7 @@ void MainAbility::SpecCase44(int code) // level1:spec, apply level2:parallel, group notify void MainAbility::SpecCase45(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8765,7 +8765,7 @@ void MainAbility::SpecCase45(int code) // level1:spec, apply level2:parallel, sync barrier void MainAbility::SpecCase46(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8791,7 +8791,7 @@ void MainAbility::SpecCase46(int code) // level1:spec, apply level2:parallel, async barrier void MainAbility::SpecCase47(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8817,7 +8817,7 @@ void MainAbility::SpecCase47(int code) // level1:spec, apply level2:parallel, apply void MainAbility::SpecCase48(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8841,7 +8841,7 @@ void MainAbility::SpecCase48(int code) // level1:spec, apply level2:serial, sync void MainAbility::SpecCase49(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8870,7 +8870,7 @@ void MainAbility::SpecCase49(int code) // level1:spec, apply level2:serial, async void MainAbility::SpecCase50(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8899,7 +8899,7 @@ void MainAbility::SpecCase50(int code) // level1:spec, apply level2:serial, delay void MainAbility::SpecCase51(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8929,7 +8929,7 @@ void MainAbility::SpecCase51(int code) // level1:spec, apply level2:serial, apply void MainAbility::SpecCase52(int code) { - APP_LOGI("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); + HILOG_INFO("-- -- -- -- -- --MainAbility::%{public}s", __FUNCTION__); Reset(); TestSetting outerSetting; TestSetting innerSetting; @@ -8970,7 +8970,7 @@ static void addTaskFromList(TaskList &dispatcher, const std::vector &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("SecondAbility::Init"); + HILOG_INFO("SecondAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } @@ -43,7 +43,7 @@ SecondAbility::~SecondAbility() void SecondAbility::OnStart(const Want &want) { - APP_LOGI("SecondAbility::onStart"); + HILOG_INFO("SecondAbility::onStart"); SubscribeEvent(); Ability::OnStart(want); TestUtils::PublishEvent(g_EVENT_RESP_SECOND, Ability::GetState(), "onStart"); @@ -51,7 +51,7 @@ void SecondAbility::OnStart(const Want &want) void SecondAbility::OnStop() { - APP_LOGI("SecondAbility::OnStop"); + HILOG_INFO("SecondAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); TestUtils::PublishEvent(g_EVENT_RESP_SECOND, Ability::GetState(), "OnStop"); @@ -59,34 +59,34 @@ void SecondAbility::OnStop() void SecondAbility::OnActive() { - APP_LOGI("SecondAbility::OnActive"); + HILOG_INFO("SecondAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND, Ability::GetState(), "OnActive"); } void SecondAbility::OnInactive() { - APP_LOGI("SecondAbility::OnInactive"); + HILOG_INFO("SecondAbility::OnInactive"); Ability::OnInactive(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND, Ability::GetState(), "OnInactive"); } void SecondAbility::OnBackground() { - APP_LOGI("SecondAbility::OnBackground"); + HILOG_INFO("SecondAbility::OnBackground"); Ability::OnBackground(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND, Ability::GetState(), "OnBackground"); } void SecondAbility::OnForeground(const Want &want) { - APP_LOGI("SecondAbility::OnForeground"); + HILOG_INFO("SecondAbility::OnForeground"); Ability::OnForeground(want); TestUtils::PublishEvent(g_EVENT_RESP_SECOND, Ability::GetState(), "OnForeground"); } void SecondAbility::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("SecondAbility::OnCommand"); + HILOG_INFO("SecondAbility::OnCommand"); Ability::OnCommand(want, restart, startId); TestUtils::PublishEvent(g_EVENT_RESP_SECOND, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnCommand"); @@ -109,9 +109,9 @@ void SecondAbility::SubscribeEvent() void SecondEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), g_EVENT_REQU_SECOND.c_str()) == 0) { auto target = data.GetData(); @@ -122,14 +122,14 @@ void SecondEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (mapTestFunc_.find(caseInfo[numZero]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[numZero]](std::stoi(caseInfo[numOne]), std::stoi(caseInfo[numTwo]), data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } void SecondAbility::TestDispatcher(int apiIndex, int caseIndex, int code) { - APP_LOGI("SecondAbility::TestAbility"); + HILOG_INFO("SecondAbility::TestAbility"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); diff --git a/test/resource/amssystemtestability/abilitySrc/taskDispatcherTestB/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/taskDispatcherTestB/BUILD.gn index 7cc4125beb..4557c046ec 100644 --- a/test/resource/amssystemtestability/abilitySrc/taskDispatcherTestB/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/taskDispatcherTestB/BUILD.gn @@ -32,8 +32,8 @@ config("taskDispatcherTestBConfig") { "//foundation/appexecfwk/standard/test/systemtest/common/task_dispatcher/include", ] defines = [ - "APP_LOG_TAG = \"taskDispatcherTestB\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"taskDispatcherTestB\"", + "AMS_LOG_DOMAIN = 0xD002200", ] cflags = [] if (target_cpu == "arm") { diff --git a/test/resource/amssystemtestability/abilitySrc/taskDispatcherTestB/src/main_ability.cpp b/test/resource/amssystemtestability/abilitySrc/taskDispatcherTestB/src/main_ability.cpp index fddb141750..46844a1749 100644 --- a/test/resource/amssystemtestability/abilitySrc/taskDispatcherTestB/src/main_ability.cpp +++ b/test/resource/amssystemtestability/abilitySrc/taskDispatcherTestB/src/main_ability.cpp @@ -14,7 +14,7 @@ */ #include "main_ability.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "test_utils.h" #include #include @@ -51,14 +51,14 @@ constexpr int numThree = 3; bool Wait(const int task_num) { - APP_LOGI("-- -- -- -- -- --MainAbility::Wait"); + HILOG_INFO("-- -- -- -- -- --MainAbility::Wait"); std::unique_lock ulock(cv_mutex); using namespace std::chrono_literals; bool result = cv.wait_for(ulock, 5000ms, [task_num] { return terminated_task_num == task_num; }); if (result) { allDispatchers.clear(); } - APP_LOGI("-- -- -- -- -- --MainAbility::Wait result:%{public}d", result); + HILOG_INFO("-- -- -- -- -- --MainAbility::Wait result:%{public}d", result); return result; } @@ -69,14 +69,14 @@ void TestTask(const std::string &task_id) terminated_task_num++; task_execution_sequence += task_id + delimiter; } - APP_LOGI("-- -- -- -- -- --MainAbility::TestTask: %{public}d %{public}s", terminated_task_num, task_id.c_str()); + HILOG_INFO("-- -- -- -- -- --MainAbility::TestTask: %{public}d %{public}s", terminated_task_num, task_id.c_str()); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_B, terminated_task_num, task_execution_sequence); cv.notify_one(); } void Reset() { - APP_LOGI("-- -- -- -- -- --MainAbility::Reset"); + HILOG_INFO("-- -- -- -- -- --MainAbility::Reset"); terminated_task_num = 0; task_execution_sequence = delimiter; allDispatchers.clear(); @@ -84,15 +84,15 @@ void Reset() bool IsAscend(const std::vector &vec) { - APP_LOGI("-- -- -- -- -- --MainAbility::IsAscend begin"); + HILOG_INFO("-- -- -- -- -- --MainAbility::IsAscend begin"); auto pos = std::adjacent_find(std::begin(vec), std::end(vec), std::greater()); return pos == std::end(vec); - APP_LOGI("-- -- -- -- -- --MainAbility::IsAscend end"); + HILOG_INFO("-- -- -- -- -- --MainAbility::IsAscend end"); } bool OuterTaskExecuted(TestSetting setting) { - APP_LOGI("-- -- -- -- -- --MainAbility::OuterTaskExecuted begin"); + HILOG_INFO("-- -- -- -- -- --MainAbility::OuterTaskExecuted begin"); std::string expectedTaskId; bool executed = true; for (int i = 0; i < testTaskCount; i++) { @@ -114,13 +114,13 @@ bool OuterTaskExecuted(TestSetting setting) expectedTaskId = delimiter + outerGroupNotifyId + delimiter; executed = executed && (task_execution_sequence.find(expectedTaskId) != string::npos); } - APP_LOGI("-- -- -- -- -- --MainAbility::OuterTaskExecuted end"); + HILOG_INFO("-- -- -- -- -- --MainAbility::OuterTaskExecuted end"); return executed; } bool InnerTaskExecuted(TestSetting setting) { - APP_LOGI("-- -- -- -- -- --MainAbility::InnerTaskExecuted begin"); + HILOG_INFO("-- -- -- -- -- --MainAbility::InnerTaskExecuted begin"); std::string expectedTaskId; bool executed = true; for (int i = 0; i < testTaskCount; i++) { @@ -144,45 +144,45 @@ bool InnerTaskExecuted(TestSetting setting) expectedTaskId = delimiter + innerGroupNotifyId + delimiter; executed = executed && (task_execution_sequence.find(expectedTaskId) != string::npos); } - APP_LOGI("-- -- -- -- -- --MainAbility::InnerTaskExecuted end"); + HILOG_INFO("-- -- -- -- -- --MainAbility::InnerTaskExecuted end"); return executed; } void setTaskIndex(std::string taskId, std::vector &taskIndex) { - APP_LOGI("-- -- -- -- -- --MainAbility::setTaskIndex begin"); + HILOG_INFO("-- -- -- -- -- --MainAbility::setTaskIndex begin"); std::size_t indx = task_execution_sequence.find(taskId); if (indx != string::npos) { taskIndex.push_back(indx); } - APP_LOGI("-- -- -- -- -- --MainAbility::setTaskIndex end"); + HILOG_INFO("-- -- -- -- -- --MainAbility::setTaskIndex end"); } void GetTaskIndex(std::vector &outerTaskIndex, std::vector> &innerTaskIndex, const int outerCnt = testTaskCount, const int innerCnt = testTaskCount) { - APP_LOGI("-- -- -- -- -- --MainAbility::GetTaskIndex begin"); + HILOG_INFO("-- -- -- -- -- --MainAbility::GetTaskIndex begin"); std::string outerTaskId; std::string innerTaskId; outerTaskIndex.resize(outerCnt); - APP_LOGI("-- -- -- -- -- --MainAbility::GetTaskIndex outersize : %{public}zu", outerTaskIndex.size()); + HILOG_INFO("-- -- -- -- -- --MainAbility::GetTaskIndex outersize : %{public}zu", outerTaskIndex.size()); innerTaskIndex.resize(outerCnt); - APP_LOGI("-- -- -- -- -- --MainAbility::GetTaskIndex innersize : %{public}zu", innerTaskIndex.size()); + HILOG_INFO("-- -- -- -- -- --MainAbility::GetTaskIndex innersize : %{public}zu", innerTaskIndex.size()); for (auto &inner : innerTaskIndex) { inner.resize(innerCnt); - APP_LOGI("-- -- -- -- -- --MainAbility::GetTaskIndex inner :%{public}zu", inner.size()); + HILOG_INFO("-- -- -- -- -- --MainAbility::GetTaskIndex inner :%{public}zu", inner.size()); } - APP_LOGI("-- -- -- -- -- --MainAbility::GetTaskIndex mid1"); + HILOG_INFO("-- -- -- -- -- --MainAbility::GetTaskIndex mid1"); for (int i = 0; i < outerCnt; i++) { outerTaskId = delimiter + std::to_string(i) + delimiter; - APP_LOGI("-- -- -- -- -- --MainAbility::GetTaskIndex mid2"); + HILOG_INFO("-- -- -- -- -- --MainAbility::GetTaskIndex mid2"); outerTaskIndex[i] = task_execution_sequence.find(outerTaskId); - APP_LOGI("-- -- -- -- -- --MainAbility::GetTaskIndex mid3"); + HILOG_INFO("-- -- -- -- -- --MainAbility::GetTaskIndex mid3"); for (int j = 0; j < innerCnt; j++) { innerTaskId = delimiter + std::to_string(i) + innerDelimiter + std::to_string(j) + delimiter; - APP_LOGI("-- -- -- -- -- --MainAbility::GetTaskIndex mid4"); + HILOG_INFO("-- -- -- -- -- --MainAbility::GetTaskIndex mid4"); innerTaskIndex[i][j] = task_execution_sequence.find(innerTaskId); - APP_LOGI("-- -- -- -- -- --MainAbility::GetTaskIndex mid5"); + HILOG_INFO("-- -- -- -- -- --MainAbility::GetTaskIndex mid5"); } std::string taskId = innerSyncBarrierId + std::to_string(i); setTaskIndex(taskId, innerTaskIndex[i]); @@ -194,14 +194,14 @@ void GetTaskIndex(std::vector &outerTaskIndex, std::vector &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("MainAbility::Init"); + HILOG_INFO("MainAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } @@ -212,7 +212,7 @@ MainAbility::~MainAbility() void MainAbility::OnStart(const Want &want) { - APP_LOGI("MainAbility::onStart"); + HILOG_INFO("MainAbility::onStart"); SubscribeEvent(); Ability::OnStart(want); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_B, Ability::GetState(), "onStart"); @@ -220,7 +220,7 @@ void MainAbility::OnStart(const Want &want) void MainAbility::OnStop() { - APP_LOGI("MainAbility::OnStop"); + HILOG_INFO("MainAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_B, Ability::GetState(), "OnStop"); @@ -228,28 +228,28 @@ void MainAbility::OnStop() void MainAbility::OnActive() { - APP_LOGI("MainAbility::OnActive"); + HILOG_INFO("MainAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_B, 0, "OnActive"); } void MainAbility::OnInactive() { - APP_LOGI("MainAbility::OnInactive"); + HILOG_INFO("MainAbility::OnInactive"); Ability::OnInactive(); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_B, Ability::GetState(), "OnInactive"); } void MainAbility::OnBackground() { - APP_LOGI("MainAbility::OnBackground"); + HILOG_INFO("MainAbility::OnBackground"); Ability::OnBackground(); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_B, Ability::GetState(), "OnBackground"); } void MainAbility::OnForeground(const Want &want) { - APP_LOGI("MainAbility::OnForeground"); + HILOG_INFO("MainAbility::OnForeground"); Ability::OnForeground(want); TestUtils::PublishEvent(g_EVENT_RESP_FIRST_B, Ability::GetState(), "OnForeground"); } @@ -272,21 +272,21 @@ void MainAbility::SubscribeEvent() void FirstEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), g_EVENT_REQU_FIRST_B.c_str()) == 0) { auto target = data.GetData(); auto caseInfo = TestUtils::split(target, "_"); - APP_LOGI("FirstEventSubscriber::OnReceiveEvent:caseInfo.size()=%{public}zu", caseInfo.size()); + HILOG_INFO("FirstEventSubscriber::OnReceiveEvent:caseInfo.size()=%{public}zu", caseInfo.size()); if (caseInfo.size() < numThree) { return; } if (mapTestFunc_.find(caseInfo[numZero]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[numZero]](std::stoi(caseInfo[numOne]), std::stoi(caseInfo[numTwo]), data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } @@ -452,7 +452,7 @@ static void addTaskFromList(TaskList &dispatcher, const std::vector &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("SecondAbility::Init"); + HILOG_INFO("SecondAbility::Init"); Ability::Init(abilityInfo, application, handler, token); } @@ -42,7 +42,7 @@ SecondAbility::~SecondAbility() void SecondAbility::OnStart(const Want &want) { - APP_LOGI("SecondAbility::onStart"); + HILOG_INFO("SecondAbility::onStart"); SubscribeEvent(); Ability::OnStart(want); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_B, Ability::GetState(), "onStart"); @@ -50,7 +50,7 @@ void SecondAbility::OnStart(const Want &want) void SecondAbility::OnStop() { - APP_LOGI("SecondAbility::OnStop"); + HILOG_INFO("SecondAbility::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_B, Ability::GetState(), "OnStop"); @@ -58,28 +58,28 @@ void SecondAbility::OnStop() void SecondAbility::OnActive() { - APP_LOGI("SecondAbility::OnActive"); + HILOG_INFO("SecondAbility::OnActive"); Ability::OnActive(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_B, Ability::GetState(), "OnActive"); } void SecondAbility::OnInactive() { - APP_LOGI("SecondAbility::OnInactive"); + HILOG_INFO("SecondAbility::OnInactive"); Ability::OnInactive(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_B, Ability::GetState(), "OnInactive"); } void SecondAbility::OnBackground() { - APP_LOGI("SecondAbility::OnBackground"); + HILOG_INFO("SecondAbility::OnBackground"); Ability::OnBackground(); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_B, Ability::GetState(), "OnBackground"); } void SecondAbility::OnForeground(const Want &want) { - APP_LOGI("SecondAbility::OnForeground"); + HILOG_INFO("SecondAbility::OnForeground"); Ability::OnForeground(want); TestUtils::PublishEvent(g_EVENT_RESP_SECOND_B, Ability::GetState(), "OnForeground"); } @@ -102,9 +102,9 @@ void SecondAbility::SubscribeEvent() void SecondEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("SecondEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("SecondEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (std::strcmp(eventName.c_str(), g_EVENT_REQU_SECOND_B.c_str()) == 0) { auto target = data.GetData(); @@ -115,14 +115,14 @@ void SecondEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (mapTestFunc_.find(caseInfo[numZero]) != mapTestFunc_.end()) { mapTestFunc_[caseInfo[numZero]](std::stoi(caseInfo[numOne]), std::stoi(caseInfo[numTwo]), data.GetCode()); } else { - APP_LOGI("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); + HILOG_INFO("OnReceiveEvent: CommonEventData error(%{public}s)", target.c_str()); } } } void SecondAbility::TestDispatcher(int apiIndex, int caseIndex, int code) { - APP_LOGI("SecondAbility::TestAbility"); + HILOG_INFO("SecondAbility::TestAbility"); if (mapCase_.find(apiIndex) != mapCase_.end()) { if (caseIndex < (int)mapCase_[apiIndex].size()) { mapCase_[apiIndex][caseIndex](code); diff --git a/test/resource/amssystemtestability/abilitySrc/tools/include/stpageabilityevent.h b/test/resource/amssystemtestability/abilitySrc/tools/include/stpageabilityevent.h index 716d3aabad..edfa2dffa9 100644 --- a/test/resource/amssystemtestability/abilitySrc/tools/include/stpageabilityevent.h +++ b/test/resource/amssystemtestability/abilitySrc/tools/include/stpageabilityevent.h @@ -21,7 +21,7 @@ #include "common_event.h" #include "common_event_manager.h" #include "ability_loader.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ability_manager.h" #include "running_process_info.h" diff --git a/test/resource/amssystemtestability/abilitySrc/tools/src/stpageabilityevent.cpp b/test/resource/amssystemtestability/abilitySrc/tools/src/stpageabilityevent.cpp index f13a7db485..338b07788d 100644 --- a/test/resource/amssystemtestability/abilitySrc/tools/src/stpageabilityevent.cpp +++ b/test/resource/amssystemtestability/abilitySrc/tools/src/stpageabilityevent.cpp @@ -132,12 +132,12 @@ int STPageAbilityEvent::GetOnDisconnectCount() void STPageAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("DataTestPageAEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("DataTestPageAEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("DataTestPageAEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("DataTestPageAEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("DataTestPageAEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("DataTestPageAEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); if (!this->ability_.lock()) { - APP_LOGI("STPageAbilityEventSubscriber:ability_ is nullptr"); + HILOG_INFO("STPageAbilityEventSubscriber:ability_ is nullptr"); } if (eventName.compare("requ_page_ability_terminate") == 0) { std::string target = data.GetData(); @@ -153,7 +153,7 @@ void STPageAbilityEventSubscriber::OnReceiveEvent(const CommonEventData &data) if (stub_.promote()) { (this->ability_.lock())->DisconnectAbility(stub_.promote()); } - APP_LOGI("GetMyProcessMemoryInfo:stub_ is nullptr"); + HILOG_INFO("GetMyProcessMemoryInfo:stub_ is nullptr"); } } if (eventName.compare("requ_page_ability_terminate_caller") == 0) { diff --git a/test/resource/formsystemtestability/fmsSystemPerformance/BUILD.gn b/test/resource/formsystemtestability/fmsSystemPerformance/BUILD.gn index 71a7fc4b76..9f49352eca 100644 --- a/test/resource/formsystemtestability/fmsSystemPerformance/BUILD.gn +++ b/test/resource/formsystemtestability/fmsSystemPerformance/BUILD.gn @@ -23,6 +23,7 @@ config("fmsSystemPerformanceConfig") { "${aafwk_path}/interfaces/innerkits/uri/include", "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${aafwk_path}/frameworks/kits/appkit/native/app", @@ -32,8 +33,8 @@ config("fmsSystemPerformanceConfig") { "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"formManagerSystemTest\"", - "LOG_DOMAIN = 0xD002666", + "AMS_LOG_TAG = \"formManagerSystemTest\"", + "AMS_LOG_DOMAIN = 0xD002666", ] } ohos_shared_library("fmsSystemPerformance") { diff --git a/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp b/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp index eb7b1e1ab4..b99f710c58 100755 --- a/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp +++ b/test/resource/formsystemtestability/fmsSystemPerformance/src/form_ability_performance.cpp @@ -16,7 +16,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "form_st_common_info.h" #include "form_test_utils.h" #include "form_ability_performance.h" @@ -50,15 +50,15 @@ static std::string g_moduleName = "formmodule001"; void FormAbilityPerformance::PerformanceFormCallback::OnAcquired( const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); - APP_LOGI("%{public}s formId: %{public}s", __func__, std::to_string(formJsInfo.formId).c_str()); - APP_LOGI("%{public}s bundleName: %{public}s", __func__, formJsInfo.bundleName.c_str()); - APP_LOGI("%{public}s abilityName: %{public}s", __func__, formJsInfo.abilityName.c_str()); - APP_LOGI("%{public}s formName: %{public}s", __func__, formJsInfo.formName.c_str()); - APP_LOGI("%{public}s formTempFlg: %{public}d", __func__, formJsInfo.formTempFlg); - APP_LOGI("%{public}s jsFormCodePath: %{public}s", __func__, formJsInfo.jsFormCodePath.c_str()); - APP_LOGI("%{public}s formData: %{public}s", __func__, formJsInfo.formData.c_str()); - APP_LOGI("%{public}s formProviderData GetDataString: %{public}s", + HILOG_INFO("%{public}s called", __func__); + HILOG_INFO("%{public}s formId: %{public}s", __func__, std::to_string(formJsInfo.formId).c_str()); + HILOG_INFO("%{public}s bundleName: %{public}s", __func__, formJsInfo.bundleName.c_str()); + HILOG_INFO("%{public}s abilityName: %{public}s", __func__, formJsInfo.abilityName.c_str()); + HILOG_INFO("%{public}s formName: %{public}s", __func__, formJsInfo.formName.c_str()); + HILOG_INFO("%{public}s formTempFlg: %{public}d", __func__, formJsInfo.formTempFlg); + HILOG_INFO("%{public}s jsFormCodePath: %{public}s", __func__, formJsInfo.jsFormCodePath.c_str()); + HILOG_INFO("%{public}s formData: %{public}s", __func__, formJsInfo.formData.c_str()); + HILOG_INFO("%{public}s formProviderData GetDataString: %{public}s", __func__, formJsInfo.formProviderData.GetDataString().c_str()); g_formId = std::to_string(formJsInfo.formId); @@ -80,15 +80,15 @@ void FormAbilityPerformance::PerformanceFormCallback::OnAcquired( void FormAbilityPerformance::PerformanceFormCallback::OnUpdate(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); - APP_LOGI("%{public}s formId: %{public}s", __func__, std::to_string(formJsInfo.formId).c_str()); - APP_LOGI("%{public}s bundleName: %{public}s", __func__, formJsInfo.bundleName.c_str()); - APP_LOGI("%{public}s abilityName: %{public}s", __func__, formJsInfo.abilityName.c_str()); - APP_LOGI("%{public}s formName: %{public}s", __func__, formJsInfo.formName.c_str()); - APP_LOGI("%{public}s formTempFlg: %{public}d", __func__, formJsInfo.formTempFlg); - APP_LOGI("%{public}s jsFormCodePath: %{public}s", __func__, formJsInfo.jsFormCodePath.c_str()); - APP_LOGI("%{public}s formData: %{public}s", __func__, formJsInfo.formData.c_str()); - APP_LOGI("%{public}s formProviderData GetDataString: %{public}s", + HILOG_INFO("%{public}s called", __func__); + HILOG_INFO("%{public}s formId: %{public}s", __func__, std::to_string(formJsInfo.formId).c_str()); + HILOG_INFO("%{public}s bundleName: %{public}s", __func__, formJsInfo.bundleName.c_str()); + HILOG_INFO("%{public}s abilityName: %{public}s", __func__, formJsInfo.abilityName.c_str()); + HILOG_INFO("%{public}s formName: %{public}s", __func__, formJsInfo.formName.c_str()); + HILOG_INFO("%{public}s formTempFlg: %{public}d", __func__, formJsInfo.formTempFlg); + HILOG_INFO("%{public}s jsFormCodePath: %{public}s", __func__, formJsInfo.jsFormCodePath.c_str()); + HILOG_INFO("%{public}s formData: %{public}s", __func__, formJsInfo.formData.c_str()); + HILOG_INFO("%{public}s formProviderData GetDataString: %{public}s", __func__, formJsInfo.formProviderData.GetDataString().c_str()); if (this->caseName_ == FORM_EVENT_RECV_PERFORMANCE_TEST_0100) { @@ -108,7 +108,7 @@ void FormAbilityPerformance::PerformanceFormCallback::OnUpdate(const int32_t res void FormAbilityPerformance::PerformanceFormCallback::OnFormUninstall(const int64_t formId) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } void FormAbilityPerformance::FMS_performanceTest_0100(std::string data) @@ -126,9 +126,9 @@ void FormAbilityPerformance::FMS_performanceTest_0100(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("[FMS_performanceTest_0100] AcquireForm end"); + HILOG_INFO("[FMS_performanceTest_0100] AcquireForm end"); } else { - APP_LOGE("[FMS_performanceTest_0100] AcquireForm error"); + HILOG_ERROR("[FMS_performanceTest_0100] AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_0100, EVENT_CODE_100, "false"); } } @@ -137,10 +137,10 @@ void FormAbilityPerformance::FMS_performanceTest_0200(std::string data) { bool bResult = DeleteForm(atoll(g_formId.c_str())); if (bResult) { - APP_LOGI("[FMS_performanceTest_0200] DeleteForm end"); + HILOG_INFO("[FMS_performanceTest_0200] DeleteForm end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_0200, EVENT_CODE_200, "true"); } else { - APP_LOGE("[FMS_performanceTest_0200] DeleteForm error"); + HILOG_ERROR("[FMS_performanceTest_0200] DeleteForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_0200, EVENT_CODE_200, "false"); } } @@ -150,10 +150,10 @@ void FormAbilityPerformance::FMS_performanceTest_0300(std::string data) bool isReleaseCache = false; bool bResult = ReleaseForm(atoll(g_formId.c_str()), isReleaseCache); if (bResult) { - APP_LOGI("[FMS_performanceTest_0300] ReleaseForm end"); + HILOG_INFO("[FMS_performanceTest_0300] ReleaseForm end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_0300, EVENT_CODE_300, "true"); } else { - APP_LOGE("[FMS_performanceTest_0300] ReleaseForm error"); + HILOG_ERROR("[FMS_performanceTest_0300] ReleaseForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_0300, EVENT_CODE_300, "false"); } } @@ -162,10 +162,10 @@ void FormAbilityPerformance::FMS_performanceTest_0400(std::string data) { bool bResult = CastTempForm(atoll(g_formId.c_str())); if (bResult) { - APP_LOGI("[FMS_performanceTest_0400] CastTempForm end"); + HILOG_INFO("[FMS_performanceTest_0400] CastTempForm end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_0400, EVENT_CODE_400, "true"); } else { - APP_LOGE("[FMS_performanceTest_0400] CastTempForm error"); + HILOG_ERROR("[FMS_performanceTest_0400] CastTempForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_0400, EVENT_CODE_400, "false"); } } @@ -176,10 +176,10 @@ void FormAbilityPerformance::FMS_performanceTest_0500(std::string data) formIds.push_back(atoll(g_formId.c_str())); bool bResult = NotifyVisibleForms(formIds); if (bResult) { - APP_LOGI("[FMS_performanceTest_0500] NotifyVisibleForms end"); + HILOG_INFO("[FMS_performanceTest_0500] NotifyVisibleForms end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_0500, EVENT_CODE_500, "true"); } else { - APP_LOGE("[FMS_performanceTest_0500] NotifyVisibleForms error"); + HILOG_ERROR("[FMS_performanceTest_0500] NotifyVisibleForms error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_0500, EVENT_CODE_500, "false"); } } @@ -190,10 +190,10 @@ void FormAbilityPerformance::FMS_performanceTest_0600(std::string data) formIds.push_back(atoll(g_formId.c_str())); bool bResult = NotifyInvisibleForms(formIds); if (bResult) { - APP_LOGI("[FMS_performanceTest_0600] NotifyInvisibleForms end"); + HILOG_INFO("[FMS_performanceTest_0600] NotifyInvisibleForms end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_0600, EVENT_CODE_600, "true"); } else { - APP_LOGE("[FMS_performanceTest_0600] NotifyInvisibleForms error"); + HILOG_ERROR("[FMS_performanceTest_0600] NotifyInvisibleForms error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_0600, EVENT_CODE_600, "false"); } } @@ -202,10 +202,10 @@ void FormAbilityPerformance::FMS_performanceTest_0700(std::string data) { bool bResult = RequestForm(atoll(g_formId.c_str())); if (bResult) { - APP_LOGI("[FMS_performanceTest_0700] RequestForm end"); + HILOG_INFO("[FMS_performanceTest_0700] RequestForm end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_0700, EVENT_CODE_700, "true"); } else { - APP_LOGE("[FMS_performanceTest_0700] RequestForm error"); + HILOG_ERROR("[FMS_performanceTest_0700] RequestForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_1300, EVENT_CODE_700, "false"); } } @@ -215,10 +215,10 @@ void FormAbilityPerformance::FMS_performanceTest_1300(std::string data) std::vector formInfos; bool bResult = GetAllFormsInfo(formInfos); if (bResult) { - APP_LOGI("[FMS_performanceTest_1300] GetAllFormsInfo end"); + HILOG_INFO("[FMS_performanceTest_1300] GetAllFormsInfo end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_1300, EVENT_CODE_1300, "true"); } else { - APP_LOGE("[FMS_performanceTest_1300] GetAllFormsInfo error"); + HILOG_ERROR("[FMS_performanceTest_1300] GetAllFormsInfo error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_1300, EVENT_CODE_1300, "false"); } } @@ -228,10 +228,10 @@ void FormAbilityPerformance::FMS_performanceTest_1400(std::string data) std::vector formInfos; bool bResult = GetFormsInfoByApp(g_bundleName, formInfos); if (bResult) { - APP_LOGI("[FMS_performanceTest_1400] GetFormsInfoByApp end"); + HILOG_INFO("[FMS_performanceTest_1400] GetFormsInfoByApp end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_1400, EVENT_CODE_1400, "true"); } else { - APP_LOGE("[FMS_performanceTest_1400] GetFormsInfoByApp error"); + HILOG_ERROR("[FMS_performanceTest_1400] GetFormsInfoByApp error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_1400, EVENT_CODE_1400, "false"); } } @@ -241,10 +241,10 @@ void FormAbilityPerformance::FMS_performanceTest_1500(std::string data) std::vector formInfos; bool bResult = GetFormsInfoByModule(g_bundleName, g_moduleName, formInfos); if (bResult) { - APP_LOGI("[FMS_performanceTest_1500] GetFormsInfoByModule end"); + HILOG_INFO("[FMS_performanceTest_1500] GetFormsInfoByModule end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_1500, EVENT_CODE_1500, "true"); } else { - APP_LOGE("[FMS_performanceTest_1500] GetFormsInfoByModule error"); + HILOG_ERROR("[FMS_performanceTest_1500] GetFormsInfoByModule error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_1500, EVENT_CODE_1500, "false"); } } @@ -253,23 +253,23 @@ void FormAbilityPerformance::FMS_performanceTest_1600(std::string data) { bool bResult = CheckFMSReady(); if (bResult) { - APP_LOGI("[FMS_performanceTest_1600] CheckFMSReady end"); + HILOG_INFO("[FMS_performanceTest_1600] CheckFMSReady end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_1600, EVENT_CODE_1600, "true"); } else { - APP_LOGE("[FMS_performanceTest_1600] CheckFMSReady error"); + HILOG_ERROR("[FMS_performanceTest_1600] CheckFMSReady error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_PERFORMANCE_TEST_1600, EVENT_CODE_1600, "false"); } } void FormAbilityPerformance::OnStart(const Want &want) { - APP_LOGI("FormAbilityPerformance::onStart"); + HILOG_INFO("FormAbilityPerformance::onStart"); Ability::OnStart(want); } void FormAbilityPerformance::OnActive() { - APP_LOGI("FormAbilityPerformance::OnActive"); + HILOG_INFO("FormAbilityPerformance::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + FORM_ABILITY_STATE_ONACTIVE; FormTestUtils::PublishEvent(FORM_EVENT_ABILITY_ONACTIVED, 0, eventData); @@ -277,7 +277,7 @@ void FormAbilityPerformance::OnActive() void FormAbilityPerformance::OnStop() { - APP_LOGI("FormAbilityPerformance::OnStop"); + HILOG_INFO("FormAbilityPerformance::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); @@ -285,14 +285,14 @@ void FormAbilityPerformance::OnStop() void FormAbilityPerformance::OnInactive() { - APP_LOGI("FormAbilityPerformance::OnInactive"); + HILOG_INFO("FormAbilityPerformance::OnInactive"); Ability::OnInactive(); } void FormAbilityPerformance::OnBackground() { - APP_LOGI("FormAbilityPerformance::OnBackground"); + HILOG_INFO("FormAbilityPerformance::OnBackground"); Ability::OnBackground(); } @@ -315,7 +315,7 @@ void FormAbilityPerformance::Init(const std::shared_ptr &abilityInf const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("FormAbilityPerformance::Init"); + HILOG_INFO("FormAbilityPerformance::Init"); Ability::Init(abilityInfo, application, handler, token); memberFuncMap_[FORM_EVENT_REQ_PERFORMANCE_TEST_0100] = &FormAbilityPerformance::FMS_performanceTest_0100; @@ -335,7 +335,7 @@ void FormAbilityPerformance::Init(const std::shared_ptr &abilityInf void FormAbilityPerformance::handleEvent(std::string action, std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); if (calledFuncMap_.find(action) != calledFuncMap_.end()) { return; } @@ -355,7 +355,7 @@ void FormAbilityPerformance::Clear() void FormEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FormEventSubscriber::OnReceiveEvent:event=%{public}s, code=%{public}d, data=%{public}s", + HILOG_INFO("FormEventSubscriber::OnReceiveEvent:event=%{public}s, code=%{public}d, data=%{public}s", data.GetWant().GetAction().c_str(), data.GetCode(), data.GetData().c_str()); auto eventName = data.GetWant().GetAction(); ability_->handleEvent(eventName, data.GetData()); diff --git a/test/resource/formsystemtestability/fmsSystemStress/BUILD.gn b/test/resource/formsystemtestability/fmsSystemStress/BUILD.gn index 9a99c756ac..59c82510ac 100644 --- a/test/resource/formsystemtestability/fmsSystemStress/BUILD.gn +++ b/test/resource/formsystemtestability/fmsSystemStress/BUILD.gn @@ -23,6 +23,7 @@ config("fmsSystemStressConfig") { "${aafwk_path}/interfaces/innerkits/uri/include", "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${aafwk_path}/frameworks/kits/appkit/native/app", @@ -32,8 +33,8 @@ config("fmsSystemStressConfig") { "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"formManagerSystemTest\"", - "LOG_DOMAIN = 0xD002666", + "AMS_LOG_TAG = \"formManagerSystemTest\"", + "AMS_LOG_DOMAIN = 0xD002666", ] } ohos_shared_library("fmsSystemStress") { diff --git a/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp b/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp index 6d0f6b52ed..0695c31aa9 100755 --- a/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp +++ b/test/resource/formsystemtestability/fmsSystemStress/src/form_ability_stress.cpp @@ -16,7 +16,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "form_st_common_info.h" #include "form_test_utils.h" #include "form_ability_stress.h" @@ -46,18 +46,18 @@ static std::string g_bundleName = "com.form.formsystemtestservicea"; static std::string g_moduleName = "formmodule001"; void FormAbilityStress::StressFormCallback::OnAcquired(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); - APP_LOGI("%{public}s formId: %{public}s", __func__, std::to_string(formJsInfo.formId).c_str()); - APP_LOGI("%{public}s bundleName: %{public}s", __func__, formJsInfo.bundleName.c_str()); - APP_LOGI("%{public}s abilityName: %{public}s", __func__, formJsInfo.abilityName.c_str()); - APP_LOGI("%{public}s formName: %{public}s", __func__, formJsInfo.formName.c_str()); - APP_LOGI("%{public}s formTempFlg: %{public}d", __func__, formJsInfo.formTempFlg); - APP_LOGI("%{public}s jsFormCodePath: %{public}s", __func__, formJsInfo.jsFormCodePath.c_str()); - APP_LOGI("%{public}s formData: %{public}s", __func__, formJsInfo.formData.c_str()); - APP_LOGI("%{public}s formProviderData GetDataString: %{public}s", + HILOG_INFO("%{public}s called", __func__); + HILOG_INFO("%{public}s formId: %{public}s", __func__, std::to_string(formJsInfo.formId).c_str()); + HILOG_INFO("%{public}s bundleName: %{public}s", __func__, formJsInfo.bundleName.c_str()); + HILOG_INFO("%{public}s abilityName: %{public}s", __func__, formJsInfo.abilityName.c_str()); + HILOG_INFO("%{public}s formName: %{public}s", __func__, formJsInfo.formName.c_str()); + HILOG_INFO("%{public}s formTempFlg: %{public}d", __func__, formJsInfo.formTempFlg); + HILOG_INFO("%{public}s jsFormCodePath: %{public}s", __func__, formJsInfo.jsFormCodePath.c_str()); + HILOG_INFO("%{public}s formData: %{public}s", __func__, formJsInfo.formData.c_str()); + HILOG_INFO("%{public}s formProviderData GetDataString: %{public}s", __func__, formJsInfo.formProviderData.GetDataString().c_str()); - APP_LOGI("%{public}s caseName_: %{public}s, code_: %{public}d", __func__, this->caseName_.c_str(), this->code_); + HILOG_INFO("%{public}s caseName_: %{public}s, code_: %{public}d", __func__, this->caseName_.c_str(), this->code_); if (this->caseName_ == FORM_EVENT_RECV_STRESS_TEST_0100) { FormTestUtils::PublishEvent(this->caseName_, EVENT_CODE_101, std::to_string(formJsInfo.formId)); @@ -85,18 +85,18 @@ void FormAbilityStress::StressFormCallback::OnAcquired(const int32_t result, con void FormAbilityStress::StressFormCallback::OnUpdate(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); - APP_LOGI("%{public}s formId: %{public}s", __func__, std::to_string(formJsInfo.formId).c_str()); - APP_LOGI("%{public}s bundleName: %{public}s", __func__, formJsInfo.bundleName.c_str()); - APP_LOGI("%{public}s abilityName: %{public}s", __func__, formJsInfo.abilityName.c_str()); - APP_LOGI("%{public}s formName: %{public}s", __func__, formJsInfo.formName.c_str()); - APP_LOGI("%{public}s formTempFlg: %{public}d", __func__, formJsInfo.formTempFlg); - APP_LOGI("%{public}s jsFormCodePath: %{public}s", __func__, formJsInfo.jsFormCodePath.c_str()); - APP_LOGI("%{public}s formData: %{public}s", __func__, formJsInfo.formData.c_str()); - APP_LOGI("%{public}s formProviderData GetDataString: %{public}s", + HILOG_INFO("%{public}s called", __func__); + HILOG_INFO("%{public}s formId: %{public}s", __func__, std::to_string(formJsInfo.formId).c_str()); + HILOG_INFO("%{public}s bundleName: %{public}s", __func__, formJsInfo.bundleName.c_str()); + HILOG_INFO("%{public}s abilityName: %{public}s", __func__, formJsInfo.abilityName.c_str()); + HILOG_INFO("%{public}s formName: %{public}s", __func__, formJsInfo.formName.c_str()); + HILOG_INFO("%{public}s formTempFlg: %{public}d", __func__, formJsInfo.formTempFlg); + HILOG_INFO("%{public}s jsFormCodePath: %{public}s", __func__, formJsInfo.jsFormCodePath.c_str()); + HILOG_INFO("%{public}s formData: %{public}s", __func__, formJsInfo.formData.c_str()); + HILOG_INFO("%{public}s formProviderData GetDataString: %{public}s", __func__, formJsInfo.formProviderData.GetDataString().c_str()); - APP_LOGI("%{public}s caseName_: %{public}s, code_: %{public}d", __func__, this->caseName_.c_str(), this->code_); + HILOG_INFO("%{public}s caseName_: %{public}s, code_: %{public}d", __func__, this->caseName_.c_str(), this->code_); if (this->caseName_ == FORM_EVENT_RECV_STRESS_TEST_0100) { FormTestUtils::PublishEvent(this->caseName_, EVENT_CODE_102, "true"); @@ -126,7 +126,7 @@ void FormAbilityStress::StressFormCallback::OnUpdate(const int32_t result, const void FormAbilityStress::StressFormCallback::OnFormUninstall(const int64_t formId) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } void FormAbilityStress::FMS_stressTest_0100(std::string data) @@ -144,9 +144,9 @@ void FormAbilityStress::FMS_stressTest_0100(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("[FMS_stressTest_0100] AcquireForm end"); + HILOG_INFO("[FMS_stressTest_0100] AcquireForm end"); } else { - APP_LOGE("[FMS_stressTest_0100] AcquireForm error"); + HILOG_ERROR("[FMS_stressTest_0100] AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_0100, EVENT_CODE_100, "false"); } } @@ -155,10 +155,10 @@ void FormAbilityStress::FMS_stressTest_0100_sub01(std::string form_id) { bool bResult = DeleteForm(atoll(form_id.c_str())); if (bResult) { - APP_LOGI("[FMS_stressTest_0100] DeleteForm end"); + HILOG_INFO("[FMS_stressTest_0100] DeleteForm end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_0100_01, EVENT_CODE_103, "true"); } else { - APP_LOGE("[FMS_stressTest_0100] DeleteForm error"); + HILOG_ERROR("[FMS_stressTest_0100] DeleteForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_0100_01, EVENT_CODE_103, "false"); } } @@ -178,9 +178,9 @@ void FormAbilityStress::FMS_stressTest_0200(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("[FMS_stressTest_0200] AcquireForm end"); + HILOG_INFO("[FMS_stressTest_0200] AcquireForm end"); } else { - APP_LOGE("[FMS_stressTest_0200] AcquireForm error"); + HILOG_ERROR("[FMS_stressTest_0200] AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_0200, EVENT_CODE_200, "false"); } } @@ -190,10 +190,10 @@ void FormAbilityStress::FMS_stressTest_0200_sub01(std::string form_id) bool isReleaseCache = false; bool bResult = ReleaseForm(atoll(form_id.c_str()), isReleaseCache); if (bResult) { - APP_LOGI("[FMS_stressTest_0200] ReleaseForm end"); + HILOG_INFO("[FMS_stressTest_0200] ReleaseForm end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_0200_01, EVENT_CODE_203, "true"); } else { - APP_LOGE("[FMS_stressTest_0200] ReleaseForm error"); + HILOG_ERROR("[FMS_stressTest_0200] ReleaseForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_0200_01, EVENT_CODE_203, "false"); } @@ -215,9 +215,9 @@ void FormAbilityStress::FMS_stressTest_0200_sub02(std::string form_id) // Set Want info end bool bResult = AcquireForm(atoll(form_id.c_str()), want, callback); if (bResult) { - APP_LOGI("[FMS_stressTest_0200] AcquireForm sub02 end"); + HILOG_INFO("[FMS_stressTest_0200] AcquireForm sub02 end"); } else { - APP_LOGE("[FMS_stressTest_0200] AcquireForm sub02 error"); + HILOG_ERROR("[FMS_stressTest_0200] AcquireForm sub02 error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_0200_02, EVENT_CODE_204, "false"); } } @@ -226,10 +226,10 @@ void FormAbilityStress::FMS_stressTest_0200_sub03(std::string form_id) { bool bResult = DeleteForm(atoll(form_id.c_str())); if (bResult) { - APP_LOGI("[FMS_stressTest_0200] DeleteForm end"); + HILOG_INFO("[FMS_stressTest_0200] DeleteForm end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_0200_03, EVENT_CODE_205, "true"); } else { - APP_LOGE("[FMS_stressTest_0200] DeleteForm error"); + HILOG_ERROR("[FMS_stressTest_0200] DeleteForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_0200_03, EVENT_CODE_205, "false"); } } @@ -249,9 +249,9 @@ void FormAbilityStress::FMS_stressTest_0300(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("[FMS_stressTest_0300] AcquireForm end"); + HILOG_INFO("[FMS_stressTest_0300] AcquireForm end"); } else { - APP_LOGE("[FMS_stressTest_0300] AcquireForm error"); + HILOG_ERROR("[FMS_stressTest_0300] AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_0300, EVENT_CODE_300, "false"); } } @@ -260,10 +260,10 @@ void FormAbilityStress::FMS_stressTest_0300_sub01(std::string form_id) { bool bResult = CastTempForm(atoll(form_id.c_str())); if (bResult) { - APP_LOGI("[FMS_stressTest_0300] CastTempForm end"); + HILOG_INFO("[FMS_stressTest_0300] CastTempForm end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_0300_01, EVENT_CODE_303, "true"); } else { - APP_LOGE("[FMS_stressTest_0300] CastTempForm error"); + HILOG_ERROR("[FMS_stressTest_0300] CastTempForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_0300_01, EVENT_CODE_303, "false"); } @@ -274,10 +274,10 @@ void FormAbilityStress::FMS_stressTest_0300_sub02(std::string form_id) { bool bResult = DeleteForm(atoll(form_id.c_str())); if (bResult) { - APP_LOGI("[FMS_stressTest_0300] DeleteForm end"); + HILOG_INFO("[FMS_stressTest_0300] DeleteForm end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_0300_02, EVENT_CODE_304, "true"); } else { - APP_LOGE("[FMS_stressTest_0300] DeleteForm error"); + HILOG_ERROR("[FMS_stressTest_0300] DeleteForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_0300_02, EVENT_CODE_304, "false"); } } @@ -317,9 +317,9 @@ void FormAbilityStress::FMS_stressTest_1100(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("[FMS_stressTest_1100] AcquireForm end"); + HILOG_INFO("[FMS_stressTest_1100] AcquireForm end"); } else { - APP_LOGE("[FMS_stressTest_1100] AcquireForm error"); + HILOG_ERROR("[FMS_stressTest_1100] AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1100, EVENT_CODE_1100, "false"); } } @@ -330,10 +330,10 @@ void FormAbilityStress::FMS_stressTest_1100_sub01(std::string form_id) formIds.push_back(atoll(form_id.c_str())); bool bResult = NotifyInvisibleForms(formIds); if (bResult) { - APP_LOGI("[FMS_stressTest_1100] NotifyInvisibleForms end"); + HILOG_INFO("[FMS_stressTest_1100] NotifyInvisibleForms end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1100_01, EVENT_CODE_1103, "true"); } else { - APP_LOGE("[FMS_stressTest_1100] NotifyInvisibleForms error"); + HILOG_ERROR("[FMS_stressTest_1100] NotifyInvisibleForms error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1100_01, EVENT_CODE_1103, "false"); } @@ -346,10 +346,10 @@ void FormAbilityStress::FMS_stressTest_1100_sub02(std::string form_id) formIds.push_back(atoll(form_id.c_str())); bool bResult = NotifyVisibleForms(formIds); if (bResult) { - APP_LOGI("[FMS_stressTest_1100] NotifyVisibleForms end"); + HILOG_INFO("[FMS_stressTest_1100] NotifyVisibleForms end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1100_02, EVENT_CODE_1104, "true"); } else { - APP_LOGE("[FMS_stressTest_1100] NotifyVisibleForms error"); + HILOG_ERROR("[FMS_stressTest_1100] NotifyVisibleForms error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1100_02, EVENT_CODE_1104, "false"); } @@ -360,10 +360,10 @@ void FormAbilityStress::FMS_stressTest_1100_sub03(std::string form_id) { bool bResult = DeleteForm(atoll(form_id.c_str())); if (bResult) { - APP_LOGI("[FMS_stressTest_1100] DeleteForm end"); + HILOG_INFO("[FMS_stressTest_1100] DeleteForm end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1100_03, EVENT_CODE_1105, "true"); } else { - APP_LOGE("[FMS_stressTest_1100] DeleteForm error"); + HILOG_ERROR("[FMS_stressTest_1100] DeleteForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1100_03, EVENT_CODE_1105, "false"); } } @@ -387,9 +387,9 @@ void FormAbilityStress::FMS_stressTest_1300(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("[FMS_stressTest_1300] AcquireForm end"); + HILOG_INFO("[FMS_stressTest_1300] AcquireForm end"); } else { - APP_LOGE("[FMS_stressTest_1300] AcquireForm error"); + HILOG_ERROR("[FMS_stressTest_1300] AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1300, EVENT_CODE_1300, "false"); } } @@ -400,10 +400,10 @@ void FormAbilityStress::FMS_stressTest_1300_sub01(std::string form_id) formIds.push_back(atoll(form_id.c_str())); bool bResult = EnableUpdateForm(formIds); if (bResult) { - APP_LOGI("[FMS_stressTest_1300] EnableUpdateForm end"); + HILOG_INFO("[FMS_stressTest_1300] EnableUpdateForm end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1300_01, EVENT_CODE_1303, "true"); } else { - APP_LOGE("[FMS_stressTest_1300] EnableUpdateForm error"); + HILOG_ERROR("[FMS_stressTest_1300] EnableUpdateForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1300_01, EVENT_CODE_1303, "false"); } @@ -416,10 +416,10 @@ void FormAbilityStress::FMS_stressTest_1300_sub02(std::string form_id) formIds.push_back(atoll(form_id.c_str())); bool bResult = DisableUpdateForm(formIds); if (bResult) { - APP_LOGI("[FMS_stressTest_1300] DisableUpdateForm end"); + HILOG_INFO("[FMS_stressTest_1300] DisableUpdateForm end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1300_02, EVENT_CODE_1304, "true"); } else { - APP_LOGE("[FMS_stressTest_1300] DisableUpdateForm error"); + HILOG_ERROR("[FMS_stressTest_1300] DisableUpdateForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1300_02, EVENT_CODE_1304, "false"); } @@ -430,10 +430,10 @@ void FormAbilityStress::FMS_stressTest_1300_sub03(std::string form_id) { bool bResult = DeleteForm(atoll(form_id.c_str())); if (bResult) { - APP_LOGI("[FMS_stressTest_1300] DeleteForm end"); + HILOG_INFO("[FMS_stressTest_1300] DeleteForm end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1300_03, EVENT_CODE_1305, "true"); } else { - APP_LOGE("[FMS_stressTest_1300] DeleteForm error"); + HILOG_ERROR("[FMS_stressTest_1300] DeleteForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1300_03, EVENT_CODE_1305, "false"); } } @@ -455,10 +455,10 @@ void FormAbilityStress::FMS_stressTest_1700(std::string data) std::vector formInfos; bool bResult = GetAllFormsInfo(formInfos); if (bResult) { - APP_LOGI("[FMS_stressTest_1700] GetAllFormsInfo end"); + HILOG_INFO("[FMS_stressTest_1700] GetAllFormsInfo end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1700, EVENT_CODE_1700, "true"); } else { - APP_LOGE("[FMS_stressTest_1700] GetAllFormsInfo error"); + HILOG_ERROR("[FMS_stressTest_1700] GetAllFormsInfo error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1700, EVENT_CODE_1700, "false"); } @@ -470,10 +470,10 @@ void FormAbilityStress::FMS_stressTest_1700_sub01(std::string data) std::vector formInfos; bool bResult = GetFormsInfoByApp(g_bundleName, formInfos); if (bResult) { - APP_LOGI("[FMS_stressTest_1700] GetFormsInfoByApp end"); + HILOG_INFO("[FMS_stressTest_1700] GetFormsInfoByApp end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1700_01, EVENT_CODE_1701, "true"); } else { - APP_LOGE("[FMS_stressTest_1700] GetFormsInfoByApp error"); + HILOG_ERROR("[FMS_stressTest_1700] GetFormsInfoByApp error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1700_01, EVENT_CODE_1701, "false"); } @@ -485,10 +485,10 @@ void FormAbilityStress::FMS_stressTest_1700_sub02(std::string data) std::vector formInfos; bool bResult = GetFormsInfoByModule(g_bundleName, g_moduleName, formInfos); if (bResult) { - APP_LOGI("[FMS_stressTest_1700] GetFormsInfoByModule end"); + HILOG_INFO("[FMS_stressTest_1700] GetFormsInfoByModule end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1700_02, EVENT_CODE_1702, "true"); } else { - APP_LOGE("[FMS_stressTest_1700] GetFormsInfoByModule error"); + HILOG_ERROR("[FMS_stressTest_1700] GetFormsInfoByModule error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1700_02, EVENT_CODE_1702, "false"); } } @@ -497,23 +497,23 @@ void FormAbilityStress::FMS_stressTest_1800(std::string data) { bool bResult = CheckFMSReady(); if (bResult) { - APP_LOGI("[FMS_stressTest_1800] CheckFMSReady end"); + HILOG_INFO("[FMS_stressTest_1800] CheckFMSReady end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1800, EVENT_CODE_1800, "true"); } else { - APP_LOGE("[FMS_stressTest_1800] CheckFMSReady error"); + HILOG_ERROR("[FMS_stressTest_1800] CheckFMSReady error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_STRESS_TEST_1800, EVENT_CODE_1800, "false"); } } void FormAbilityStress::OnStart(const Want &want) { - APP_LOGI("FormAbilityStress::onStart"); + HILOG_INFO("FormAbilityStress::onStart"); Ability::OnStart(want); } void FormAbilityStress::OnActive() { - APP_LOGI("FormAbilityStress::OnActive"); + HILOG_INFO("FormAbilityStress::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + FORM_ABILITY_STATE_ONACTIVE; FormTestUtils::PublishEvent(FORM_EVENT_ABILITY_ONACTIVED, 0, eventData); @@ -521,7 +521,7 @@ void FormAbilityStress::OnActive() void FormAbilityStress::OnStop() { - APP_LOGI("FormAbilityStress::OnStop"); + HILOG_INFO("FormAbilityStress::OnStop"); Ability::OnStop(); CommonEventManager::UnSubscribeCommonEvent(subscriber_); @@ -529,21 +529,21 @@ void FormAbilityStress::OnStop() void FormAbilityStress::OnInactive() { - APP_LOGI("FormAbilityStress::OnInactive"); + HILOG_INFO("FormAbilityStress::OnInactive"); Ability::OnInactive(); } void FormAbilityStress::OnBackground() { - APP_LOGI("FormAbilityStress::OnBackground"); + HILOG_INFO("FormAbilityStress::OnBackground"); Ability::OnBackground(); } void FormAbilityStress::SubscribeEvent() { - APP_LOGI("FormAbilityStress::SubscribeEvent"); + HILOG_INFO("FormAbilityStress::SubscribeEvent"); MatchingSkills matchingSkills; for (const auto &e : eventList) { matchingSkills.AddEvent(e); @@ -560,7 +560,7 @@ void FormAbilityStress::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("FormAbilityStress::Init"); + HILOG_INFO("FormAbilityStress::Init"); Ability::Init(abilityInfo, application, handler, token); memberFuncMap_[FORM_EVENT_REQ_STRESS_TEST_0100] = &FormAbilityStress::FMS_stressTest_0100; @@ -592,7 +592,7 @@ void FormAbilityStress::Init(const std::shared_ptr &abilityInfo, void FormAbilityStress::handleEvent(std::string action, std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); if (calledFuncMap_.find(action) != calledFuncMap_.end()) { return; } @@ -612,7 +612,7 @@ void FormAbilityStress::Clear() void FormEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FormEventSubscriber::OnReceiveEvent:event=%{public}s, code=%{public}d, data=%{public}s", + HILOG_INFO("FormEventSubscriber::OnReceiveEvent:event=%{public}s, code=%{public}d, data=%{public}s", data.GetWant().GetAction().c_str(), data.GetCode(), data.GetData().c_str()); auto eventName = data.GetWant().GetAction(); ability_->handleEvent(eventName, data.GetData()); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostCommonA/BUILD.gn b/test/resource/formsystemtestability/fmsSystemTestHostCommonA/BUILD.gn index 3d45bc5a64..276e5796dd 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostCommonA/BUILD.gn +++ b/test/resource/formsystemtestability/fmsSystemTestHostCommonA/BUILD.gn @@ -23,6 +23,7 @@ config("fmsSystemTestHostCommonAConfig") { "${aafwk_path}/interfaces/innerkits/uri/include", "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${aafwk_path}/frameworks/kits/appkit/native/app", @@ -33,8 +34,8 @@ config("fmsSystemTestHostCommonAConfig") { "//foundation/distributedschedule/safwk/services/safwk/include", ] defines = [ - "APP_LOG_TAG = \"formManagerSystemTest\"", - "LOG_DOMAIN = 0xD002666", + "AMS_LOG_TAG = \"formManagerSystemTest\"", + "AMS_LOG_DOMAIN = 0xD002666", ] } ohos_shared_library("fmsSystemTestHostCommonA") { diff --git a/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp b/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp index 401b391d0d..10b06b9312 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostCommonA/src/form_ability_commona.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "form_ability_commona.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "form_st_common_info.h" #include "form_test_utils.h" #include "system_test_form_util.h" @@ -33,23 +33,23 @@ std::vector eventList = { }; void FormAbilityCommonA::AcquireFormCallback::OnAcquired(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called[%{public}s]", __func__, std::to_string(formJsInfo.formId).c_str()); + HILOG_INFO("%{public}s called[%{public}s]", __func__, std::to_string(formJsInfo.formId).c_str()); } void FormAbilityCommonA::AcquireFormCallback::OnUpdate(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100, std::to_string(formJsInfo.formId)); } void FormAbilityCommonA::AcquireFormCallback::OnFormUninstall(const int64_t formId) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } // Create one form(temp/normal) void FormAbilityCommonA::FMS_acquireForm(std::string data) { - APP_LOGI("%{public}s called, data: %{public}s", __func__, data.c_str()); + HILOG_INFO("%{public}s called, data: %{public}s", __func__, data.c_str()); std::shared_ptr callback = std::make_shared(); // Set Want info begin Want want; @@ -65,27 +65,27 @@ void FormAbilityCommonA::FMS_acquireForm(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("[form_ability_commonA]AcquireForm end"); + HILOG_INFO("[form_ability_commonA]AcquireForm end"); } else { - APP_LOGE("[form_ability_commonA]AcquireForm error"); + HILOG_ERROR("[form_ability_commonA]AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ONE_NORMAL_FORM, EVENT_CODE_100, ""); } } void FormAbilityCommonA::FMS_deleteForm(std::string data) { - APP_LOGI("%{public}s formId: %{public}s", __func__, data.c_str()); + HILOG_INFO("%{public}s formId: %{public}s", __func__, data.c_str()); bool bResult = DeleteForm(atoll(data.c_str())); if (bResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL, EVENT_CODE_101, "true"); } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ONE_NORMAL_FORM_DEL, EVENT_CODE_101, "false"); } } void FormAbilityCommonA::FMS_acquireForm_batch(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); @@ -95,27 +95,27 @@ void FormAbilityCommonA::FMS_acquireForm_batch(std::string data) want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); - APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); + HILOG_INFO("%{public}s, formCount: %{public}d", __func__, formCount); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, formCount); // Set Want info end int result = STtools::SystemTestFormUtil::BatchAddFormRecords(want); if (result == ERR_OK) { - APP_LOGI("Batch add form end"); + HILOG_INFO("Batch add form end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_BATCH, EVENT_CODE_BATCH, "true"); } else { - APP_LOGE("Batch add form error"); + HILOG_ERROR("Batch add form error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_BATCH, EVENT_CODE_BATCH, "false"); } } void FormAbilityCommonA::FMS_deleteFormBatch(std::string strFormId) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); int result = STtools::SystemTestFormUtil::ClearFormRecords(); if (result == ERR_OK) { - APP_LOGI("Clear form records end"); + HILOG_INFO("Clear form records end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_CLEAR_FORM_BATCH, EVENT_CODE_CLEAR_BATCH, "true"); } else { - APP_LOGE("Clear form records error"); + HILOG_ERROR("Clear form records error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_CLEAR_FORM_BATCH, EVENT_CODE_CLEAR_BATCH, "false"); } } @@ -125,12 +125,12 @@ FormAbilityCommonA::~FormAbilityCommonA() } void FormAbilityCommonA::OnStart(const Want &want) { - APP_LOGI("FormAbilityCommonA::onStart"); + HILOG_INFO("FormAbilityCommonA::onStart"); Ability::OnStart(want); } void FormAbilityCommonA::OnActive() { - APP_LOGI("FormAbilityCommonA::OnActive"); + HILOG_INFO("FormAbilityCommonA::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + FORM_ABILITY_STATE_ONACTIVE; FormTestUtils::PublishEvent(FORM_EVENT_ABILITY_ONACTIVED, 0, eventData); @@ -138,25 +138,25 @@ void FormAbilityCommonA::OnActive() void FormAbilityCommonA::OnStop() { - APP_LOGI("FormAbilityCommonA::OnStop"); + HILOG_INFO("FormAbilityCommonA::OnStop"); Ability::OnStop(); } void FormAbilityCommonA::OnInactive() { - APP_LOGI("FormAbilityCommonA::OnInactive"); + HILOG_INFO("FormAbilityCommonA::OnInactive"); Ability::OnInactive(); } void FormAbilityCommonA::OnBackground() { - APP_LOGI("FormAbilityCommonA::OnBackground"); + HILOG_INFO("FormAbilityCommonA::OnBackground"); Ability::OnBackground(); } void FormAbilityCommonA::SubscribeEvent() { - APP_LOGI("FormAbilityCommonA::SubscribeEvent"); + HILOG_INFO("FormAbilityCommonA::SubscribeEvent"); MatchingSkills matchingSkills; for (const auto &e : eventList) { matchingSkills.AddEvent(e); @@ -173,7 +173,7 @@ void FormAbilityCommonA::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("FormAbilityCommonA::Init"); + HILOG_INFO("FormAbilityCommonA::Init"); Ability::Init(abilityInfo, application, handler, token); memberFuncMap_[FORM_EVENT_REQ_ONE_NORMAL_FORM] = &FormAbilityCommonA::FMS_acquireForm; memberFuncMap_[FORM_EVENT_REQ_ONE_NORMAL_FORM_DEL] = &FormAbilityCommonA::FMS_deleteForm; @@ -184,7 +184,7 @@ void FormAbilityCommonA::Init(const std::shared_ptr &abilityInfo, void FormAbilityCommonA::handleEvent(std::string action, std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); auto itFunc = memberFuncMap_.find(action); if (itFunc != memberFuncMap_.end()) { auto memberFunc = itFunc->second; @@ -196,9 +196,9 @@ void FormAbilityCommonA::handleEvent(std::string action, std::string data) void FormEventSubscriberForCommonA::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FormEventSubscriberForCommonA::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("FormEventSubscriberForCommonA::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FormEventSubscriberForCommonA::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("FormEventSubscriberForCommonA::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); ability_->handleEvent(eventName, data.GetData()); if (eventName == FORM_EVENT_REQ_ONE_NORMAL_FORM && data.GetCode() == EVENT_CODE_100) { diff --git a/test/resource/formsystemtestability/fmsSystemTestHostCommonB/BUILD.gn b/test/resource/formsystemtestability/fmsSystemTestHostCommonB/BUILD.gn index 6198c9cabc..dbb27ae54f 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostCommonB/BUILD.gn +++ b/test/resource/formsystemtestability/fmsSystemTestHostCommonB/BUILD.gn @@ -23,6 +23,7 @@ config("fmsSystemTestHostCommonBConfig") { "${aafwk_path}/interfaces/innerkits/uri/include", "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${aafwk_path}/frameworks/kits/appkit/native/app", @@ -33,8 +34,8 @@ config("fmsSystemTestHostCommonBConfig") { "//foundation/distributedschedule/safwk/services/safwk/include", ] defines = [ - "APP_LOG_TAG = \"formManagerSystemTest\"", - "LOG_DOMAIN = 0xD002666", + "AMS_LOG_TAG = \"formManagerSystemTest\"", + "AMS_LOG_DOMAIN = 0xD002666", ] } ohos_shared_library("fmsSystemTestHostCommonB") { diff --git a/test/resource/formsystemtestability/fmsSystemTestHostCommonB/src/form_ability_commonb.cpp b/test/resource/formsystemtestability/fmsSystemTestHostCommonB/src/form_ability_commonb.cpp index a8add0eef4..fb5e9f5641 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostCommonB/src/form_ability_commonb.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostCommonB/src/form_ability_commonb.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "form_ability_commonb.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "form_st_common_info.h" #include "form_test_utils.h" #include "system_test_form_util.h" @@ -33,23 +33,23 @@ std::vector eventList = { }; void FormAbilityCommonB::AcquireFormCallback::OnAcquired(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called[%{public}s]", __func__, std::to_string(formJsInfo.formId).c_str()); + HILOG_INFO("%{public}s called[%{public}s]", __func__, std::to_string(formJsInfo.formId).c_str()); } void FormAbilityCommonB::AcquireFormCallback::OnUpdate(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ONE_NORMAL_FORM_B, EVENT_CODE_100, std::to_string(formJsInfo.formId)); } void FormAbilityCommonB::AcquireFormCallback::OnFormUninstall(const int64_t formId) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } // Create one form(temp/normal) void FormAbilityCommonB::FMS_acquireForm(std::string data) { - APP_LOGI("%{public}s called, data: %{public}s", __func__, data.c_str()); + HILOG_INFO("%{public}s called, data: %{public}s", __func__, data.c_str()); std::shared_ptr callback = std::make_shared(); // Set Want info begin Want want; @@ -65,15 +65,15 @@ void FormAbilityCommonB::FMS_acquireForm(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("[form_ability_commonB]AcquireForm end"); + HILOG_INFO("[form_ability_commonB]AcquireForm end"); } else { - APP_LOGE("[form_ability_commonB]AcquireForm error"); + HILOG_ERROR("[form_ability_commonB]AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ONE_NORMAL_FORM_B, EVENT_CODE_100, ""); } } void FormAbilityCommonB::FMS_acquireForm_batch(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); @@ -83,39 +83,39 @@ void FormAbilityCommonB::FMS_acquireForm_batch(std::string data) want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); - APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); + HILOG_INFO("%{public}s, formCount: %{public}d", __func__, formCount); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, formCount); // Set Want info end int result = STtools::SystemTestFormUtil::BatchAddFormRecords(want); if (result == ERR_OK) { - APP_LOGI("Batch add form end"); + HILOG_INFO("Batch add form end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_BATCH, EVENT_CODE_BATCH, "true"); } else { - APP_LOGE("Batch add form error"); + HILOG_ERROR("Batch add form error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_BATCH, EVENT_CODE_BATCH, "false"); } } void FormAbilityCommonB::FMS_deleteFormBatch(std::string strFormId) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); int result = STtools::SystemTestFormUtil::ClearFormRecords(); if (result == ERR_OK) { - APP_LOGI("Clear form records end"); + HILOG_INFO("Clear form records end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_CLEAR_FORM_BATCH, EVENT_CODE_CLEAR_BATCH, "true"); } else { - APP_LOGE("Clear form records error"); + HILOG_ERROR("Clear form records error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_CLEAR_FORM_BATCH, EVENT_CODE_CLEAR_BATCH, "false"); } } void FormAbilityCommonB::FMS_deleteForm(std::string data) { - APP_LOGI("%{public}s formId: %{public}s", __func__, data.c_str()); + HILOG_INFO("%{public}s formId: %{public}s", __func__, data.c_str()); bool bResult = DeleteForm(atoll(data.c_str())); if (bResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ONE_NORMAL_FORM_B_DEL, EVENT_CODE_101, "true"); } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ONE_NORMAL_FORM_B_DEL, EVENT_CODE_101, "false"); } } @@ -125,12 +125,12 @@ FormAbilityCommonB::~FormAbilityCommonB() } void FormAbilityCommonB::OnStart(const Want &want) { - APP_LOGI("FormAbilityCommonB::onStart"); + HILOG_INFO("FormAbilityCommonB::onStart"); Ability::OnStart(want); } void FormAbilityCommonB::OnActive() { - APP_LOGI("FormAbilityCommonB::OnActive"); + HILOG_INFO("FormAbilityCommonB::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + FORM_ABILITY_STATE_ONACTIVE; FormTestUtils::PublishEvent(FORM_EVENT_ABILITY_ONACTIVED, 0, eventData); @@ -138,25 +138,25 @@ void FormAbilityCommonB::OnActive() void FormAbilityCommonB::OnStop() { - APP_LOGI("FormAbilityCommonB::OnStop"); + HILOG_INFO("FormAbilityCommonB::OnStop"); Ability::OnStop(); } void FormAbilityCommonB::OnInactive() { - APP_LOGI("FormAbilityCommonB::OnInactive"); + HILOG_INFO("FormAbilityCommonB::OnInactive"); Ability::OnInactive(); } void FormAbilityCommonB::OnBackground() { - APP_LOGI("FormAbilityCommonB::OnBackground"); + HILOG_INFO("FormAbilityCommonB::OnBackground"); Ability::OnBackground(); } void FormAbilityCommonB::SubscribeEvent() { - APP_LOGI("FormAbilityCommonB::SubscribeEvent"); + HILOG_INFO("FormAbilityCommonB::SubscribeEvent"); MatchingSkills matchingSkills; for (const auto &e : eventList) { matchingSkills.AddEvent(e); @@ -173,7 +173,7 @@ void FormAbilityCommonB::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("FormAbilityCommonB::Init"); + HILOG_INFO("FormAbilityCommonB::Init"); Ability::Init(abilityInfo, application, handler, token); memberFuncMap_[FORM_EVENT_REQ_ONE_NORMAL_FORM_B] = &FormAbilityCommonB::FMS_acquireForm; memberFuncMap_[FORM_EVENT_REQ_ONE_NORMAL_FORM_B_DEL] = &FormAbilityCommonB::FMS_deleteForm; @@ -184,7 +184,7 @@ void FormAbilityCommonB::Init(const std::shared_ptr &abilityInfo, void FormAbilityCommonB::handleEvent(std::string action, std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); auto itFunc = memberFuncMap_.find(action); if (itFunc != memberFuncMap_.end()) { auto memberFunc = itFunc->second; @@ -196,9 +196,9 @@ void FormAbilityCommonB::handleEvent(std::string action, std::string data) void FormEventSubscriberForCommonB::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FormEventSubscriberForCommonB::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("FormEventSubscriberForCommonB::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FormEventSubscriberForCommonB::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("FormEventSubscriberForCommonB::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); ability_->handleEvent(eventName, data.GetData()); CommonEventManager::UnSubscribeCommonEvent(ability_->subscriber_); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/BUILD.gn b/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/BUILD.gn index b24bbe4c5e..47325e42c2 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/BUILD.gn +++ b/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/BUILD.gn @@ -23,6 +23,7 @@ config("fmsSystemTestHostNoPermConfig") { "${aafwk_path}/interfaces/innerkits/uri/include", "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${aafwk_path}/frameworks/kits/appkit/native/app", @@ -32,8 +33,8 @@ config("fmsSystemTestHostNoPermConfig") { "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"formManagerSystemTest\"", - "LOG_DOMAIN = 0xD002666", + "AMS_LOG_TAG = \"formManagerSystemTest\"", + "AMS_LOG_DOMAIN = 0xD002666", ] } ohos_shared_library("fmsSystemTestHostNoPerm") { diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp index c0bab3eab5..3ff4f62693 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNoPerm/src/form_ability_no_perm.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "form_ability_no_perm.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "form_st_common_info.h" #include "form_test_utils.h" @@ -26,15 +26,15 @@ namespace OHOS { namespace AppExecFwk { void FormAbilityNoPerm::AcquireFormCallback::OnAcquired(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } void FormAbilityNoPerm::AcquireFormCallback::OnUpdate(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } void FormAbilityNoPerm::AcquireFormCallback::OnFormUninstall(const int64_t formId) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } void FormAbilityNoPerm::FMS_acquireForm_0200() @@ -50,9 +50,9 @@ void FormAbilityNoPerm::FMS_acquireForm_0200() // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0200, EVENT_CODE_200, "false"); } } @@ -62,9 +62,9 @@ void FormAbilityNoPerm::FMS_deleteForm_0200() int64_t formId = 1; bool bResult = DeleteForm(formId); if (bResult) { - APP_LOGI("[FMS_deleteForm_0200] end"); + HILOG_INFO("[FMS_deleteForm_0200] end"); } else { - APP_LOGE("[FMS_deleteForm_0200] error"); + HILOG_ERROR("[FMS_deleteForm_0200] error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0200, EVENT_CODE_200, "false"); } } @@ -75,9 +75,9 @@ void FormAbilityNoPerm::FMS_releaseForm_0200() bool isReleaseCache = true; bool bResult = ReleaseForm(formId, isReleaseCache); if (bResult) { - APP_LOGI("[FMS_releaseForm_0200] end"); + HILOG_INFO("[FMS_releaseForm_0200] end"); } else { - APP_LOGE("[FMS_releaseForm_0200] error"); + HILOG_ERROR("[FMS_releaseForm_0200] error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0200, EVENT_CODE_200, "false"); } } @@ -85,7 +85,7 @@ void FormAbilityNoPerm::FMS_releaseForm_0200() void FormAbilityNoPerm::OnStart(const Want &want) { - APP_LOGI("FormAbilityNoPerm::onStart"); + HILOG_INFO("FormAbilityNoPerm::onStart"); Ability::OnStart(want); std::vector eventList = { @@ -97,7 +97,7 @@ void FormAbilityNoPerm::OnStart(const Want &want) } void FormAbilityNoPerm::OnActive() { - APP_LOGI("FormAbilityNoPerm::OnActive"); + HILOG_INFO("FormAbilityNoPerm::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + FORM_ABILITY_STATE_ONACTIVE; FormTestUtils::PublishEvent(FORM_EVENT_ABILITY_ONACTIVED, 0, eventData); @@ -105,19 +105,19 @@ void FormAbilityNoPerm::OnActive() void FormAbilityNoPerm::OnStop() { - APP_LOGI("FormAbilityNoPerm::OnStop"); + HILOG_INFO("FormAbilityNoPerm::OnStop"); Ability::OnStop(); } void FormAbilityNoPerm::OnInactive() { - APP_LOGI("FormAbilityNoPerm::OnInactive"); + HILOG_INFO("FormAbilityNoPerm::OnInactive"); Ability::OnInactive(); } void FormAbilityNoPerm::OnBackground() { - APP_LOGI("FormAbilityNoPerm::OnBackground"); + HILOG_INFO("FormAbilityNoPerm::OnBackground"); Ability::OnBackground(); } @@ -139,7 +139,7 @@ void FormAbilityNoPerm::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("FormAbilityNoPerm::Init"); + HILOG_INFO("FormAbilityNoPerm::Init"); Ability::Init(abilityInfo, application, handler, token); memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_0200] = &FormAbilityNoPerm::FMS_acquireForm_0200; @@ -164,8 +164,8 @@ void FormAbilityNoPerm::Clear() void FormEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FormEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("FormEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FormEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("FormEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); ability_->handleEvent(eventName); } diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/BUILD.gn b/test/resource/formsystemtestability/fmsSystemTestHostNormal/BUILD.gn index eefe656dec..d6aff4c035 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/BUILD.gn +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/BUILD.gn @@ -23,6 +23,7 @@ config("fmsSystemTestHostNormalConfig") { "${aafwk_path}/interfaces/innerkits/uri/include", "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${aafwk_path}/frameworks/kits/appkit/native/app", @@ -33,8 +34,8 @@ config("fmsSystemTestHostNormalConfig") { "//foundation/distributedschedule/safwk/services/safwk/include", ] defines = [ - "APP_LOG_TAG = \"formManagerSystemTest\"", - "LOG_DOMAIN = 0xD002666", + "AMS_LOG_TAG = \"formManagerSystemTest\"", + "AMS_LOG_DOMAIN = 0xD002666", ] } ohos_shared_library("fmsSystemTestHostNormal") { diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp index c4349e0cb5..dc5b9b0ce3 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_a.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "form_ability_a.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "form_st_common_info.h" #include "form_test_utils.h" #include "system_test_form_util.h" @@ -41,12 +41,12 @@ std::vector eventList = { }; void FormAbilityA::AcquireFormCallback::OnAcquired(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); FormTestUtils::PublishEvent(this->caseName_, this->code_, std::to_string(formJsInfo.formId)); } void FormAbilityA::AcquireFormCallback::OnUpdate(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); FormTestUtils::PublishEvent(this->caseName_, this->code_ + 1, formJsInfo.formData); if (this->caseName_ == FORM_EVENT_RECV_ACQUIRE_FORM_1200 @@ -56,20 +56,20 @@ void FormAbilityA::AcquireFormCallback::OnUpdate(const int32_t result, const For || this->caseName_ == FORM_EVENT_RECV_ACQUIRE_FORM_1800_1 || this->caseName_ == FORM_EVENT_RECV_ACQUIRE_FORM_1900) { std::string strFormId = std::to_string(formJsInfo.formId); - APP_LOGI("%{public}s, delete form, formId: %{public}s", __func__, strFormId.c_str()); + HILOG_INFO("%{public}s, delete form, formId: %{public}s", __func__, strFormId.c_str()); ability_->FMS_deleteFormCommon(strFormId); } } void FormAbilityA::AcquireFormCallback::OnFormUninstall(const int64_t formId) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } void FormAbilityA::FMS_deleteFormCommon(std::string strFormId) { - APP_LOGI("%{public}s called, formId: %{public}s", __func__, strFormId.c_str()); + HILOG_INFO("%{public}s called, formId: %{public}s", __func__, strFormId.c_str()); if (strFormId.empty()) { - APP_LOGE("DeleteForm error, formId is 0"); + HILOG_ERROR("DeleteForm error, formId is 0"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999, "false"); return; } @@ -78,17 +78,17 @@ void FormAbilityA::FMS_deleteFormCommon(std::string strFormId) bool bResult = DeleteForm(formId); sleep(1); if (bResult) { - APP_LOGI("DeleteForm end"); + HILOG_INFO("DeleteForm end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999, "true"); } else { - APP_LOGE("DeleteForm error"); + HILOG_ERROR("DeleteForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999, "false"); } } void FormAbilityA::FMS_acquireForm_0300(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_0300, EVENT_CODE_300); // Set Want info begin @@ -101,15 +101,15 @@ void FormAbilityA::FMS_acquireForm_0300(std::string data) // Set Want info end bool bResult = AcquireForm(-1, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0300, EVENT_CODE_300, "false"); } } void FormAbilityA::FMS_acquireForm_0400(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_0400, EVENT_CODE_400); // Set Want info begin @@ -122,15 +122,15 @@ void FormAbilityA::FMS_acquireForm_0400(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0400, EVENT_CODE_400, "false"); } } void FormAbilityA::FMS_acquireForm_0500(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_0500, EVENT_CODE_500); // Set Want info begin @@ -144,15 +144,15 @@ void FormAbilityA::FMS_acquireForm_0500(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0500, EVENT_CODE_500, "false"); } } void FormAbilityA::FMS_acquireForm_0600(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_0600, EVENT_CODE_600); // Set Want info begin @@ -166,15 +166,15 @@ void FormAbilityA::FMS_acquireForm_0600(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0600, EVENT_CODE_600, "false"); } } void FormAbilityA::FMS_acquireForm_0700(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_0700, EVENT_CODE_700); // Set Want info begin @@ -187,15 +187,15 @@ void FormAbilityA::FMS_acquireForm_0700(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0700, EVENT_CODE_700, "false"); } } void FormAbilityA::FMS_acquireForm_1000(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_1000, EVENT_CODE_1000); // Set Want info begin @@ -208,15 +208,15 @@ void FormAbilityA::FMS_acquireForm_1000(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1000, EVENT_CODE_1000, "false"); } } void FormAbilityA::FMS_acquireForm_1100(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_1100, EVENT_CODE_1100); callback->ability_ = this; @@ -230,15 +230,15 @@ void FormAbilityA::FMS_acquireForm_1100(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1100, EVENT_CODE_1100, ""); } } void FormAbilityA::FMS_acquireForm_1200(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_1200, EVENT_CODE_1200); callback->ability_ = this; @@ -252,16 +252,16 @@ void FormAbilityA::FMS_acquireForm_1200(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1200, EVENT_CODE_1200, ""); } } void FormAbilityA::FMS_acquireForm_1500_1(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_1500_1, EVENT_CODE_1510); callback->ability_ = this; @@ -275,16 +275,16 @@ void FormAbilityA::FMS_acquireForm_1500_1(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1500_1, EVENT_CODE_1510, ""); } } void FormAbilityA::FMS_acquireForm_1600(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_1600, EVENT_CODE_1600); callback->ability_ = this; @@ -298,15 +298,15 @@ void FormAbilityA::FMS_acquireForm_1600(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1600, EVENT_CODE_1600, ""); } } void FormAbilityA::FMS_acquireForm_1600_1(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_1600_1, EVENT_CODE_1610); callback->ability_ = this; @@ -320,15 +320,15 @@ void FormAbilityA::FMS_acquireForm_1600_1(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1600_1, EVENT_CODE_1610, ""); } } void FormAbilityA::FMS_acquireForm_1800(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_1800, EVENT_CODE_1800); callback->ability_ = this; @@ -342,15 +342,15 @@ void FormAbilityA::FMS_acquireForm_1800(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1800, EVENT_CODE_1800, ""); } } void FormAbilityA::FMS_acquireForm_1800_1(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_1800_1, EVENT_CODE_1810); callback->ability_ = this; @@ -364,15 +364,15 @@ void FormAbilityA::FMS_acquireForm_1800_1(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1800_1, EVENT_CODE_1810, ""); } } void FormAbilityA::FMS_acquireForm_1900(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_1900, EVENT_CODE_1900); callback->ability_ = this; @@ -386,15 +386,15 @@ void FormAbilityA::FMS_acquireForm_1900(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1900, EVENT_CODE_1900, ""); } } void FormAbilityA::FMS_acquireForm_2100(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_2100, EVENT_CODE_2100); callback->ability_ = this; @@ -409,45 +409,45 @@ void FormAbilityA::FMS_acquireForm_2100(std::string data) // Set Want info end bool bResult = AcquireForm(formId, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2100, EVENT_CODE_2100, "false"); } } void FormAbilityA::FMS_acquireForm_2200(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_2200, EVENT_CODE_2200); // Set Want info end bool bResult = CastTempForm(-1); if (bResult) { - APP_LOGI("CastTempForm end"); + HILOG_INFO("CastTempForm end"); } else { - APP_LOGE("CastTempForm error"); + HILOG_ERROR("CastTempForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2200, EVENT_CODE_2200, "false"); } } void FormAbilityA::FMS_acquireForm_2300(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_2300, EVENT_CODE_2300); // Set Want info end bool bResult = CastTempForm(0); if (bResult) { - APP_LOGI("CastTempForm end"); + HILOG_INFO("CastTempForm end"); } else { - APP_LOGE("CastTempForm error"); + HILOG_ERROR("CastTempForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2300, EVENT_CODE_2300, "false"); } } void FormAbilityA::FMS_acquireForm_2400(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_2400, EVENT_CODE_2400); callback->ability_ = this; @@ -461,31 +461,31 @@ void FormAbilityA::FMS_acquireForm_2400(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2400, EVENT_CODE_2400, ""); } } void FormAbilityA::FMS_acquireForm_2500(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_2500, EVENT_CODE_2500); // Set Want info end bool bResult = CastTempForm(EVENT_CODE_1234); if (bResult) { - APP_LOGI("CastTempForm end"); + HILOG_INFO("CastTempForm end"); } else { - APP_LOGE("CastTempForm error"); + HILOG_ERROR("CastTempForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2500, EVENT_CODE_2500, "false"); } } void FormAbilityA::FMS_acquireForm_2600_1(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_2600_1, EVENT_CODE_2610); @@ -499,16 +499,16 @@ void FormAbilityA::FMS_acquireForm_2600_1(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2600_1, EVENT_CODE_2610, ""); } } void FormAbilityA::FMS_acquireForm_2600(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_2600, EVENT_CODE_2600); callback->ability_ = this; @@ -516,10 +516,10 @@ void FormAbilityA::FMS_acquireForm_2600(std::string data) int64_t formId = std::stoll(data); bool bResult = CastTempForm(formId); if (bResult) { - APP_LOGI("CastTempForm end"); + HILOG_INFO("CastTempForm end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2600, EVENT_CODE_2600, "true"); } else { - APP_LOGE("CastTempForm error"); + HILOG_ERROR("CastTempForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2600, EVENT_CODE_2600, "false"); } @@ -528,7 +528,7 @@ void FormAbilityA::FMS_acquireForm_2600(std::string data) void FormAbilityA::FMS_acquireForm_2700(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_2700, EVENT_CODE_2700); @@ -536,9 +536,9 @@ void FormAbilityA::FMS_acquireForm_2700(std::string data) int64_t formId = std::stoll(data); bool bResult = CastTempForm(formId); if (bResult) { - APP_LOGI("CastTempForm end"); + HILOG_INFO("CastTempForm end"); } else { - APP_LOGE("CastTempForm error"); + HILOG_ERROR("CastTempForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2700, EVENT_CODE_2700, "false"); } @@ -546,7 +546,7 @@ void FormAbilityA::FMS_acquireForm_2700(std::string data) } void FormAbilityA::FMS_acquireForm_2800(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_2800, EVENT_CODE_2800); @@ -554,9 +554,9 @@ void FormAbilityA::FMS_acquireForm_2800(std::string data) int64_t formId = std::stoll(data); bool bResult = CastTempForm(formId); if (bResult) { - APP_LOGI("CastTempForm end"); + HILOG_INFO("CastTempForm end"); } else { - APP_LOGE("CastTempForm error"); + HILOG_ERROR("CastTempForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2800, EVENT_CODE_2800, "false"); } @@ -564,7 +564,7 @@ void FormAbilityA::FMS_acquireForm_2800(std::string data) } void FormAbilityA::FMS_acquireForm_2900(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_2900, EVENT_CODE_2900); callback->ability_ = this; @@ -578,16 +578,16 @@ void FormAbilityA::FMS_acquireForm_2900(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2900, EVENT_CODE_2900, ""); } } void FormAbilityA::FMS_acquireForm_2900_1(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_2900_1, EVENT_CODE_2910); callback->ability_ = this; @@ -601,15 +601,15 @@ void FormAbilityA::FMS_acquireForm_2900_1(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2900_1, EVENT_CODE_2910, ""); } } void FormAbilityA::FMS_acquireForm_3000(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_3000, EVENT_CODE_3000); // Set Want info begin @@ -622,15 +622,15 @@ void FormAbilityA::FMS_acquireForm_3000(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3000, EVENT_CODE_3000, "false"); } } void FormAbilityA::FMS_acquireForm_3100(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3100); callback->ability_ = this; @@ -644,9 +644,9 @@ void FormAbilityA::FMS_acquireForm_3100(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3100, ""); } } @@ -663,7 +663,7 @@ void FormAbilityA::FMS_acquireForm_3500(std::string data) void FormAbilityA::FMS_acquireForm_tempForm(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_TEMP, EVENT_CODE_TEMP); @@ -677,15 +677,15 @@ void FormAbilityA::FMS_acquireForm_tempForm(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_TEMP, EVENT_CODE_TEMP, ""); } } void FormAbilityA::FMS_acquireFormBatch(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); @@ -695,22 +695,22 @@ void FormAbilityA::FMS_acquireFormBatch(std::string data) want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); - APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); + HILOG_INFO("%{public}s, formCount: %{public}d", __func__, formCount); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, formCount); // Set Want info end int result = STtools::SystemTestFormUtil::BatchAddFormRecords(want); if (result == ERR_OK) { - APP_LOGI("Batch add form end"); + HILOG_INFO("Batch add form end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_BATCH, EVENT_CODE_BATCH, "true"); } else { - APP_LOGE("Batch add form error"); + HILOG_ERROR("Batch add form error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_BATCH, EVENT_CODE_BATCH, "false"); } } void FormAbilityA::FMS_acquireFormBatchB(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); @@ -720,21 +720,21 @@ void FormAbilityA::FMS_acquireFormBatchB(std::string data) want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); int formCount = std::stoi(data); - APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); + HILOG_INFO("%{public}s, formCount: %{public}d", __func__, formCount); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, formCount); // Set Want info end int result = STtools::SystemTestFormUtil::BatchAddFormRecords(want); if (result == ERR_OK) { - APP_LOGI("Batch add form end"); + HILOG_INFO("Batch add form end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_BATCH_B, EVENT_CODE_BATCH_B, "true"); } else { - APP_LOGE("Batch add form error"); + HILOG_ERROR("Batch add form error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_BATCH_B, EVENT_CODE_BATCH_B, "false"); } } void FormAbilityA::FMS_acquireFormTempBatch(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); @@ -745,27 +745,27 @@ void FormAbilityA::FMS_acquireFormTempBatch(std::string data) want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); - APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); + HILOG_INFO("%{public}s, formCount: %{public}d", __func__, formCount); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, formCount); // Set Want info end int result = STtools::SystemTestFormUtil::BatchAddFormRecords(want); if (result == ERR_OK) { - APP_LOGI("Batch add temp form end"); + HILOG_INFO("Batch add temp form end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_TEMP_FORM_BATCH, EVENT_CODE_TEMP_BATCH, "true"); } else { - APP_LOGE("Batch add temp form error"); + HILOG_ERROR("Batch add temp form error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_TEMP_FORM_BATCH, EVENT_CODE_TEMP_BATCH, "false"); } } void FormAbilityA::FMS_deleteFormBatch(std::string strFormId) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); int result = STtools::SystemTestFormUtil::ClearFormRecords(); if (result == ERR_OK) { - APP_LOGI("Clear form records end"); + HILOG_INFO("Clear form records end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_CLEAR_FORM_BATCH, EVENT_CODE_CLEAR_BATCH, "true"); } else { - APP_LOGE("Clear form records error"); + HILOG_ERROR("Clear form records error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_CLEAR_FORM_BATCH, EVENT_CODE_CLEAR_BATCH, "false"); } } @@ -775,12 +775,12 @@ FormAbilityA::~FormAbilityA() } void FormAbilityA::OnStart(const Want &want) { - APP_LOGI("FormAbilityA::onStart"); + HILOG_INFO("FormAbilityA::onStart"); Ability::OnStart(want); } void FormAbilityA::OnActive() { - APP_LOGI("FormAbilityA::OnActive"); + HILOG_INFO("FormAbilityA::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + FORM_ABILITY_STATE_ONACTIVE; FormTestUtils::PublishEvent(FORM_EVENT_ABILITY_ONACTIVED, 0, eventData); @@ -788,25 +788,25 @@ void FormAbilityA::OnActive() void FormAbilityA::OnStop() { - APP_LOGI("FormAbilityA::OnStop"); + HILOG_INFO("FormAbilityA::OnStop"); Ability::OnStop(); } void FormAbilityA::OnInactive() { - APP_LOGI("FormAbilityA::OnInactive"); + HILOG_INFO("FormAbilityA::OnInactive"); Ability::OnInactive(); } void FormAbilityA::OnBackground() { - APP_LOGI("FormAbilityA::OnBackground"); + HILOG_INFO("FormAbilityA::OnBackground"); Ability::OnBackground(); } void FormAbilityA::SubscribeEvent() { - APP_LOGI("FormAbilityA::SubscribeEvent"); + HILOG_INFO("FormAbilityA::SubscribeEvent"); MatchingSkills matchingSkills; for (const auto &e : eventList) { matchingSkills.AddEvent(e); @@ -823,7 +823,7 @@ void FormAbilityA::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("FormAbilityA::Init"); + HILOG_INFO("FormAbilityA::Init"); Ability::Init(abilityInfo, application, handler, token); memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_0300] = &FormAbilityA::FMS_acquireForm_0300; memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_0400] = &FormAbilityA::FMS_acquireForm_0400; @@ -863,7 +863,7 @@ void FormAbilityA::Init(const std::shared_ptr &abilityInfo, void FormAbilityA::handleEvent(std::string action, std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); if (calledFuncMap_.find(action) != calledFuncMap_.end()) { return; } @@ -883,9 +883,9 @@ void FormAbilityA::Clear() void FormEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FormEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("FormEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FormEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("FormEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); ability_->handleEvent(eventName, data.GetData()); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp index f50e5b4f7b..1f8de799d4 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_deleteform.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "form_ability_deleteform.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "form_st_common_info.h" #include "form_test_utils.h" #include "system_test_form_util.h" @@ -27,16 +27,16 @@ namespace OHOS { namespace AppExecFwk { void FormAbilityDeleteForm::AcquireFormCallback::OnAcquired(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); - APP_LOGI("%{public}s receive formId:%{public}s", __func__, std::to_string(formJsInfo.formId).c_str()); + HILOG_INFO("%{public}s called", __func__); + HILOG_INFO("%{public}s receive formId:%{public}s", __func__, std::to_string(formJsInfo.formId).c_str()); if (this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_0600) { ability_->FMS_deleteForm_common(formJsInfo.formId, this->caseName_); } } void FormAbilityDeleteForm::AcquireFormCallback::OnUpdate(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); - APP_LOGI("%{public}s receive formData:%{public}s", __func__, formJsInfo.formData.c_str()); + HILOG_INFO("%{public}s called", __func__); + HILOG_INFO("%{public}s receive formData:%{public}s", __func__, formJsInfo.formData.c_str()); if (this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_0300 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_0400 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_0700 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_0800 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_0900 || this->caseName_ == FORM_EVENT_RECV_DELETE_FORM_1000 @@ -51,12 +51,12 @@ void FormAbilityDeleteForm::AcquireFormCallback::OnUpdate(const int32_t result, void FormAbilityDeleteForm::AcquireFormCallback::OnFormUninstall(const int64_t formId) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } void FormAbilityDeleteForm::FMS_deleteForm_common(int64_t formId, std::string caseName) { - APP_LOGI("%{public}s called, formId: %{public}s, caseName:%{public}s", + HILOG_INFO("%{public}s called, formId: %{public}s, caseName:%{public}s", __func__, std::to_string(formId).c_str(), caseName.c_str()); if (caseName == FORM_EVENT_RECV_DELETE_FORM_0300) { DeleteForm_0300(formId); @@ -110,9 +110,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_0300(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0300, EVENT_CODE_300, ""); } } @@ -131,29 +131,29 @@ void FormAbilityDeleteForm::FMS_deleteForm_0400(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0400, EVENT_CODE_400, ""); } } void FormAbilityDeleteForm::FMS_deleteForm_0500(std::string data) { - APP_LOGI("%{public}s start[%{public}s]", __func__, data.c_str()); + HILOG_INFO("%{public}s start[%{public}s]", __func__, data.c_str()); bool bResult = DeleteForm(atoll(data.c_str())); if (bResult) { - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0500, EVENT_CODE_500, "true"); } else { - APP_LOGE("%{public}s error", __func__); + HILOG_ERROR("%{public}s error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0500, EVENT_CODE_500, "false"); } } void FormAbilityDeleteForm::FMS_deleteForm_0600(std::string data) { - APP_LOGI("%{public}s start[%{public}s]", __func__, data.c_str()); + HILOG_INFO("%{public}s start[%{public}s]", __func__, data.c_str()); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_DELETE_FORM_0600); callback->ability_ = this; @@ -167,9 +167,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_0600(std::string data) // Set Want info end bool bResult = AcquireForm(atoll(data.c_str()), want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_600, ""); } } @@ -189,9 +189,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_0700(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_700, ""); } } @@ -211,9 +211,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_0800(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_800, ""); } } @@ -232,9 +232,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_0900(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_900, ""); } } @@ -254,9 +254,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_1000(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1000, ""); } } @@ -276,9 +276,9 @@ void FormAbilityDeleteForm::FMS_deleteForm_1100(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1100, ""); } } @@ -302,22 +302,22 @@ void FormAbilityDeleteForm::FMS_deleteForm_1200(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1200, EVENT_CODE_1200, ""); } } void FormAbilityDeleteForm::FMS_deleteForm_1201(std::string data) { - APP_LOGI("%{public}s formId: %{public}s", __func__, data.c_str()); + HILOG_INFO("%{public}s formId: %{public}s", __func__, data.c_str()); bool bResult = DeleteForm(atoll(data.c_str())); if (bResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1201, EVENT_CODE_1201, "true"); } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1201, EVENT_CODE_1201, "false"); } } @@ -341,21 +341,21 @@ void FormAbilityDeleteForm::FMS_deleteForm_1400(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1400, EVENT_CODE_1400, ""); } } void FormAbilityDeleteForm::FMS_deleteForm_1401(std::string data) { - APP_LOGI("%{public}s formId: %{public}s", __func__, data.c_str()); + HILOG_INFO("%{public}s formId: %{public}s", __func__, data.c_str()); bool bResult = DeleteForm(atoll(data.c_str())); if (bResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1401, EVENT_CODE_1401, "true"); } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1401, EVENT_CODE_1401, "false"); } } @@ -375,19 +375,19 @@ void FormAbilityDeleteForm::FMS_deleteForm_1500(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1500, EVENT_CODE_1500, ""); } } void FormAbilityDeleteForm::FMS_deleteForm_1501(std::string data) { - APP_LOGI("%{public}s formId: %{public}s", __func__, data.c_str()); + HILOG_INFO("%{public}s formId: %{public}s", __func__, data.c_str()); bool bResult = DeleteForm(atoll(data.c_str())); if (bResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1501); callback->ability_ = this; @@ -401,25 +401,25 @@ void FormAbilityDeleteForm::FMS_deleteForm_1501(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1501, EVENT_CODE_1510, "acquireError"); } } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1501, EVENT_CODE_1510, "deleteError"); } } void FormAbilityDeleteForm::FMS_deleteForm_1502(std::string data) { - APP_LOGI("%{public}s formId: %{public}s", __func__, data.c_str()); + HILOG_INFO("%{public}s formId: %{public}s", __func__, data.c_str()); bool bResult = DeleteForm(atoll(data.c_str())); if (bResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1502, EVENT_CODE_1511, "true"); } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1502, EVENT_CODE_1511, "false"); } } @@ -438,18 +438,18 @@ void FormAbilityDeleteForm::FMS_deleteForm_1600(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1600, EVENT_CODE_1600, ""); } } void FormAbilityDeleteForm::FMS_deleteForm_1601(std::string data) { - APP_LOGI("%{public}s formId: %{public}s", __func__, data.c_str()); + HILOG_INFO("%{public}s formId: %{public}s", __func__, data.c_str()); bool bResult = DeleteForm(atoll(data.c_str())); if (bResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1601); callback->ability_ = this; @@ -463,25 +463,25 @@ void FormAbilityDeleteForm::FMS_deleteForm_1601(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1601, EVENT_CODE_1610, "acquireError"); } } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1601, EVENT_CODE_1610, "deleteError"); } } void FormAbilityDeleteForm::FMS_deleteForm_1602(std::string data) { - APP_LOGI("%{public}s formId: %{public}s", __func__, data.c_str()); + HILOG_INFO("%{public}s formId: %{public}s", __func__, data.c_str()); bool bResult = DeleteForm(atoll(data.c_str())); if (bResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1602, EVENT_CODE_1611, "true"); } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1602, EVENT_CODE_1611, "false"); } } @@ -501,19 +501,19 @@ void FormAbilityDeleteForm::FMS_deleteForm_1700(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1700, EVENT_CODE_1700, ""); } } void FormAbilityDeleteForm::FMS_deleteForm_1701(std::string data) { - APP_LOGI("%{public}s formId: %{public}s", __func__, data.c_str()); + HILOG_INFO("%{public}s formId: %{public}s", __func__, data.c_str()); bool bResult = DeleteForm(atoll(data.c_str())); if (bResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_DELETE_FORM_1701); callback->ability_ = this; @@ -527,31 +527,31 @@ void FormAbilityDeleteForm::FMS_deleteForm_1701(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1701, EVENT_CODE_1701, "acquireError"); } } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1701, EVENT_CODE_1701, "deleteError"); } } void FormAbilityDeleteForm::FMS_deleteForm_1702(std::string data) { - APP_LOGI("%{public}s formId: %{public}s", __func__, data.c_str()); + HILOG_INFO("%{public}s formId: %{public}s", __func__, data.c_str()); bool bResult = DeleteForm(atoll(data.c_str())); if (bResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1702, EVENT_CODE_1702, "true"); } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1702, EVENT_CODE_1702, "false"); } } void FormAbilityDeleteForm::FMS_acquire_tempForm_batch(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); @@ -561,21 +561,21 @@ void FormAbilityDeleteForm::FMS_acquire_tempForm_batch(std::string data) want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); - APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); + HILOG_INFO("%{public}s, formCount: %{public}d", __func__, formCount); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, formCount); // Set Want info end int result = STtools::SystemTestFormUtil::BatchAddFormRecords(want); if (result == ERR_OK) { - APP_LOGI("Batch add form end"); + HILOG_INFO("Batch add form end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_TEMP_FORM_BATCH, EVENT_CODE_TEMP_BATCH, "true"); } else { - APP_LOGE("Batch add form error"); + HILOG_ERROR("Batch add form error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_TEMP_FORM_BATCH, EVENT_CODE_TEMP_BATCH, "false"); } } void FormAbilityDeleteForm::FMS_acquireForm_batch(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); @@ -585,27 +585,27 @@ void FormAbilityDeleteForm::FMS_acquireForm_batch(std::string data) want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); - APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); + HILOG_INFO("%{public}s, formCount: %{public}d", __func__, formCount); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, formCount); // Set Want info end int result = STtools::SystemTestFormUtil::BatchAddFormRecords(want); if (result == ERR_OK) { - APP_LOGI("Batch add form end"); + HILOG_INFO("Batch add form end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_BATCH, EVENT_CODE_BATCH, "true"); } else { - APP_LOGE("Batch add form error"); + HILOG_ERROR("Batch add form error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_BATCH, EVENT_CODE_BATCH, "false"); } } void FormAbilityDeleteForm::FMS_deleteFormBatch(std::string strFormId) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); int result = STtools::SystemTestFormUtil::ClearFormRecords(); if (result == ERR_OK) { - APP_LOGI("Clear form records end"); + HILOG_INFO("Clear form records end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_CLEAR_FORM_BATCH, EVENT_CODE_CLEAR_BATCH, "true"); } else { - APP_LOGE("Clear form records error"); + HILOG_ERROR("Clear form records error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_CLEAR_FORM_BATCH, EVENT_CODE_CLEAR_BATCH, "false"); } } @@ -615,10 +615,10 @@ void FormAbilityDeleteForm::DeleteForm_0300(int64_t form_id) bool bResult = DeleteForm(-1); Clear("FMS_deleteForm_0300", form_id); if (bResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0300, EVENT_CODE_300, "true"); } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0300, EVENT_CODE_300, "false"); } } @@ -628,10 +628,10 @@ void FormAbilityDeleteForm::DeleteForm_0400(int64_t form_id) bool bResult = DeleteForm(0); Clear("FMS_deleteForm_0400", form_id); if (bResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0400, EVENT_CODE_400, "true"); } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0400, EVENT_CODE_400, "false"); } } @@ -643,10 +643,10 @@ void FormAbilityDeleteForm::DeleteForm_0600(int64_t form_id) { bool bResult = DeleteForm(form_id); if (bResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_600, "true"); } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0600, EVENT_CODE_600, "false"); } } @@ -655,10 +655,10 @@ void FormAbilityDeleteForm::DeleteForm_0700(int64_t form_id) { bool bResult = DeleteForm(form_id); if (bResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_700, std::to_string(form_id)); } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0700, EVENT_CODE_700, "false"); } } @@ -667,10 +667,10 @@ void FormAbilityDeleteForm::DeleteForm_0800(int64_t form_id) { bool bResult = DeleteForm(form_id); if (bResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_800, std::to_string(form_id)); } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0800, EVENT_CODE_800, "false"); } } @@ -679,17 +679,17 @@ void FormAbilityDeleteForm::DeleteForm_0900(int64_t form_id) { bool bResult = DeleteForm(form_id); if (bResult) { - APP_LOGI("%{public}s DeleteForm1 end", __func__); + HILOG_INFO("%{public}s DeleteForm1 end", __func__); bool realResult = DeleteForm(form_id); if (realResult) { - APP_LOGI("%{public}s DeleteForm2 end", __func__); + HILOG_INFO("%{public}s DeleteForm2 end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_900, "true"); } else { - APP_LOGE("%{public}s DeleteForm2 error", __func__); + HILOG_ERROR("%{public}s DeleteForm2 error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_900, "false"); } } else { - APP_LOGE("%{public}s DeleteForm1 error", __func__); + HILOG_ERROR("%{public}s DeleteForm1 error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0900, EVENT_CODE_900, ""); } } @@ -698,17 +698,17 @@ void FormAbilityDeleteForm::DeleteForm_1000(int64_t form_id) { bool bResult = ReleaseForm(form_id); if (bResult) { - APP_LOGI("%{public}s ReleaseForm end", __func__); + HILOG_INFO("%{public}s ReleaseForm end", __func__); bool realResult = DeleteForm(form_id); if (realResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1000, "true"); } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1000, "false"); } } else { - APP_LOGE("%{public}s ReleaseForm error", __func__); + HILOG_ERROR("%{public}s ReleaseForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1000, EVENT_CODE_1000, ""); } } @@ -716,10 +716,10 @@ void FormAbilityDeleteForm::DeleteForm_1100(int64_t form_id) { bool bResult = DeleteForm(form_id); if (bResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1100, std::to_string(form_id)); } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_1100, EVENT_CODE_1100, "false"); } } @@ -757,7 +757,7 @@ void FormAbilityDeleteForm::DeleteForm_1701(int64_t form_id) } void FormAbilityDeleteForm::OnStart(const Want &want) { - APP_LOGI("FormAbilityDeleteForm::onStart"); + HILOG_INFO("FormAbilityDeleteForm::onStart"); Ability::OnStart(want); std::vector eventList = { @@ -791,7 +791,7 @@ void FormAbilityDeleteForm::OnStart(const Want &want) } void FormAbilityDeleteForm::OnActive() { - APP_LOGI("FormAbilityDeleteForm::OnActive"); + HILOG_INFO("FormAbilityDeleteForm::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + FORM_ABILITY_STATE_ONACTIVE; FormTestUtils::PublishEvent(FORM_EVENT_ABILITY_ONACTIVED, 0, eventData); @@ -799,19 +799,19 @@ void FormAbilityDeleteForm::OnActive() void FormAbilityDeleteForm::OnStop() { - APP_LOGI("FormAbilityDeleteForm::OnStop"); + HILOG_INFO("FormAbilityDeleteForm::OnStop"); Ability::OnStop(); } void FormAbilityDeleteForm::OnInactive() { - APP_LOGI("FormAbilityDeleteForm::OnInactive"); + HILOG_INFO("FormAbilityDeleteForm::OnInactive"); Ability::OnInactive(); } void FormAbilityDeleteForm::OnBackground() { - APP_LOGI("FormAbilityDeleteForm::OnBackground"); + HILOG_INFO("FormAbilityDeleteForm::OnBackground"); Ability::OnBackground(); } @@ -833,7 +833,7 @@ void FormAbilityDeleteForm::Init(const std::shared_ptr &abilityInfo const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("FormAbilityDeleteForm::Init"); + HILOG_INFO("FormAbilityDeleteForm::Init"); Ability::Init(abilityInfo, application, handler, token); memberFuncMap_[FORM_EVENT_REQ_DELETE_FORM_0300] = &FormAbilityDeleteForm::FMS_deleteForm_0300; memberFuncMap_[FORM_EVENT_REQ_DELETE_FORM_0400] = &FormAbilityDeleteForm::FMS_deleteForm_0400; @@ -864,7 +864,7 @@ void FormAbilityDeleteForm::Init(const std::shared_ptr &abilityInfo void FormAbilityDeleteForm::handleEvent(std::string action, std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); auto itFunc = memberFuncMap_.find(action); if (itFunc != memberFuncMap_.end()) { auto memberFunc = itFunc->second; @@ -878,16 +878,16 @@ void FormAbilityDeleteForm::Clear(std::string case_id, int64_t form_id) { bool bResult = DeleteForm(form_id); if (bResult) { - APP_LOGI("[%{public}s] clear ok", case_id.c_str()); + HILOG_INFO("[%{public}s] clear ok", case_id.c_str()); } else { - APP_LOGE("[%{public}s] clear error", case_id.c_str()); + HILOG_ERROR("[%{public}s] clear error", case_id.c_str()); } } void FormEventSubscriberForDeleteForm::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FormEventSubscriberForDeleteForm::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("FormEventSubscriberForDeleteForm::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FormEventSubscriberForDeleteForm::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("FormEventSubscriberForDeleteForm::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); ability_->handleEvent(eventName, data.GetData()); CommonEventManager::UnSubscribeCommonEvent(ability_->subscriber_); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp index 1d2cdb7044..5361faddac 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormal/src/form_ability_releaseform.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "form_ability_releaseform.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "form_st_common_info.h" #include "form_test_utils.h" @@ -26,16 +26,16 @@ namespace OHOS { namespace AppExecFwk { void FormAbilityReleaseForm::AcquireFormCallback::OnAcquired(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); - APP_LOGI("%{public}s receive formId:%{public}s", __func__, std::to_string(formJsInfo.formId).c_str()); + HILOG_INFO("%{public}s called", __func__); + HILOG_INFO("%{public}s receive formId:%{public}s", __func__, std::to_string(formJsInfo.formId).c_str()); if (this->caseName_ == FORM_EVENT_RECV_RELEASE_FORM_0700 || this->caseName_ == FORM_EVENT_RECV_RELEASE_FORM_1000) { ability_->FMS_releaseForm_common(formJsInfo.formId, this->caseName_, this->lastformId_); } } void FormAbilityReleaseForm::AcquireFormCallback::OnUpdate(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); - APP_LOGI("%{public}s receive formData:%{public}s", __func__, formJsInfo.formData.c_str()); + HILOG_INFO("%{public}s called", __func__); + HILOG_INFO("%{public}s receive formData:%{public}s", __func__, formJsInfo.formData.c_str()); if (this->caseName_ == FORM_EVENT_RECV_RELEASE_FORM_0300 || this->caseName_ == FORM_EVENT_RECV_RELEASE_FORM_0400 || this->caseName_ == FORM_EVENT_RECV_RELEASE_FORM_0600 || this->caseName_ == FORM_EVENT_RECV_RELEASE_FORM_0800 || this->caseName_ == FORM_EVENT_RECV_RELEASE_FORM_0900 || this->caseName_ == FORM_EVENT_RECV_RELEASE_FORM_1100 @@ -47,12 +47,12 @@ void FormAbilityReleaseForm::AcquireFormCallback::OnUpdate(const int32_t result, void FormAbilityReleaseForm::AcquireFormCallback::OnFormUninstall(const int64_t formId) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } void FormAbilityReleaseForm::FMS_releaseForm_common(int64_t formId, std::string caseName, std::string lastFormId) { - APP_LOGI("%{public}s called, formId: %{public}s, caseName:%{public}s, lastFormId:%{public}s", + HILOG_INFO("%{public}s called, formId: %{public}s, caseName:%{public}s, lastFormId:%{public}s", __func__, std::to_string(formId).c_str(), caseName.c_str(), lastFormId.c_str()); if (caseName == FORM_EVENT_RECV_RELEASE_FORM_0300) { ReleaseForm_0300(formId); @@ -96,9 +96,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_0300(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0300, EVENT_CODE_300, ""); } } @@ -117,22 +117,22 @@ void FormAbilityReleaseForm::FMS_releaseForm_0400(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0400, EVENT_CODE_400, ""); } } void FormAbilityReleaseForm::FMS_releaseForm_0500(std::string data) { - APP_LOGI("%{public}s start[%{public}s]", __func__, data.c_str()); + HILOG_INFO("%{public}s start[%{public}s]", __func__, data.c_str()); bool bResult = ReleaseForm(atoll(data.c_str()), true); if (bResult) { - APP_LOGI("%{public}s end", __func__); + HILOG_INFO("%{public}s end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0500, EVENT_CODE_500, "true"); } else { - APP_LOGE("%{public}s error", __func__); + HILOG_ERROR("%{public}s error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0500, EVENT_CODE_500, "false"); } } @@ -152,9 +152,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_0600(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0600, EVENT_CODE_600, ""); } } @@ -174,9 +174,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_0700(std::string data) // Set Want info end bool bResult = AcquireForm(atoll(data.c_str()), want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0700, EVENT_CODE_700, ""); } } @@ -196,9 +196,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_0800(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_800, ""); } } @@ -217,9 +217,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_0900(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0900, EVENT_CODE_900, ""); } } @@ -239,9 +239,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_1000(std::string data) // Set Want info end bool bResult = AcquireForm(atoll(data.c_str()), want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1000, ""); } } @@ -261,9 +261,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_1100(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1100, ""); } } @@ -283,9 +283,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_1200(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1200, EVENT_CODE_1200, ""); } } @@ -305,9 +305,9 @@ void FormAbilityReleaseForm::FMS_releaseForm_1300(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300, ""); } } @@ -327,21 +327,21 @@ void FormAbilityReleaseForm::FMS_releaseForm_1400(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("%{public}s AcquireForm ok.", __func__); + HILOG_INFO("%{public}s AcquireForm ok.", __func__); } else { - APP_LOGE("%{public}s AcquireForm error.", __func__); + HILOG_ERROR("%{public}s AcquireForm error.", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1400, EVENT_CODE_1400, ""); } } void FormAbilityReleaseForm::FMS_releaseForm_common_del(std::string data) { - APP_LOGI("%{public}s formId: %{public}s", __func__, data.c_str()); + HILOG_INFO("%{public}s formId: %{public}s", __func__, data.c_str()); bool bResult = DeleteForm(atoll(data.c_str())); if (bResult) { - APP_LOGI("%{public}s DeleteForm end", __func__); + HILOG_INFO("%{public}s DeleteForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101, "true"); } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_COMMON_DEL, EVENT_CODE_101, "false"); } } @@ -353,10 +353,10 @@ void FormAbilityReleaseForm::ReleaseForm_0300(int64_t form_id) bool bResult = ReleaseForm(formId, isReleaseCache); Clear("FMS_releaseForm_0300", form_id); if (bResult) { - APP_LOGI("%{public}s ReleaseForm end", __func__); + HILOG_INFO("%{public}s ReleaseForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0300, EVENT_CODE_300, "true"); } else { - APP_LOGE("%{public}s ReleaseForm error", __func__); + HILOG_ERROR("%{public}s ReleaseForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0300, EVENT_CODE_300, "false"); } } @@ -368,10 +368,10 @@ void FormAbilityReleaseForm::ReleaseForm_0400(int64_t form_id) bool bResult = ReleaseForm(formId, isReleaseCache); Clear("FMS_releaseForm_0400", form_id); if (bResult) { - APP_LOGI("%{public}s ReleaseForm end", __func__); + HILOG_INFO("%{public}s ReleaseForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0400, EVENT_CODE_400, "true"); } else { - APP_LOGE("%{public}s ReleaseForm error", __func__); + HILOG_ERROR("%{public}s ReleaseForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0400, EVENT_CODE_400, "false"); } } @@ -386,14 +386,14 @@ void FormAbilityReleaseForm::ReleaseForm_0600(int64_t form_id) bool isReleaseCache = true; bool realResult = ReleaseForm(form_id, isReleaseCache); if (realResult) { - APP_LOGI("%{public}s ReleaseForm end", __func__); + HILOG_INFO("%{public}s ReleaseForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0600, EVENT_CODE_600, "true"); } else { - APP_LOGE("%{public}s ReleaseForm error", __func__); + HILOG_ERROR("%{public}s ReleaseForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0600, EVENT_CODE_600, "false"); } } else { - APP_LOGE("%{public}s DeleteForm error", __func__); + HILOG_ERROR("%{public}s DeleteForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0600, EVENT_CODE_600, ""); } } @@ -403,10 +403,10 @@ void FormAbilityReleaseForm::ReleaseForm_0700(int64_t form_id) bool isReleaseCache = false; bool bResult = ReleaseForm(form_id, isReleaseCache); if (bResult) { - APP_LOGI("%{public}s ReleaseForm end", __func__); + HILOG_INFO("%{public}s ReleaseForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0700, EVENT_CODE_700, "true"); } else { - APP_LOGE("%{public}s ReleaseForm error", __func__); + HILOG_ERROR("%{public}s ReleaseForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0700, EVENT_CODE_700, "false"); } } @@ -415,10 +415,10 @@ void FormAbilityReleaseForm::ReleaseForm_0800(int64_t form_id) bool isReleaseCache = false; bool bResult = ReleaseForm(form_id, isReleaseCache); if (bResult) { - APP_LOGI("%{public}s ReleaseForm end", __func__); + HILOG_INFO("%{public}s ReleaseForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_800, std::to_string(form_id)); } else { - APP_LOGE("%{public}s ReleaseForm error", __func__); + HILOG_ERROR("%{public}s ReleaseForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0800, EVENT_CODE_800, "false"); } } @@ -427,10 +427,10 @@ void FormAbilityReleaseForm::ReleaseForm_0900(int64_t form_id) bool isReleaseCache = false; bool bResult = ReleaseForm(form_id, isReleaseCache); if (bResult) { - APP_LOGI("%{public}s ReleaseForm end", __func__); + HILOG_INFO("%{public}s ReleaseForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0900, EVENT_CODE_900, std::to_string(form_id)); } else { - APP_LOGE("%{public}s ReleaseForm error", __func__); + HILOG_ERROR("%{public}s ReleaseForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0900, EVENT_CODE_900, "false"); } } @@ -439,10 +439,10 @@ void FormAbilityReleaseForm::ReleaseForm_1000(int64_t form_id) bool isReleaseCache = true; bool bResult = ReleaseForm(form_id, isReleaseCache); if (bResult) { - APP_LOGI("%{public}s ReleaseForm end", __func__); + HILOG_INFO("%{public}s ReleaseForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1000, "true"); } else { - APP_LOGE("%{public}s ReleaseForm error", __func__); + HILOG_ERROR("%{public}s ReleaseForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1000, EVENT_CODE_1000, "false"); } } @@ -451,10 +451,10 @@ void FormAbilityReleaseForm::ReleaseForm_1100(int64_t form_id) bool isReleaseCache = true; bool bResult = ReleaseForm(form_id, isReleaseCache); if (bResult) { - APP_LOGI("%{public}s ReleaseForm end", __func__); + HILOG_INFO("%{public}s ReleaseForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1100, std::to_string(form_id)); } else { - APP_LOGE("%{public}s ReleaseForm error", __func__); + HILOG_ERROR("%{public}s ReleaseForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1100, EVENT_CODE_1100, "false"); } } @@ -463,10 +463,10 @@ void FormAbilityReleaseForm::ReleaseForm_1200(int64_t form_id) bool isReleaseCache = true; bool bResult = ReleaseForm(form_id, isReleaseCache); if (bResult) { - APP_LOGI("%{public}s ReleaseForm end", __func__); + HILOG_INFO("%{public}s ReleaseForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1200, EVENT_CODE_1200, std::to_string(form_id)); } else { - APP_LOGE("%{public}s ReleaseForm error", __func__); + HILOG_ERROR("%{public}s ReleaseForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1200, EVENT_CODE_1200, "false"); } } @@ -481,10 +481,10 @@ void FormAbilityReleaseForm::ReleaseForm_1300(int64_t form_id, std::string lastF Clear("FMS_releaseForm_1300", form_id); Clear("FMS_releaseForm_1300", atoll(lastFormId.c_str())); if (bResult1 && bResult2) { - APP_LOGI("%{public}s ReleaseForm end", __func__); + HILOG_INFO("%{public}s ReleaseForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300, "true"); } else { - APP_LOGE("%{public}s ReleaseForm error", __func__); + HILOG_ERROR("%{public}s ReleaseForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1300, EVENT_CODE_1300, "false"); } } @@ -495,17 +495,17 @@ void FormAbilityReleaseForm::ReleaseForm_1400(int64_t form_id) bool bResult = ReleaseForm(form_id, isReleaseCache); Clear("FMS_releaseForm_1400", form_id); if (bResult) { - APP_LOGI("%{public}s ReleaseForm end", __func__); + HILOG_INFO("%{public}s ReleaseForm end", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1400, EVENT_CODE_1400, "true"); } else { - APP_LOGE("%{public}s ReleaseForm error", __func__); + HILOG_ERROR("%{public}s ReleaseForm error", __func__); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_1400, EVENT_CODE_1400, "false"); } } void FormAbilityReleaseForm::OnStart(const Want &want) { - APP_LOGI("FormAbilityReleaseForm::onStart"); + HILOG_INFO("FormAbilityReleaseForm::onStart"); Ability::OnStart(want); std::vector eventList = { @@ -527,7 +527,7 @@ void FormAbilityReleaseForm::OnStart(const Want &want) } void FormAbilityReleaseForm::OnActive() { - APP_LOGI("FormAbilityReleaseForm::OnActive"); + HILOG_INFO("FormAbilityReleaseForm::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + FORM_ABILITY_STATE_ONACTIVE; FormTestUtils::PublishEvent(FORM_EVENT_ABILITY_ONACTIVED, 0, eventData); @@ -535,19 +535,19 @@ void FormAbilityReleaseForm::OnActive() void FormAbilityReleaseForm::OnStop() { - APP_LOGI("FormAbilityReleaseForm::OnStop"); + HILOG_INFO("FormAbilityReleaseForm::OnStop"); Ability::OnStop(); } void FormAbilityReleaseForm::OnInactive() { - APP_LOGI("FormAbilityReleaseForm::OnInactive"); + HILOG_INFO("FormAbilityReleaseForm::OnInactive"); Ability::OnInactive(); } void FormAbilityReleaseForm::OnBackground() { - APP_LOGI("FormAbilityReleaseForm::OnBackground"); + HILOG_INFO("FormAbilityReleaseForm::OnBackground"); Ability::OnBackground(); } @@ -569,7 +569,7 @@ void FormAbilityReleaseForm::Init(const std::shared_ptr &abilityInf const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("FormAbilityReleaseForm::Init"); + HILOG_INFO("FormAbilityReleaseForm::Init"); Ability::Init(abilityInfo, application, handler, token); memberFuncMap_[FORM_EVENT_REQ_RELEASE_FORM_0300] = &FormAbilityReleaseForm::FMS_releaseForm_0300; memberFuncMap_[FORM_EVENT_REQ_RELEASE_FORM_0400] = &FormAbilityReleaseForm::FMS_releaseForm_0400; @@ -588,7 +588,7 @@ void FormAbilityReleaseForm::Init(const std::shared_ptr &abilityInf void FormAbilityReleaseForm::handleEvent(std::string action, std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); auto itFunc = memberFuncMap_.find(action); if (itFunc != memberFuncMap_.end()) { auto memberFunc = itFunc->second; @@ -602,16 +602,17 @@ void FormAbilityReleaseForm::Clear(std::string case_id, int64_t form_id) { bool bResult = DeleteForm(form_id); if (bResult) { - APP_LOGI("[%{public}s] clear ok", case_id.c_str()); + HILOG_INFO("[%{public}s] clear ok", case_id.c_str()); } else { - APP_LOGE("[%{public}s] clear error", case_id.c_str()); + HILOG_ERROR("[%{public}s] clear error", case_id.c_str()); } } void FormEventSubscriberForReleaseForm::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FormEventSubscriberForReleaseForm::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("FormEventSubscriberForReleaseForm::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO( + "FormEventSubscriberForReleaseForm::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("FormEventSubscriberForReleaseForm::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); ability_->handleEvent(eventName, data.GetData()); if ((data.GetCode() == EVENT_CODE_1300 && data.GetData() == "") || diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormalB/BUILD.gn b/test/resource/formsystemtestability/fmsSystemTestHostNormalB/BUILD.gn index 06f11ec135..5622d285f0 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormalB/BUILD.gn +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormalB/BUILD.gn @@ -23,6 +23,7 @@ config("fmsSystemTestHostNormalBConfig") { "${aafwk_path}/interfaces/innerkits/uri/include", "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${aafwk_path}/frameworks/kits/appkit/native/app", @@ -33,8 +34,8 @@ config("fmsSystemTestHostNormalBConfig") { "//foundation/distributedschedule/safwk/services/safwk/include", ] defines = [ - "APP_LOG_TAG = \"formManagerSystemTest\"", - "LOG_DOMAIN = 0xD002666", + "AMS_LOG_TAG = \"formManagerSystemTest\"", + "AMS_LOG_DOMAIN = 0xD002666", ] } ohos_shared_library("fmsSystemTestHostNormalB") { diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp index 437923559a..f903327b92 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormalB/src/form_ability_b.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "form_ability_b.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "form_st_common_info.h" #include "form_test_utils.h" #include "system_test_form_util.h" @@ -33,35 +33,35 @@ std::vector eventList = { }; void FormAbilityB::AcquireFormCallback::OnAcquired(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); FormTestUtils::PublishEvent(this->caseName_, this->code_, std::to_string(formJsInfo.formId)); if (this->caseName_ == FORM_EVENT_RECV_ACQUIRE_FORM_1500) { std::string strFormId = std::to_string(formJsInfo.formId); - APP_LOGI("%{public}s, delete form, formId: %{public}s", __func__, strFormId.c_str()); + HILOG_INFO("%{public}s, delete form, formId: %{public}s", __func__, strFormId.c_str()); ability_->FMS_deleteFormCommon(strFormId); } } void FormAbilityB::AcquireFormCallback::OnUpdate(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); FormTestUtils::PublishEvent(this->caseName_, this->code_ + 1, formJsInfo.formData); if (this->caseName_ == FORM_EVENT_RECV_ACQUIRE_FORM_1800_2 || this->caseName_ == FORM_EVENT_RECV_ACQUIRE_FORM_1800_3) { std::string strFormId = std::to_string(formJsInfo.formId); - APP_LOGI("%{public}s, delete form, formId: %{public}s", __func__, strFormId.c_str()); + HILOG_INFO("%{public}s, delete form, formId: %{public}s", __func__, strFormId.c_str()); ability_->FMS_deleteFormCommon(strFormId); } } void FormAbilityB::AcquireFormCallback::OnFormUninstall(const int64_t formId) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } void FormAbilityB::FMS_deleteFormCommon(std::string strFormId) { - APP_LOGI("%{public}s called, formId: %{public}s", __func__, strFormId.c_str()); + HILOG_INFO("%{public}s called, formId: %{public}s", __func__, strFormId.c_str()); if (strFormId.empty()) { - APP_LOGE("DeleteForm error, formId is 0"); + HILOG_ERROR("DeleteForm error, formId is 0"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999, "false"); return; } @@ -70,17 +70,17 @@ void FormAbilityB::FMS_deleteFormCommon(std::string strFormId) bool bResult = DeleteForm(formId); sleep(1); if (bResult) { - APP_LOGI("DeleteForm end"); + HILOG_INFO("DeleteForm end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999, "true"); } else { - APP_LOGE("DeleteForm error"); + HILOG_ERROR("DeleteForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999, "false"); } } void FormAbilityB::FMS_acquireForm_1400(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_1400, EVENT_CODE_1400); // Set Want info begin @@ -95,15 +95,15 @@ void FormAbilityB::FMS_acquireForm_1400(std::string data) int64_t formId = std::stoll(data); bool bResult = AcquireForm(formId, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1400, EVENT_CODE_1400, "false"); } } void FormAbilityB::FMS_acquireForm_1500(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_1500, EVENT_CODE_1500); callback->ability_ = this; @@ -118,16 +118,16 @@ void FormAbilityB::FMS_acquireForm_1500(std::string data) int64_t formId = std::stoll(data); bool bResult = AcquireForm(formId, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1500, EVENT_CODE_1500, ""); } } void FormAbilityB::FMS_acquireForm_1800_2(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_1800_2, EVENT_CODE_1820); callback->ability_ = this; @@ -141,15 +141,15 @@ void FormAbilityB::FMS_acquireForm_1800_2(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1800_2, EVENT_CODE_1820, ""); } } void FormAbilityB::FMS_acquireForm_1800_3(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_1800_3, EVENT_CODE_1830); callback->ability_ = this; @@ -163,16 +163,16 @@ void FormAbilityB::FMS_acquireForm_1800_3(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_1800_3, EVENT_CODE_1830, ""); } } void FormAbilityB::FMS_acquireForm_2400_1(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_2400_1, EVENT_CODE_2410); callback->ability_ = this; @@ -180,15 +180,15 @@ void FormAbilityB::FMS_acquireForm_2400_1(std::string data) int64_t formId = std::stoll(data); bool bResult = CastTempForm(formId); if (bResult) { - APP_LOGI("CastTempForm end"); + HILOG_INFO("CastTempForm end"); } else { - APP_LOGE("CastTempForm error"); + HILOG_ERROR("CastTempForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_2400_1, EVENT_CODE_2410, "false"); } } void FormAbilityB::FMS_acquireForm_3100(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3100); callback->ability_ = this; @@ -202,15 +202,15 @@ void FormAbilityB::FMS_acquireForm_3100(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3100, ""); } } void FormAbilityB::FMS_acquireForm_tempForm(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_TEMP, EVENT_CODE_TEMP); @@ -224,16 +224,16 @@ void FormAbilityB::FMS_acquireForm_tempForm(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_TEMP, EVENT_CODE_TEMP, ""); } } void FormAbilityB::FMS_acquireFormBatch(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); @@ -243,22 +243,22 @@ void FormAbilityB::FMS_acquireFormBatch(std::string data) want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); - APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); + HILOG_INFO("%{public}s, formCount: %{public}d", __func__, formCount); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, formCount); // Set Want info end int result = STtools::SystemTestFormUtil::BatchAddFormRecords(want); if (result == ERR_OK) { - APP_LOGI("Batch add form end"); + HILOG_INFO("Batch add form end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_BATCH, EVENT_CODE_BATCH, "true"); } else { - APP_LOGE("Batch add form error"); + HILOG_ERROR("Batch add form error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_BATCH, EVENT_CODE_BATCH, "false"); } } void FormAbilityB::FMS_acquireFormTempBatch(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); @@ -269,15 +269,15 @@ void FormAbilityB::FMS_acquireFormTempBatch(std::string data) want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); - APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); + HILOG_INFO("%{public}s, formCount: %{public}d", __func__, formCount); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, formCount); // Set Want info end int result = STtools::SystemTestFormUtil::BatchAddFormRecords(want); if (result == ERR_OK) { - APP_LOGI("Batch add temp form end"); + HILOG_INFO("Batch add temp form end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_TEMP_FORM_BATCH, EVENT_CODE_TEMP_BATCH, "true"); } else { - APP_LOGE("Batch add temp form error"); + HILOG_ERROR("Batch add temp form error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_TEMP_FORM_BATCH, EVENT_CODE_TEMP_BATCH, "false"); } } @@ -287,12 +287,12 @@ FormAbilityB::~FormAbilityB() } void FormAbilityB::OnStart(const Want &want) { - APP_LOGI("FormAbilityB::onStart"); + HILOG_INFO("FormAbilityB::onStart"); Ability::OnStart(want); } void FormAbilityB::OnActive() { - APP_LOGI("FormAbilityB::OnActive"); + HILOG_INFO("FormAbilityB::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + FORM_ABILITY_STATE_ONACTIVE; FormTestUtils::PublishEvent(FORM_EVENT_ABILITY_ONACTIVED, 0, eventData); @@ -300,25 +300,25 @@ void FormAbilityB::OnActive() void FormAbilityB::OnStop() { - APP_LOGI("FormAbilityB::OnStop"); + HILOG_INFO("FormAbilityB::OnStop"); Ability::OnStop(); } void FormAbilityB::OnInactive() { - APP_LOGI("FormAbilityB::OnInactive"); + HILOG_INFO("FormAbilityB::OnInactive"); Ability::OnInactive(); } void FormAbilityB::OnBackground() { - APP_LOGI("FormAbilityB::OnBackground"); + HILOG_INFO("FormAbilityB::OnBackground"); Ability::OnBackground(); } void FormAbilityB::SubscribeEvent() { - APP_LOGI("FormAbilityB::SubscribeEvent"); + HILOG_INFO("FormAbilityB::SubscribeEvent"); MatchingSkills matchingSkills; for (const auto &e : eventList) { matchingSkills.AddEvent(e); @@ -335,7 +335,7 @@ void FormAbilityB::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("FormAbilityB::Init"); + HILOG_INFO("FormAbilityB::Init"); Ability::Init(abilityInfo, application, handler, token); memberFuncMap_[FORM_EVENT_REQ_DELETE_FORM_COMMON] = &FormAbilityB::FMS_deleteFormCommon; memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_TEMP] = &FormAbilityB::FMS_acquireForm_tempForm; @@ -352,7 +352,7 @@ void FormAbilityB::Init(const std::shared_ptr &abilityInfo, void FormAbilityB::handleEvent(std::string action, std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); if (calledFuncMap_.find(action) != calledFuncMap_.end()) { return; } @@ -372,9 +372,9 @@ void FormAbilityB::Clear() void FormEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FormEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("FormEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FormEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("FormEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); ability_->handleEvent(eventName, data.GetData()); CommonEventManager::UnSubscribeCommonEvent(ability_->subscriber_); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormalC/BUILD.gn b/test/resource/formsystemtestability/fmsSystemTestHostNormalC/BUILD.gn index 26f1c6b366..5a6b377b68 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormalC/BUILD.gn +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormalC/BUILD.gn @@ -23,6 +23,7 @@ config("fmsSystemTestHostNormalCConfig") { "${aafwk_path}/interfaces/innerkits/uri/include", "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${aafwk_path}/frameworks/kits/appkit/native/app", @@ -33,8 +34,8 @@ config("fmsSystemTestHostNormalCConfig") { "//foundation/distributedschedule/safwk/services/safwk/include", ] defines = [ - "APP_LOG_TAG = \"formManagerSystemTest\"", - "LOG_DOMAIN = 0xD002666", + "AMS_LOG_TAG = \"formManagerSystemTest\"", + "AMS_LOG_DOMAIN = 0xD002666", ] } ohos_shared_library("fmsSystemTestHostNormalC") { diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp index dad17b4b4b..8abe35f7f8 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNormalC/src/form_ability_c.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "form_ability_c.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "form_st_common_info.h" #include "form_test_utils.h" #include "system_test_form_util.h" @@ -31,24 +31,24 @@ std::vector eventList = { }; void FormAbilityC::AcquireFormCallback::OnAcquired(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); FormTestUtils::PublishEvent(this->caseName_, this->code_, std::to_string(formJsInfo.formId)); } void FormAbilityC::AcquireFormCallback::OnUpdate(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); FormTestUtils::PublishEvent(this->caseName_, this->code_ + 1, formJsInfo.formData); } void FormAbilityC::AcquireFormCallback::OnFormUninstall(const int64_t formId) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } void FormAbilityC::FMS_deleteFormCommon(std::string strFormId) { - APP_LOGI("%{public}s called, formId: %{public}s", __func__, strFormId.c_str()); + HILOG_INFO("%{public}s called, formId: %{public}s", __func__, strFormId.c_str()); if (strFormId.empty()) { - APP_LOGE("DeleteForm error, formId is 0"); + HILOG_ERROR("DeleteForm error, formId is 0"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999, "false"); return; } @@ -57,17 +57,17 @@ void FormAbilityC::FMS_deleteFormCommon(std::string strFormId) bool bResult = DeleteForm(formId); sleep(1); if (bResult) { - APP_LOGI("DeleteForm end"); + HILOG_INFO("DeleteForm end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999, "true"); } else { - APP_LOGE("DeleteForm error"); + HILOG_ERROR("DeleteForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_COMMON, EVENT_CODE_999, "false"); } } void FormAbilityC::FMS_acquireForm_3100(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3100); callback->ability_ = this; @@ -81,16 +81,16 @@ void FormAbilityC::FMS_acquireForm_3100(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3100, EVENT_CODE_3100, ""); } } void FormAbilityC::FMS_acquireForm_3200(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_ACQUIRE_FORM_3200, EVENT_CODE_3200); callback->ability_ = this; @@ -104,15 +104,15 @@ void FormAbilityC::FMS_acquireForm_3200(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_3200, EVENT_CODE_3200, "false"); } } void FormAbilityC::FMS_acquireFormBatch(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); @@ -122,22 +122,22 @@ void FormAbilityC::FMS_acquireFormBatch(std::string data) want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); - APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); + HILOG_INFO("%{public}s, formCount: %{public}d", __func__, formCount); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, formCount); // Set Want info end int result = STtools::SystemTestFormUtil::BatchAddFormRecords(want); if (result == ERR_OK) { - APP_LOGI("Batch add form end"); + HILOG_INFO("Batch add form end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_BATCH, EVENT_CODE_BATCH, "true"); } else { - APP_LOGE("Batch add form error"); + HILOG_ERROR("Batch add form error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_BATCH, EVENT_CODE_BATCH, "false"); } } void FormAbilityC::FMS_acquireFormTempBatch(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); // Set Want info begin Want want; want.SetParam(Constants::PARAM_FORM_DIMENSION_KEY, FORM_DIMENSION_1); @@ -148,15 +148,15 @@ void FormAbilityC::FMS_acquireFormTempBatch(std::string data) want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); int formCount = std::stoi(data); - APP_LOGI("%{public}s, formCount: %{public}d", __func__, formCount); + HILOG_INFO("%{public}s, formCount: %{public}d", __func__, formCount); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, formCount); // Set Want info end int result = STtools::SystemTestFormUtil::BatchAddFormRecords(want); if (result == ERR_OK) { - APP_LOGI("Batch add temp form end"); + HILOG_INFO("Batch add temp form end"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_TEMP_FORM_BATCH, EVENT_CODE_TEMP_BATCH, "true"); } else { - APP_LOGE("Batch add temp form error"); + HILOG_ERROR("Batch add temp form error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_TEMP_FORM_BATCH, EVENT_CODE_TEMP_BATCH, "false"); } } @@ -166,12 +166,12 @@ FormAbilityC::~FormAbilityC() } void FormAbilityC::OnStart(const Want &want) { - APP_LOGI("FormAbilityC::onStart"); + HILOG_INFO("FormAbilityC::onStart"); Ability::OnStart(want); } void FormAbilityC::OnActive() { - APP_LOGI("FormAbilityC::OnActive"); + HILOG_INFO("FormAbilityC::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + FORM_ABILITY_STATE_ONACTIVE; FormTestUtils::PublishEvent(FORM_EVENT_ABILITY_ONACTIVED, 0, eventData); @@ -179,25 +179,25 @@ void FormAbilityC::OnActive() void FormAbilityC::OnStop() { - APP_LOGI("FormAbilityC::OnStop"); + HILOG_INFO("FormAbilityC::OnStop"); Ability::OnStop(); } void FormAbilityC::OnInactive() { - APP_LOGI("FormAbilityC::OnInactive"); + HILOG_INFO("FormAbilityC::OnInactive"); Ability::OnInactive(); } void FormAbilityC::OnBackground() { - APP_LOGI("FormAbilityC::OnBackground"); + HILOG_INFO("FormAbilityC::OnBackground"); Ability::OnBackground(); } void FormAbilityC::SubscribeEvent() { - APP_LOGI("FormAbilityC::SubscribeEvent"); + HILOG_INFO("FormAbilityC::SubscribeEvent"); MatchingSkills matchingSkills; for (const auto &e : eventList) { matchingSkills.AddEvent(e); @@ -214,7 +214,7 @@ void FormAbilityC::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("FormAbilityC::Init"); + HILOG_INFO("FormAbilityC::Init"); Ability::Init(abilityInfo, application, handler, token); memberFuncMap_[FORM_EVENT_REQ_DELETE_FORM_COMMON] = &FormAbilityC::FMS_deleteFormCommon; memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_BATCH] = &FormAbilityC::FMS_acquireFormBatch; @@ -227,7 +227,7 @@ void FormAbilityC::Init(const std::shared_ptr &abilityInfo, void FormAbilityC::handleEvent(std::string action, std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); if (calledFuncMap_.find(action) != calledFuncMap_.end()) { return; } @@ -247,9 +247,9 @@ void FormAbilityC::Clear() void FormEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FormEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("FormEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FormEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("FormEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); ability_->handleEvent(eventName, data.GetData()); CommonEventManager::UnSubscribeCommonEvent(ability_->subscriber_); diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNotSys/BUILD.gn b/test/resource/formsystemtestability/fmsSystemTestHostNotSys/BUILD.gn index 4497559931..9dd7a66b37 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNotSys/BUILD.gn +++ b/test/resource/formsystemtestability/fmsSystemTestHostNotSys/BUILD.gn @@ -23,6 +23,7 @@ config("fmsSystemTestHostNotSysConfig") { "${aafwk_path}/interfaces/innerkits/uri/include", "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${aafwk_path}/frameworks/kits/appkit/native/app", @@ -32,8 +33,8 @@ config("fmsSystemTestHostNotSysConfig") { "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"formManagerSystemTest\"", - "LOG_DOMAIN = 0xD002666", + "AMS_LOG_TAG = \"formManagerSystemTest\"", + "AMS_LOG_DOMAIN = 0xD002666", ] } ohos_shared_library("fmsSystemTestHostNotSys") { diff --git a/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp b/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp index ef06ae7609..503a5726b5 100644 --- a/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestHostNotSys/src/form_ability_not_sys.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "form_ability_not_sys.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "form_st_common_info.h" #include "form_test_utils.h" @@ -26,15 +26,15 @@ namespace OHOS { namespace AppExecFwk { void FormAbilityNotSys::AcquireFormCallback::OnAcquired(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } void FormAbilityNotSys::AcquireFormCallback::OnUpdate(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } void FormAbilityNotSys::AcquireFormCallback::OnFormUninstall(const int64_t formId) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } void FormAbilityNotSys::FMS_acquireForm_0100() { @@ -49,9 +49,9 @@ void FormAbilityNotSys::FMS_acquireForm_0100() // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_ACQUIRE_FORM_0100, EVENT_CODE_100, "false"); } } @@ -61,9 +61,9 @@ void FormAbilityNotSys::FMS_deleteForm_0100() int64_t formId = 1; bool bResult = DeleteForm(formId); if (bResult) { - APP_LOGI("[FMS_deleteForm_0100] end"); + HILOG_INFO("[FMS_deleteForm_0100] end"); } else { - APP_LOGE("[FMS_deleteForm_0100] error"); + HILOG_ERROR("[FMS_deleteForm_0100] error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_DELETE_FORM_0100, EVENT_CODE_100, "false"); } } @@ -74,16 +74,16 @@ void FormAbilityNotSys::FMS_releaseForm_0100() bool isReleaseCache = true; bool bResult = ReleaseForm(formId, isReleaseCache); if (bResult) { - APP_LOGI("[FMS_releaseForm_0100] end"); + HILOG_INFO("[FMS_releaseForm_0100] end"); } else { - APP_LOGE("[FMS_releaseForm_0100] error"); + HILOG_ERROR("[FMS_releaseForm_0100] error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_RELEASE_FORM_0100, EVENT_CODE_100, "false"); } } void FormAbilityNotSys::OnStart(const Want &want) { - APP_LOGI("FormAbilityNotSys::onStart"); + HILOG_INFO("FormAbilityNotSys::onStart"); Ability::OnStart(want); std::vector eventList = { @@ -95,7 +95,7 @@ void FormAbilityNotSys::OnStart(const Want &want) } void FormAbilityNotSys::OnActive() { - APP_LOGI("FormAbilityNotSys::OnActive"); + HILOG_INFO("FormAbilityNotSys::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + FORM_ABILITY_STATE_ONACTIVE; FormTestUtils::PublishEvent(FORM_EVENT_ABILITY_ONACTIVED, 0, eventData); @@ -103,19 +103,19 @@ void FormAbilityNotSys::OnActive() void FormAbilityNotSys::OnStop() { - APP_LOGI("FormAbilityNotSys::OnStop"); + HILOG_INFO("FormAbilityNotSys::OnStop"); Ability::OnStop(); } void FormAbilityNotSys::OnInactive() { - APP_LOGI("FormAbilityNotSys::OnInactive"); + HILOG_INFO("FormAbilityNotSys::OnInactive"); Ability::OnInactive(); } void FormAbilityNotSys::OnBackground() { - APP_LOGI("FormAbilityNotSys::OnBackground"); + HILOG_INFO("FormAbilityNotSys::OnBackground"); Ability::OnBackground(); } @@ -137,7 +137,7 @@ void FormAbilityNotSys::Init(const std::shared_ptr &abilityInfo, const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("FormAbilityNotSys::Init"); + HILOG_INFO("FormAbilityNotSys::Init"); Ability::Init(abilityInfo, application, handler, token); memberFuncMap_[FORM_EVENT_REQ_ACQUIRE_FORM_0100] = &FormAbilityNotSys::FMS_acquireForm_0100; @@ -162,8 +162,8 @@ void FormAbilityNotSys::Clear() void FormEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FormEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("FormEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FormEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("FormEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); ability_->handleEvent(eventName); } diff --git a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/BUILD.gn b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/BUILD.gn index ac22f6d100..69f2c613bc 100644 --- a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/BUILD.gn +++ b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/BUILD.gn @@ -23,6 +23,7 @@ config("selfStartingTestHostAConfig") { "${aafwk_path}/interfaces/innerkits/uri/include", "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${aafwk_path}/frameworks/kits/appkit/native/app", @@ -32,8 +33,8 @@ config("selfStartingTestHostAConfig") { "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"formManagerSystemTest\"", - "LOG_DOMAIN = 0xD002666", + "AMS_LOG_TAG = \"formManagerSystemTest\"", + "AMS_LOG_DOMAIN = 0xD002666", ] } ohos_shared_library("selfStartingTestHostA") { diff --git a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/src/form_ability_self_starting_a.cpp b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/src/form_ability_self_starting_a.cpp index 1496c8ed54..5589099017 100644 --- a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/src/form_ability_self_starting_a.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostA/src/form_ability_self_starting_a.cpp @@ -14,7 +14,7 @@ */ #include "form_ability_self_starting_a.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "form_st_common_info.h" #include "form_test_utils.h" @@ -31,24 +31,24 @@ std::vector eventList = { void FormAbilitySelfStartingA::SelfStartingCallback::OnAcquired(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } void FormAbilitySelfStartingA::SelfStartingCallback::OnUpdate(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); - APP_LOGI("%{public}s called, caseName_: %{public}s, code_: %{public}d", __func__, this->caseName_.c_str(), + HILOG_INFO("%{public}s called", __func__); + HILOG_INFO("%{public}s called, caseName_: %{public}s, code_: %{public}d", __func__, this->caseName_.c_str(), this->code_); FormTestUtils::PublishEvent(this->caseName_, this->code_, "true"); } void FormAbilitySelfStartingA::SelfStartingCallback::OnFormUninstall(const int64_t formId) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } void FormAbilitySelfStartingA::FMS_Start_0300_01(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_SELF_STARTING_TEST_0100, EVENT_CODE_100); // Set Want info begin @@ -61,9 +61,9 @@ void FormAbilitySelfStartingA::FMS_Start_0300_01(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_SELF_STARTING_TEST_0100, EVENT_CODE_100, "false"); } } @@ -75,12 +75,12 @@ FormAbilitySelfStartingA::~FormAbilitySelfStartingA() void FormAbilitySelfStartingA::OnStart(const Want &want) { - APP_LOGI("FormAbilitySelfStartingA::onStart"); + HILOG_INFO("FormAbilitySelfStartingA::onStart"); Ability::OnStart(want); } void FormAbilitySelfStartingA::OnActive() { - APP_LOGI("FormAbilitySelfStartingA::OnActive"); + HILOG_INFO("FormAbilitySelfStartingA::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + FORM_ABILITY_STATE_ONACTIVE; FormTestUtils::PublishEvent(FORM_EVENT_ABILITY_ONACTIVED, 0, eventData); @@ -88,25 +88,25 @@ void FormAbilitySelfStartingA::OnActive() void FormAbilitySelfStartingA::OnStop() { - APP_LOGI("FormAbilitySelfStartingA::OnStop"); + HILOG_INFO("FormAbilitySelfStartingA::OnStop"); Ability::OnStop(); } void FormAbilitySelfStartingA::OnInactive() { - APP_LOGI("FormAbilitySelfStartingA::OnInactive"); + HILOG_INFO("FormAbilitySelfStartingA::OnInactive"); Ability::OnInactive(); } void FormAbilitySelfStartingA::OnBackground() { - APP_LOGI("FormAbilitySelfStartingA::OnBackground"); + HILOG_INFO("FormAbilitySelfStartingA::OnBackground"); Ability::OnBackground(); } void FormAbilitySelfStartingA::SubscribeEvent() { - APP_LOGI("FormAbilitySelfStartingA::SubscribeEvent"); + HILOG_INFO("FormAbilitySelfStartingA::SubscribeEvent"); MatchingSkills matchingSkills; for (const auto &e : eventList) { matchingSkills.AddEvent(e); @@ -123,7 +123,7 @@ void FormAbilitySelfStartingA::Init(const std::shared_ptr &abilityI const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("FormAbilitySelfStartingA::Init"); + HILOG_INFO("FormAbilitySelfStartingA::Init"); Ability::Init(abilityInfo, application, handler, token); memberFuncMap_[FORM_EVENT_REQ_SELF_STARTING_TEST_0100] = &FormAbilitySelfStartingA::FMS_Start_0300_01; @@ -132,7 +132,7 @@ void FormAbilitySelfStartingA::Init(const std::shared_ptr &abilityI void FormAbilitySelfStartingA::handleEvent(std::string action, std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); if (calledFuncMap_.find(action) != calledFuncMap_.end()) { return; } @@ -152,9 +152,9 @@ void FormAbilitySelfStartingA::Clear() void FormEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FormEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("FormEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FormEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("FormEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); ability_->handleEvent(eventName, data.GetData()); diff --git a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/BUILD.gn b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/BUILD.gn index 653e146528..3e5fee98c4 100644 --- a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/BUILD.gn +++ b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/BUILD.gn @@ -23,6 +23,7 @@ config("selfStartingTestHostBConfig") { "${aafwk_path}/interfaces/innerkits/uri/include", "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${aafwk_path}/frameworks/kits/appkit/native/app", @@ -32,8 +33,8 @@ config("selfStartingTestHostBConfig") { "//third_party/jsoncpp/include", ] defines = [ - "APP_LOG_TAG = \"formManagerSystemTest\"", - "LOG_DOMAIN = 0xD002666", + "AMS_LOG_TAG = \"formManagerSystemTest\"", + "AMS_LOG_DOMAIN = 0xD002666", ] } ohos_shared_library("selfStartingTestHostB") { diff --git a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/src/form_ability_self_starting_b.cpp b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/src/form_ability_self_starting_b.cpp index 28f419e5df..6fa2e36228 100644 --- a/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/src/form_ability_self_starting_b.cpp +++ b/test/resource/formsystemtestability/fmsSystemTestSelfStarting/selfStartingTestHostB/src/form_ability_self_starting_b.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "form_ability_self_starting_b.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "form_st_common_info.h" #include "form_test_utils.h" @@ -30,24 +30,24 @@ std::vector eventList = { void FormAbilitySelfStartingB::SelfStartingCallback::OnAcquired(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } void FormAbilitySelfStartingB::SelfStartingCallback::OnUpdate(const int32_t result, const FormJsInfo &formJsInfo) const { - APP_LOGI("%{public}s called", __func__); - APP_LOGI("%{public}s called, caseName_: %{public}s, code_: %{public}d", __func__, this->caseName_.c_str(), + HILOG_INFO("%{public}s called", __func__); + HILOG_INFO("%{public}s called, caseName_: %{public}s, code_: %{public}d", __func__, this->caseName_.c_str(), this->code_); FormTestUtils::PublishEvent(this->caseName_, this->code_, "true"); } void FormAbilitySelfStartingB::SelfStartingCallback::OnFormUninstall(const int64_t formId) const { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); } void FormAbilitySelfStartingB::FMS_Start_0300_02(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_SELF_STARTING_TEST_0200, EVENT_CODE_200); // Set Want info begin @@ -60,16 +60,16 @@ void FormAbilitySelfStartingB::FMS_Start_0300_02(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_SELF_STARTING_TEST_0200, EVENT_CODE_200, "false"); } } void FormAbilitySelfStartingB::FMS_Start_0300_03(std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); std::shared_ptr callback = std::make_shared(FORM_EVENT_RECV_SELF_STARTING_TEST_0300, EVENT_CODE_300); // Set Want info begin @@ -82,9 +82,9 @@ void FormAbilitySelfStartingB::FMS_Start_0300_03(std::string data) // Set Want info end bool bResult = AcquireForm(0, want, callback); if (bResult) { - APP_LOGI("AcquireForm end"); + HILOG_INFO("AcquireForm end"); } else { - APP_LOGE("AcquireForm error"); + HILOG_ERROR("AcquireForm error"); FormTestUtils::PublishEvent(FORM_EVENT_RECV_SELF_STARTING_TEST_0300, EVENT_CODE_300, "false"); } } @@ -95,12 +95,12 @@ FormAbilitySelfStartingB::~FormAbilitySelfStartingB() } void FormAbilitySelfStartingB::OnStart(const Want &want) { - APP_LOGI("FormAbilitySelfStartingB::onStart"); + HILOG_INFO("FormAbilitySelfStartingB::onStart"); Ability::OnStart(want); } void FormAbilitySelfStartingB::OnActive() { - APP_LOGI("FormAbilitySelfStartingB::OnActive"); + HILOG_INFO("FormAbilitySelfStartingB::OnActive"); Ability::OnActive(); std::string eventData = GetAbilityName() + FORM_ABILITY_STATE_ONACTIVE; FormTestUtils::PublishEvent(FORM_EVENT_ABILITY_ONACTIVED, 0, eventData); @@ -108,25 +108,25 @@ void FormAbilitySelfStartingB::OnActive() void FormAbilitySelfStartingB::OnStop() { - APP_LOGI("FormAbilitySelfStartingB::OnStop"); + HILOG_INFO("FormAbilitySelfStartingB::OnStop"); Ability::OnStop(); } void FormAbilitySelfStartingB::OnInactive() { - APP_LOGI("FormAbilitySelfStartingB::OnInactive"); + HILOG_INFO("FormAbilitySelfStartingB::OnInactive"); Ability::OnInactive(); } void FormAbilitySelfStartingB::OnBackground() { - APP_LOGI("FormAbilitySelfStartingB::OnBackground"); + HILOG_INFO("FormAbilitySelfStartingB::OnBackground"); Ability::OnBackground(); } void FormAbilitySelfStartingB::SubscribeEvent() { - APP_LOGI("FormAbilitySelfStartingB::SubscribeEvent"); + HILOG_INFO("FormAbilitySelfStartingB::SubscribeEvent"); MatchingSkills matchingSkills; for (const auto &e : eventList) { matchingSkills.AddEvent(e); @@ -143,7 +143,7 @@ void FormAbilitySelfStartingB::Init(const std::shared_ptr &abilityI const std::shared_ptr &application, std::shared_ptr &handler, const sptr &token) { - APP_LOGI("FormAbilitySelfStartingB::Init"); + HILOG_INFO("FormAbilitySelfStartingB::Init"); Ability::Init(abilityInfo, application, handler, token); memberFuncMap_[FORM_EVENT_REQ_SELF_STARTING_TEST_0200] = &FormAbilitySelfStartingB::FMS_Start_0300_02; memberFuncMap_[FORM_EVENT_REQ_SELF_STARTING_TEST_0300] = &FormAbilitySelfStartingB::FMS_Start_0300_03; @@ -153,7 +153,7 @@ void FormAbilitySelfStartingB::Init(const std::shared_ptr &abilityI void FormAbilitySelfStartingB::handleEvent(std::string action, std::string data) { - APP_LOGI("%{public}s called", __func__); + HILOG_INFO("%{public}s called", __func__); if (calledFuncMap_.find(action) != calledFuncMap_.end()) { return; } @@ -173,9 +173,9 @@ void FormAbilitySelfStartingB::Clear() void FormEventSubscriber::OnReceiveEvent(const CommonEventData &data) { - APP_LOGI("FormEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); - APP_LOGI("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); - APP_LOGI("FormEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); + HILOG_INFO("FormEventSubscriber::OnReceiveEvent:event=%{public}s", data.GetWant().GetAction().c_str()); + HILOG_INFO("KitTestEventSubscriber::OnReceiveEvent:data=%{public}s", data.GetData().c_str()); + HILOG_INFO("FormEventSubscriber::OnReceiveEvent:code=%{public}d", data.GetCode()); auto eventName = data.GetWant().GetAction(); ability_->handleEvent(eventName, data.GetData()); CommonEventManager::UnSubscribeCommonEvent(ability_->subscriber_); diff --git a/test/resource/formsystemtestability/formSystemTestServiceA/BUILD.gn b/test/resource/formsystemtestability/formSystemTestServiceA/BUILD.gn index 66535454fa..96b696342e 100644 --- a/test/resource/formsystemtestability/formSystemTestServiceA/BUILD.gn +++ b/test/resource/formsystemtestability/formSystemTestServiceA/BUILD.gn @@ -25,13 +25,14 @@ config("formSystemTestAConfig") { "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${appexecfwk_path}/services/bundlemgr/include", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${even_path}/cesfwk/innerkits/include", "${even_path}/cesfwk/kits/native/include", ] defines = [ - "APP_LOG_TAG = \"formSystemTestServiceA\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"formSystemTestServiceA\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("formSystemTestServiceA") { diff --git a/test/resource/formsystemtestability/formSystemTestServiceA/src/form_st_service_ability_A.cpp b/test/resource/formsystemtestability/formSystemTestServiceA/src/form_st_service_ability_A.cpp index 8b6c9010b8..b34df2803f 100755 --- a/test/resource/formsystemtestability/formSystemTestServiceA/src/form_st_service_ability_A.cpp +++ b/test/resource/formsystemtestability/formSystemTestServiceA/src/form_st_service_ability_A.cpp @@ -14,7 +14,7 @@ */ #include "form_st_service_ability_A.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" #include "form_provider_client.h" @@ -43,7 +43,7 @@ FormStServiceAbilityA::~FormStServiceAbilityA() std::vector FormStServiceAbilityA::Split(std::string str, const std::string &token) { - APP_LOGI("FormStServiceAbilityA::Split"); + HILOG_INFO("FormStServiceAbilityA::Split"); std::vector splitString; while (str.size()) { @@ -63,10 +63,10 @@ std::vector FormStServiceAbilityA::Split(std::string str, const std } void FormStServiceAbilityA::StartOtherAbility() { - APP_LOGI("FormStServiceAbilityA::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", + HILOG_INFO("FormStServiceAbilityA::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", targetBundle_.c_str(), targetAbility_.c_str()); - APP_LOGI("FormStServiceAbilityA::StartOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("FormStServiceAbilityA::StartOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -89,11 +89,11 @@ void FormStServiceAbilityA::StartOtherAbility() } void FormStServiceAbilityA::ConnectOtherAbility() { - APP_LOGI( + HILOG_INFO( "FormStServiceAbilityA::ConnectOtherAbility begin targetBundleConn=%{public}s, targetAbilityConn=%{public}s", targetBundleConn_.c_str(), targetAbilityConn_.c_str()); - APP_LOGI("FormStServiceAbilityA::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("FormStServiceAbilityA::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -112,35 +112,35 @@ void FormStServiceAbilityA::ConnectOtherAbility() want.SetParam("targetAbilityConn", nextTargetAbilityConn_); stub_ = new (std::nothrow) AbilityConnectCallback(); connCallback_ = new (std::nothrow) AbilityConnectionProxy(stub_); - APP_LOGI("FormStServiceAbilityA::ConnectOtherAbility->ConnectAbility"); + HILOG_INFO("FormStServiceAbilityA::ConnectOtherAbility->ConnectAbility"); bool ret = ConnectAbility(want, connCallback_); sleep(1); if (!ret) { - APP_LOGE("FormStServiceAbilityA::ConnectAbility failed!"); + HILOG_ERROR("FormStServiceAbilityA::ConnectAbility failed!"); } } } } void FormStServiceAbilityA::DisConnectOtherAbility() { - APP_LOGI("FormStServiceAbilityA::DisConnectOtherAbility begin"); + HILOG_INFO("FormStServiceAbilityA::DisConnectOtherAbility begin"); if (connCallback_ != nullptr) { DisconnectAbility(connCallback_); sleep(1); } - APP_LOGI("FormStServiceAbilityA::DisConnectOtherAbility end"); + HILOG_INFO("FormStServiceAbilityA::DisConnectOtherAbility end"); } void FormStServiceAbilityA::StopSelfAbility() { - APP_LOGI("FormStServiceAbilityA::StopSelfAbility"); + HILOG_INFO("FormStServiceAbilityA::StopSelfAbility"); TerminateAbility(); } void FormStServiceAbilityA::OnStart(const Want &want) { - APP_LOGI("FormStServiceAbilityA::OnStart"); + HILOG_INFO("FormStServiceAbilityA::OnStart"); GetWantInfo(want); Ability::OnStart(want); @@ -155,7 +155,7 @@ void FormStServiceAbilityA::OnStart(const Want &want) } void FormStServiceAbilityA::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("FormStServiceAbilityA::OnCommand"); + HILOG_INFO("FormStServiceAbilityA::OnCommand"); GetWantInfo(want); Ability::OnCommand(want, restart, startId); @@ -163,35 +163,35 @@ void FormStServiceAbilityA::OnCommand(const AAFwk::Want &want, bool restart, int } void FormStServiceAbilityA::OnNewWant(const Want &want) { - APP_LOGI("FormStServiceAbilityA::OnNewWant"); + HILOG_INFO("FormStServiceAbilityA::OnNewWant"); GetWantInfo(want); Ability::OnNewWant(want); } void FormStServiceAbilityA::OnStop() { - APP_LOGI("FormStServiceAbilityA::OnStop"); + HILOG_INFO("FormStServiceAbilityA::OnStop"); Ability::OnStop(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); } void FormStServiceAbilityA::OnActive() { - APP_LOGI("FormStServiceAbilityA::OnActive"); + HILOG_INFO("FormStServiceAbilityA::OnActive"); Ability::OnActive(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); } void FormStServiceAbilityA::OnInactive() { - APP_LOGI("FormStServiceAbilityA::OnInactive"); + HILOG_INFO("FormStServiceAbilityA::OnInactive"); Ability::OnInactive(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); } void FormStServiceAbilityA::OnBackground() { - APP_LOGI("FormStServiceAbilityA::OnBackground"); + HILOG_INFO("FormStServiceAbilityA::OnBackground"); Ability::OnBackground(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); @@ -226,7 +226,7 @@ void FormStServiceAbilityA::GetWantInfo(const Want &want) } bool FormStServiceAbilityA::PublishEvent(const std::string &eventName, const int &code, const std::string &data) { - APP_LOGI("FormStServiceAbilityA::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("FormStServiceAbilityA::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), code, data.c_str()); @@ -241,7 +241,7 @@ bool FormStServiceAbilityA::PublishEvent(const std::string &eventName, const int } sptr FormStServiceAbilityA::OnConnect(const Want &want) { - APP_LOGI("FormStServiceAbilityA::OnConnect"); + HILOG_INFO("FormStServiceAbilityA::OnConnect"); sptr formProviderClient = new (std::nothrow) FormProviderClient(); std::shared_ptr thisAbility = this->shared_from_this(); @@ -251,7 +251,7 @@ sptr FormStServiceAbilityA::OnConnect(const Want &want) } void FormStServiceAbilityA::OnDisconnect(const Want &want) { - APP_LOGI("FormStServiceAbilityA::OnDisconnect"); + HILOG_INFO("FormStServiceAbilityA::OnDisconnect"); Ability::OnDisconnect(want); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnDisconnect"); @@ -270,13 +270,13 @@ void FormStServiceAbilityA::AppEventSubscriber::OnReceiveEvent(const CommonEvent { auto eventName = data.GetWant().GetAction(); auto dataContent = data.GetData(); - APP_LOGI("FormStServiceAbilityA::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("FormStServiceAbilityA::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), dataContent.c_str()); if (APP_A_REQ_EVENT_NAME.compare(eventName) == 0) { if (funcMap_.find(dataContent) == funcMap_.end()) { - APP_LOGI( + HILOG_INFO( "FormStServiceAbilityA::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), @@ -291,10 +291,10 @@ void FormStServiceAbilityA::AppEventSubscriber::OnReceiveEvent(const CommonEvent FormProviderInfo FormStServiceAbilityA::OnCreate(const Want &want) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); FormProviderInfo formProviderInfo; if (!want.HasParameter(Constants::PARAM_FORM_IDENTITY_KEY)) { - APP_LOGE("%{public}s, formId not exist", __func__); + HILOG_ERROR("%{public}s, formId not exist", __func__); return formProviderInfo; } std::string formId = want.GetStringParam(Constants::PARAM_FORM_IDENTITY_KEY); @@ -302,38 +302,38 @@ FormProviderInfo FormStServiceAbilityA::OnCreate(const Want &want) FormProviderData formProviderData = FormProviderData(jsonData); formProviderInfo.SetFormData(formProviderData); PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnCreate"); - APP_LOGI("%{public}s end, formId: %{public}s", __func__, formId.c_str()); + HILOG_INFO("%{public}s end, formId: %{public}s", __func__, formId.c_str()); return formProviderInfo; } void FormStServiceAbilityA::OnUpdate(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnUpdate"); - APP_LOGI("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), currentTime); } void FormStServiceAbilityA::OnTriggerEvent(const int64_t formId, const std::string &message) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnTriggerEvent"); - APP_LOGI("%{public}s end, formId: %{public}s, message: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, message: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), message.c_str(), currentTime); } void FormStServiceAbilityA::OnDelete(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); @@ -341,33 +341,33 @@ void FormStServiceAbilityA::OnDelete(const int64_t formId) PublishEvent(COMMON_EVENT_ON_DELETE, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, std::to_string(formId)); - APP_LOGI("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), currentTime); } void FormStServiceAbilityA::OnCastTemptoNormal(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnCastTemptoNormal"); - APP_LOGI("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), currentTime); } void FormStServiceAbilityA::OnVisibilityChanged(const std::map &formEventsMap) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnVisibilityChanged"); - APP_LOGI("%{public}s end, current time: %{public}ld", __func__, currentTime); + HILOG_INFO("%{public}s end, current time: %{public}ld", __func__, currentTime); } REGISTER_AA(FormStServiceAbilityA); diff --git a/test/resource/formsystemtestability/formSystemTestServiceB/BUILD.gn b/test/resource/formsystemtestability/formSystemTestServiceB/BUILD.gn index bfc0de4124..856cc13e91 100644 --- a/test/resource/formsystemtestability/formSystemTestServiceB/BUILD.gn +++ b/test/resource/formsystemtestability/formSystemTestServiceB/BUILD.gn @@ -25,13 +25,14 @@ config("formSystemTestBConfig") { "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${appexecfwk_path}/services/bundlemgr/include", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${even_path}/cesfwk/innerkits/include", "${even_path}/cesfwk/kits/native/include", ] defines = [ - "APP_LOG_TAG = \"formSystemTestServiceB\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"formSystemTestServiceB\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("formSystemTestServiceB") { diff --git a/test/resource/formsystemtestability/formSystemTestServiceB/src/form_st_service_ability_B.cpp b/test/resource/formsystemtestability/formSystemTestServiceB/src/form_st_service_ability_B.cpp index fc07a7a8d3..ee8684c74b 100644 --- a/test/resource/formsystemtestability/formSystemTestServiceB/src/form_st_service_ability_B.cpp +++ b/test/resource/formsystemtestability/formSystemTestServiceB/src/form_st_service_ability_B.cpp @@ -14,7 +14,7 @@ */ #include "form_st_service_ability_B.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" #include "form_provider_client.h" @@ -42,7 +42,7 @@ FormStServiceAbilityB::~FormStServiceAbilityB() std::vector FormStServiceAbilityB::Split(std::string str, const std::string &token) { - APP_LOGI("FormStServiceAbilityB::Split"); + HILOG_INFO("FormStServiceAbilityB::Split"); std::vector splitString; while (str.size()) { @@ -62,10 +62,10 @@ std::vector FormStServiceAbilityB::Split(std::string str, const std } void FormStServiceAbilityB::StartOtherAbility() { - APP_LOGI("FormStServiceAbilityB::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", + HILOG_INFO("FormStServiceAbilityB::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", targetBundle_.c_str(), targetAbility_.c_str()); - APP_LOGI("FormStServiceAbilityB::StartOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("FormStServiceAbilityB::StartOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -88,11 +88,11 @@ void FormStServiceAbilityB::StartOtherAbility() } void FormStServiceAbilityB::ConnectOtherAbility() { - APP_LOGI( + HILOG_INFO( "FormStServiceAbilityB::ConnectOtherAbility begin targetBundleConn=%{public}s, targetAbilityConn=%{public}s", targetBundleConn_.c_str(), targetAbilityConn_.c_str()); - APP_LOGI("FormStServiceAbilityB::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("FormStServiceAbilityB::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -111,35 +111,35 @@ void FormStServiceAbilityB::ConnectOtherAbility() want.SetParam("targetAbilityConn", nextTargetAbilityConn_); stub_ = new (std::nothrow) AbilityConnectCallback(); connCallback_ = new (std::nothrow) AbilityConnectionProxy(stub_); - APP_LOGI("FormStServiceAbilityB::ConnectOtherAbility->ConnectAbility"); + HILOG_INFO("FormStServiceAbilityB::ConnectOtherAbility->ConnectAbility"); bool ret = ConnectAbility(want, connCallback_); sleep(1); if (!ret) { - APP_LOGE("FormStServiceAbilityB::ConnectAbility failed!"); + HILOG_ERROR("FormStServiceAbilityB::ConnectAbility failed!"); } } } } void FormStServiceAbilityB::DisConnectOtherAbility() { - APP_LOGI("FormStServiceAbilityB::DisConnectOtherAbility begin"); + HILOG_INFO("FormStServiceAbilityB::DisConnectOtherAbility begin"); if (connCallback_ != nullptr) { DisconnectAbility(connCallback_); sleep(1); } - APP_LOGI("FormStServiceAbilityB::DisConnectOtherAbility end"); + HILOG_INFO("FormStServiceAbilityB::DisConnectOtherAbility end"); } void FormStServiceAbilityB::StopSelfAbility() { - APP_LOGI("FormStServiceAbilityB::StopSelfAbility"); + HILOG_INFO("FormStServiceAbilityB::StopSelfAbility"); TerminateAbility(); } void FormStServiceAbilityB::OnStart(const Want &want) { - APP_LOGI("FormStServiceAbilityB::OnStart"); + HILOG_INFO("FormStServiceAbilityB::OnStart"); GetWantInfo(want); Ability::OnStart(want); @@ -154,7 +154,7 @@ void FormStServiceAbilityB::OnStart(const Want &want) } void FormStServiceAbilityB::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("FormStServiceAbilityB::OnCommand"); + HILOG_INFO("FormStServiceAbilityB::OnCommand"); GetWantInfo(want); Ability::OnCommand(want, restart, startId); @@ -162,35 +162,35 @@ void FormStServiceAbilityB::OnCommand(const AAFwk::Want &want, bool restart, int } void FormStServiceAbilityB::OnNewWant(const Want &want) { - APP_LOGI("FormStServiceAbilityB::OnNewWant"); + HILOG_INFO("FormStServiceAbilityB::OnNewWant"); GetWantInfo(want); Ability::OnNewWant(want); } void FormStServiceAbilityB::OnStop() { - APP_LOGI("FormStServiceAbilityB::OnStop"); + HILOG_INFO("FormStServiceAbilityB::OnStop"); Ability::OnStop(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); } void FormStServiceAbilityB::OnActive() { - APP_LOGI("FormStServiceAbilityB::OnActive"); + HILOG_INFO("FormStServiceAbilityB::OnActive"); Ability::OnActive(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); } void FormStServiceAbilityB::OnInactive() { - APP_LOGI("FormStServiceAbilityB::OnInactive"); + HILOG_INFO("FormStServiceAbilityB::OnInactive"); Ability::OnInactive(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); } void FormStServiceAbilityB::OnBackground() { - APP_LOGI("FormStServiceAbilityB::OnBackground"); + HILOG_INFO("FormStServiceAbilityB::OnBackground"); Ability::OnBackground(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); @@ -225,7 +225,7 @@ void FormStServiceAbilityB::GetWantInfo(const Want &want) } bool FormStServiceAbilityB::PublishEvent(const std::string &eventName, const int &code, const std::string &data) { - APP_LOGI("FormStServiceAbilityB::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("FormStServiceAbilityB::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), code, data.c_str()); @@ -240,7 +240,7 @@ bool FormStServiceAbilityB::PublishEvent(const std::string &eventName, const int } sptr FormStServiceAbilityB::OnConnect(const Want &want) { - APP_LOGI("FormStServiceAbilityB::OnConnect"); + HILOG_INFO("FormStServiceAbilityB::OnConnect"); sptr formProviderClient = new (std::nothrow) FormProviderClient(); std::shared_ptr thisAbility = this->shared_from_this(); @@ -250,7 +250,7 @@ sptr FormStServiceAbilityB::OnConnect(const Want &want) } void FormStServiceAbilityB::OnDisconnect(const Want &want) { - APP_LOGI("FormStServiceAbilityB::OnDisconnect"); + HILOG_INFO("FormStServiceAbilityB::OnDisconnect"); Ability::OnDisconnect(want); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnDisconnect"); @@ -269,13 +269,13 @@ void FormStServiceAbilityB::AppEventSubscriber::OnReceiveEvent(const CommonEvent { auto eventName = data.GetWant().GetAction(); auto dataContent = data.GetData(); - APP_LOGI("FormStServiceAbilityB::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("FormStServiceAbilityB::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), dataContent.c_str()); if (APP_A_REQ_EVENT_NAME.compare(eventName) == 0) { if (funcMap_.find(dataContent) == funcMap_.end()) { - APP_LOGI( + HILOG_INFO( "FormStServiceAbilityB::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), @@ -290,10 +290,10 @@ void FormStServiceAbilityB::AppEventSubscriber::OnReceiveEvent(const CommonEvent FormProviderInfo FormStServiceAbilityB::OnCreate(const Want &want) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); FormProviderInfo formProviderInfo; if (!want.HasParameter(Constants::PARAM_FORM_IDENTITY_KEY)) { - APP_LOGE("%{public}s, formId not exist", __func__); + HILOG_ERROR("%{public}s, formId not exist", __func__); return formProviderInfo; } std::string formId = want.GetStringParam(Constants::PARAM_FORM_IDENTITY_KEY); @@ -305,51 +305,51 @@ FormProviderInfo FormStServiceAbilityB::OnCreate(const Want &want) std::string formData = std::string("{\"city\":\"") + jsonData + std::string("\"}"); FormProviderData formProviderData = FormProviderData(formData); formProviderInfo.SetFormData(formProviderData); - APP_LOGI("%{public}s end, formId: %{public}s", __func__, formId.c_str()); + HILOG_INFO("%{public}s end, formId: %{public}s", __func__, formId.c_str()); return formProviderInfo; } void FormStServiceAbilityB::OnUpdate(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnUpdate"); - APP_LOGI("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), currentTime); } void FormStServiceAbilityB::OnTriggerEvent(const int64_t formId, const std::string &message) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnTriggerEvent"); - APP_LOGI("%{public}s end, formId: %{public}s, message: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, message: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), message.c_str(), currentTime); } void FormStServiceAbilityB::OnDelete(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnDelete"); - APP_LOGI("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), currentTime); } void FormStServiceAbilityB::OnCastTemptoNormal(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); @@ -357,13 +357,13 @@ void FormStServiceAbilityB::OnCastTemptoNormal(const int64_t formId) PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnCastTemptoNormal"); - APP_LOGI("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), currentTime); } void FormStServiceAbilityB::OnVisibilityChanged(const std::map &formEventsMap) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); @@ -371,7 +371,7 @@ void FormStServiceAbilityB::OnVisibilityChanged(const std::map PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnVisibilityChanged"); - APP_LOGI("%{public}s end, current time: %{public}ld", __func__, currentTime); + HILOG_INFO("%{public}s end, current time: %{public}ld", __func__, currentTime); } REGISTER_AA(FormStServiceAbilityB); diff --git a/test/resource/formsystemtestability/formSystemTestServiceC/BUILD.gn b/test/resource/formsystemtestability/formSystemTestServiceC/BUILD.gn index f96064c617..47013256a7 100644 --- a/test/resource/formsystemtestability/formSystemTestServiceC/BUILD.gn +++ b/test/resource/formsystemtestability/formSystemTestServiceC/BUILD.gn @@ -25,13 +25,14 @@ config("formSystemTestCConfig") { "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${appexecfwk_path}/services/bundlemgr/include", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${even_path}/cesfwk/innerkits/include", "${even_path}/cesfwk/kits/native/include", ] defines = [ - "APP_LOG_TAG = \"formSystemTestServiceC\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"formSystemTestServiceC\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("formSystemTestServiceC") { diff --git a/test/resource/formsystemtestability/formSystemTestServiceC/src/form_st_service_ability_C.cpp b/test/resource/formsystemtestability/formSystemTestServiceC/src/form_st_service_ability_C.cpp index 24d64b59b6..aa8b80127f 100644 --- a/test/resource/formsystemtestability/formSystemTestServiceC/src/form_st_service_ability_C.cpp +++ b/test/resource/formsystemtestability/formSystemTestServiceC/src/form_st_service_ability_C.cpp @@ -14,7 +14,7 @@ */ #include "form_st_service_ability_C.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" #include "form_provider_client.h" @@ -42,7 +42,7 @@ FormStServiceAbilityC::~FormStServiceAbilityC() std::vector FormStServiceAbilityC::Split(std::string str, const std::string &token) { - APP_LOGI("FormStServiceAbilityC::Split"); + HILOG_INFO("FormStServiceAbilityC::Split"); std::vector splitString; while (str.size()) { @@ -62,10 +62,10 @@ std::vector FormStServiceAbilityC::Split(std::string str, const std } void FormStServiceAbilityC::StartOtherAbility() { - APP_LOGI("FormStServiceAbilityC::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", + HILOG_INFO("FormStServiceAbilityC::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", targetBundle_.c_str(), targetAbility_.c_str()); - APP_LOGI("FormStServiceAbilityC::StartOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("FormStServiceAbilityC::StartOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -88,11 +88,11 @@ void FormStServiceAbilityC::StartOtherAbility() } void FormStServiceAbilityC::ConnectOtherAbility() { - APP_LOGI( + HILOG_INFO( "FormStServiceAbilityC::ConnectOtherAbility begin targetBundleConn=%{public}s, targetAbilityConn=%{public}s", targetBundleConn_.c_str(), targetAbilityConn_.c_str()); - APP_LOGI("FormStServiceAbilityC::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("FormStServiceAbilityC::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -111,35 +111,35 @@ void FormStServiceAbilityC::ConnectOtherAbility() want.SetParam("targetAbilityConn", nextTargetAbilityConn_); stub_ = new (std::nothrow) AbilityConnectCallback(); connCallback_ = new (std::nothrow) AbilityConnectionProxy(stub_); - APP_LOGI("FormStServiceAbilityC::ConnectOtherAbility->ConnectAbility"); + HILOG_INFO("FormStServiceAbilityC::ConnectOtherAbility->ConnectAbility"); bool ret = ConnectAbility(want, connCallback_); sleep(1); if (!ret) { - APP_LOGE("FormStServiceAbilityC::ConnectAbility failed!"); + HILOG_ERROR("FormStServiceAbilityC::ConnectAbility failed!"); } } } } void FormStServiceAbilityC::DisConnectOtherAbility() { - APP_LOGI("FormStServiceAbilityC::DisConnectOtherAbility begin"); + HILOG_INFO("FormStServiceAbilityC::DisConnectOtherAbility begin"); if (connCallback_ != nullptr) { DisconnectAbility(connCallback_); sleep(1); } - APP_LOGI("FormStServiceAbilityC::DisConnectOtherAbility end"); + HILOG_INFO("FormStServiceAbilityC::DisConnectOtherAbility end"); } void FormStServiceAbilityC::StopSelfAbility() { - APP_LOGI("FormStServiceAbilityC::StopSelfAbility"); + HILOG_INFO("FormStServiceAbilityC::StopSelfAbility"); TerminateAbility(); } void FormStServiceAbilityC::OnStart(const Want &want) { - APP_LOGI("FormStServiceAbilityC::OnStart"); + HILOG_INFO("FormStServiceAbilityC::OnStart"); GetWantInfo(want); Ability::OnStart(want); @@ -154,7 +154,7 @@ void FormStServiceAbilityC::OnStart(const Want &want) } void FormStServiceAbilityC::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("FormStServiceAbilityC::OnCommand"); + HILOG_INFO("FormStServiceAbilityC::OnCommand"); GetWantInfo(want); Ability::OnCommand(want, restart, startId); @@ -162,35 +162,35 @@ void FormStServiceAbilityC::OnCommand(const AAFwk::Want &want, bool restart, int } void FormStServiceAbilityC::OnNewWant(const Want &want) { - APP_LOGI("FormStServiceAbilityC::OnNewWant"); + HILOG_INFO("FormStServiceAbilityC::OnNewWant"); GetWantInfo(want); Ability::OnNewWant(want); } void FormStServiceAbilityC::OnStop() { - APP_LOGI("FormStServiceAbilityC::OnStop"); + HILOG_INFO("FormStServiceAbilityC::OnStop"); Ability::OnStop(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); } void FormStServiceAbilityC::OnActive() { - APP_LOGI("FormStServiceAbilityC::OnActive"); + HILOG_INFO("FormStServiceAbilityC::OnActive"); Ability::OnActive(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); } void FormStServiceAbilityC::OnInactive() { - APP_LOGI("FormStServiceAbilityC::OnInactive"); + HILOG_INFO("FormStServiceAbilityC::OnInactive"); Ability::OnInactive(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); } void FormStServiceAbilityC::OnBackground() { - APP_LOGI("FormStServiceAbilityC::OnBackground"); + HILOG_INFO("FormStServiceAbilityC::OnBackground"); Ability::OnBackground(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); @@ -225,7 +225,7 @@ void FormStServiceAbilityC::GetWantInfo(const Want &want) } bool FormStServiceAbilityC::PublishEvent(const std::string &eventName, const int &code, const std::string &data) { - APP_LOGI("FormStServiceAbilityC::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("FormStServiceAbilityC::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), code, data.c_str()); @@ -240,7 +240,7 @@ bool FormStServiceAbilityC::PublishEvent(const std::string &eventName, const int } sptr FormStServiceAbilityC::OnConnect(const Want &want) { - APP_LOGI("FormStServiceAbilityC::OnConnect"); + HILOG_INFO("FormStServiceAbilityC::OnConnect"); sptr formProviderClient = new (std::nothrow) FormProviderClient(); std::shared_ptr thisAbility = this->shared_from_this(); @@ -250,7 +250,7 @@ sptr FormStServiceAbilityC::OnConnect(const Want &want) } void FormStServiceAbilityC::OnDisconnect(const Want &want) { - APP_LOGI("FormStServiceAbilityC::OnDisconnect"); + HILOG_INFO("FormStServiceAbilityC::OnDisconnect"); Ability::OnDisconnect(want); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnDisconnect"); @@ -269,13 +269,13 @@ void FormStServiceAbilityC::AppEventSubscriber::OnReceiveEvent(const CommonEvent { auto eventName = data.GetWant().GetAction(); auto dataContent = data.GetData(); - APP_LOGI("FormStServiceAbilityC::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("FormStServiceAbilityC::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), dataContent.c_str()); if (APP_A_REQ_EVENT_NAME.compare(eventName) == 0) { if (funcMap_.find(dataContent) == funcMap_.end()) { - APP_LOGI( + HILOG_INFO( "FormStServiceAbilityC::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), @@ -290,10 +290,10 @@ void FormStServiceAbilityC::AppEventSubscriber::OnReceiveEvent(const CommonEvent FormProviderInfo FormStServiceAbilityC::OnCreate(const Want &want) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); FormProviderInfo formProviderInfo; if (!want.HasParameter(Constants::PARAM_FORM_IDENTITY_KEY)) { - APP_LOGE("%{public}s, formId not exist", __func__); + HILOG_ERROR("%{public}s, formId not exist", __func__); return formProviderInfo; } std::string formId = want.GetStringParam(Constants::PARAM_FORM_IDENTITY_KEY); @@ -301,51 +301,51 @@ FormProviderInfo FormStServiceAbilityC::OnCreate(const Want &want) FormProviderData formProviderData = FormProviderData(jsonData); formProviderInfo.SetFormData(formProviderData); PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnCreate"); - APP_LOGI("%{public}s end, formId: %{public}s", __func__, formId.c_str()); + HILOG_INFO("%{public}s end, formId: %{public}s", __func__, formId.c_str()); return formProviderInfo; } void FormStServiceAbilityC::OnUpdate(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnUpdate"); - APP_LOGI("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), currentTime); } void FormStServiceAbilityC::OnTriggerEvent(const int64_t formId, const std::string &message) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnTriggerEvent"); - APP_LOGI("%{public}s end, formId: %{public}s, message: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, message: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), message.c_str(), currentTime); } void FormStServiceAbilityC::OnDelete(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnDelete"); - APP_LOGI("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), currentTime); } void FormStServiceAbilityC::OnCastTemptoNormal(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); @@ -353,13 +353,13 @@ void FormStServiceAbilityC::OnCastTemptoNormal(const int64_t formId) PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnCastTemptoNormal"); - APP_LOGI("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), currentTime); } void FormStServiceAbilityC::OnVisibilityChanged(const std::map &formEventsMap) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); @@ -367,7 +367,7 @@ void FormStServiceAbilityC::OnVisibilityChanged(const std::map PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnVisibilityChanged"); - APP_LOGI("%{public}s end, current time: %{public}ld", __func__, currentTime); + HILOG_INFO("%{public}s end, current time: %{public}ld", __func__, currentTime); } REGISTER_AA(FormStServiceAbilityC); diff --git a/test/resource/formsystemtestability/formSystemTestServiceD/BUILD.gn b/test/resource/formsystemtestability/formSystemTestServiceD/BUILD.gn index c802c5ca5e..4bb5a91609 100644 --- a/test/resource/formsystemtestability/formSystemTestServiceD/BUILD.gn +++ b/test/resource/formsystemtestability/formSystemTestServiceD/BUILD.gn @@ -25,13 +25,14 @@ config("formSystemTestDConfig") { "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${appexecfwk_path}/services/bundlemgr/include", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${even_path}/cesfwk/innerkits/include", "${even_path}/cesfwk/kits/native/include", ] defines = [ - "APP_LOG_TAG = \"formSystemTestServiceD\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"formSystemTestServiceD\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("formSystemTestServiceD") { diff --git a/test/resource/formsystemtestability/formSystemTestServiceD/src/form_st_service_ability_D.cpp b/test/resource/formsystemtestability/formSystemTestServiceD/src/form_st_service_ability_D.cpp index f4988dacef..2e61bba93c 100644 --- a/test/resource/formsystemtestability/formSystemTestServiceD/src/form_st_service_ability_D.cpp +++ b/test/resource/formsystemtestability/formSystemTestServiceD/src/form_st_service_ability_D.cpp @@ -14,7 +14,7 @@ */ #include "form_st_service_ability_D.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" #include "form_provider_client.h" @@ -42,7 +42,7 @@ FormStServiceAbilityD::~FormStServiceAbilityD() std::vector FormStServiceAbilityD::Split(std::string str, const std::string &token) { - APP_LOGI("FormStServiceAbilityD::Split"); + HILOG_INFO("FormStServiceAbilityD::Split"); std::vector splitString; while (str.size()) { @@ -62,10 +62,10 @@ std::vector FormStServiceAbilityD::Split(std::string str, const std } void FormStServiceAbilityD::StartOtherAbility() { - APP_LOGI("FormStServiceAbilityD::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", + HILOG_INFO("FormStServiceAbilityD::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", targetBundle_.c_str(), targetAbility_.c_str()); - APP_LOGI("FormStServiceAbilityD::StartOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("FormStServiceAbilityD::StartOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -88,11 +88,11 @@ void FormStServiceAbilityD::StartOtherAbility() } void FormStServiceAbilityD::ConnectOtherAbility() { - APP_LOGI( + HILOG_INFO( "FormStServiceAbilityD::ConnectOtherAbility begin targetBundleConn=%{public}s, targetAbilityConn=%{public}s", targetBundleConn_.c_str(), targetAbilityConn_.c_str()); - APP_LOGI("FormStServiceAbilityD::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("FormStServiceAbilityD::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -111,35 +111,35 @@ void FormStServiceAbilityD::ConnectOtherAbility() want.SetParam("targetAbilityConn", nextTargetAbilityConn_); stub_ = new (std::nothrow) AbilityConnectCallback(); connCallback_ = new (std::nothrow) AbilityConnectionProxy(stub_); - APP_LOGI("FormStServiceAbilityD::ConnectOtherAbility->ConnectAbility"); + HILOG_INFO("FormStServiceAbilityD::ConnectOtherAbility->ConnectAbility"); bool ret = ConnectAbility(want, connCallback_); sleep(1); if (!ret) { - APP_LOGE("FormStServiceAbilityD::ConnectAbility failed!"); + HILOG_ERROR("FormStServiceAbilityD::ConnectAbility failed!"); } } } } void FormStServiceAbilityD::DisConnectOtherAbility() { - APP_LOGI("FormStServiceAbilityD::DisConnectOtherAbility begin"); + HILOG_INFO("FormStServiceAbilityD::DisConnectOtherAbility begin"); if (connCallback_ != nullptr) { DisconnectAbility(connCallback_); sleep(1); } - APP_LOGI("FormStServiceAbilityD::DisConnectOtherAbility end"); + HILOG_INFO("FormStServiceAbilityD::DisConnectOtherAbility end"); } void FormStServiceAbilityD::StopSelfAbility() { - APP_LOGI("FormStServiceAbilityD::StopSelfAbility"); + HILOG_INFO("FormStServiceAbilityD::StopSelfAbility"); TerminateAbility(); } void FormStServiceAbilityD::OnStart(const Want &want) { - APP_LOGI("FormStServiceAbilityD::OnStart"); + HILOG_INFO("FormStServiceAbilityD::OnStart"); GetWantInfo(want); Ability::OnStart(want); @@ -154,7 +154,7 @@ void FormStServiceAbilityD::OnStart(const Want &want) } void FormStServiceAbilityD::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("FormStServiceAbilityD::OnCommand"); + HILOG_INFO("FormStServiceAbilityD::OnCommand"); GetWantInfo(want); Ability::OnCommand(want, restart, startId); @@ -162,35 +162,35 @@ void FormStServiceAbilityD::OnCommand(const AAFwk::Want &want, bool restart, int } void FormStServiceAbilityD::OnNewWant(const Want &want) { - APP_LOGI("FormStServiceAbilityD::OnNewWant"); + HILOG_INFO("FormStServiceAbilityD::OnNewWant"); GetWantInfo(want); Ability::OnNewWant(want); } void FormStServiceAbilityD::OnStop() { - APP_LOGI("FormStServiceAbilityD::OnStop"); + HILOG_INFO("FormStServiceAbilityD::OnStop"); Ability::OnStop(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); } void FormStServiceAbilityD::OnActive() { - APP_LOGI("FormStServiceAbilityD::OnActive"); + HILOG_INFO("FormStServiceAbilityD::OnActive"); Ability::OnActive(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); } void FormStServiceAbilityD::OnInactive() { - APP_LOGI("FormStServiceAbilityD::OnInactive"); + HILOG_INFO("FormStServiceAbilityD::OnInactive"); Ability::OnInactive(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); } void FormStServiceAbilityD::OnBackground() { - APP_LOGI("FormStServiceAbilityD::OnBackground"); + HILOG_INFO("FormStServiceAbilityD::OnBackground"); Ability::OnBackground(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); @@ -225,7 +225,7 @@ void FormStServiceAbilityD::GetWantInfo(const Want &want) } bool FormStServiceAbilityD::PublishEvent(const std::string &eventName, const int &code, const std::string &data) { - APP_LOGI("FormStServiceAbilityD::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("FormStServiceAbilityD::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), code, data.c_str()); @@ -240,7 +240,7 @@ bool FormStServiceAbilityD::PublishEvent(const std::string &eventName, const int } sptr FormStServiceAbilityD::OnConnect(const Want &want) { - APP_LOGI("FormStServiceAbilityD::OnConnect"); + HILOG_INFO("FormStServiceAbilityD::OnConnect"); sptr formProviderClient = new (std::nothrow) FormProviderClient(); std::shared_ptr thisAbility = this->shared_from_this(); @@ -250,7 +250,7 @@ sptr FormStServiceAbilityD::OnConnect(const Want &want) } void FormStServiceAbilityD::OnDisconnect(const Want &want) { - APP_LOGI("FormStServiceAbilityD::OnDisconnect"); + HILOG_INFO("FormStServiceAbilityD::OnDisconnect"); Ability::OnDisconnect(want); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnDisconnect"); @@ -269,13 +269,13 @@ void FormStServiceAbilityD::AppEventSubscriber::OnReceiveEvent(const CommonEvent { auto eventName = data.GetWant().GetAction(); auto dataContent = data.GetData(); - APP_LOGI("FormStServiceAbilityD::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("FormStServiceAbilityD::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), dataContent.c_str()); if (APP_A_REQ_EVENT_NAME.compare(eventName) == 0) { if (funcMap_.find(dataContent) == funcMap_.end()) { - APP_LOGI( + HILOG_INFO( "FormStServiceAbilityD::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), @@ -290,10 +290,10 @@ void FormStServiceAbilityD::AppEventSubscriber::OnReceiveEvent(const CommonEvent FormProviderInfo FormStServiceAbilityD::OnCreate(const Want &want) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); FormProviderInfo formProviderInfo; if (!want.HasParameter(Constants::PARAM_FORM_IDENTITY_KEY)) { - APP_LOGE("%{public}s, formId not exist", __func__); + HILOG_ERROR("%{public}s, formId not exist", __func__); return formProviderInfo; } std::string formId = want.GetStringParam(Constants::PARAM_FORM_IDENTITY_KEY); @@ -301,51 +301,51 @@ FormProviderInfo FormStServiceAbilityD::OnCreate(const Want &want) FormProviderData formProviderData = FormProviderData(jsonData); formProviderInfo.SetFormData(formProviderData); PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnCreate"); - APP_LOGI("%{public}s end, formId: %{public}s", __func__, formId.c_str()); + HILOG_INFO("%{public}s end, formId: %{public}s", __func__, formId.c_str()); return formProviderInfo; } void FormStServiceAbilityD::OnUpdate(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnUpdate"); - APP_LOGI("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), currentTime); } void FormStServiceAbilityD::OnTriggerEvent(const int64_t formId, const std::string &message) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnTriggerEvent"); - APP_LOGI("%{public}s end, formId: %{public}s, message: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, message: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), message.c_str(), currentTime); } void FormStServiceAbilityD::OnDelete(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnDelete"); - APP_LOGI("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), currentTime); } void FormStServiceAbilityD::OnCastTemptoNormal(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); @@ -353,13 +353,13 @@ void FormStServiceAbilityD::OnCastTemptoNormal(const int64_t formId) PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnCastTemptoNormal"); - APP_LOGI("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), currentTime); } void FormStServiceAbilityD::OnVisibilityChanged(const std::map &formEventsMap) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); @@ -367,7 +367,7 @@ void FormStServiceAbilityD::OnVisibilityChanged(const std::map PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnVisibilityChanged"); - APP_LOGI("%{public}s end, current time: %{public}ld", __func__, currentTime); + HILOG_INFO("%{public}s end, current time: %{public}ld", __func__, currentTime); } REGISTER_AA(FormStServiceAbilityD); diff --git a/test/resource/formsystemtestability/formSystemTestServiceE/BUILD.gn b/test/resource/formsystemtestability/formSystemTestServiceE/BUILD.gn index 113c6838b1..0f67bbb5a7 100644 --- a/test/resource/formsystemtestability/formSystemTestServiceE/BUILD.gn +++ b/test/resource/formsystemtestability/formSystemTestServiceE/BUILD.gn @@ -25,13 +25,14 @@ config("formSystemTestEConfig") { "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "${appexecfwk_path}/services/bundlemgr/include", "${aafwk_path}/services/abilitymgr/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${even_path}/cesfwk/innerkits/include", "${even_path}/cesfwk/kits/native/include", ] defines = [ - "APP_LOG_TAG = \"formSystemTestServiceE\"", - "LOG_DOMAIN = 0xD002200", + "AMS_LOG_TAG = \"formSystemTestServiceE\"", + "AMS_LOG_DOMAIN = 0xD002200", ] } ohos_shared_library("formSystemTestServiceE") { diff --git a/test/resource/formsystemtestability/formSystemTestServiceE/src/form_st_service_ability_E.cpp b/test/resource/formsystemtestability/formSystemTestServiceE/src/form_st_service_ability_E.cpp index bfcc357b11..364702ab18 100644 --- a/test/resource/formsystemtestability/formSystemTestServiceE/src/form_st_service_ability_E.cpp +++ b/test/resource/formsystemtestability/formSystemTestServiceE/src/form_st_service_ability_E.cpp @@ -14,7 +14,7 @@ */ #include "form_st_service_ability_E.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" #include "form_provider_client.h" @@ -42,7 +42,7 @@ FormStServiceAbilityE::~FormStServiceAbilityE() std::vector FormStServiceAbilityE::Split(std::string str, const std::string &token) { - APP_LOGI("FormStServiceAbilityE::Split"); + HILOG_INFO("FormStServiceAbilityE::Split"); std::vector splitString; while (str.size()) { @@ -62,10 +62,10 @@ std::vector FormStServiceAbilityE::Split(std::string str, const std } void FormStServiceAbilityE::StartOtherAbility() { - APP_LOGI("FormStServiceAbilityE::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", + HILOG_INFO("FormStServiceAbilityE::StartOtherAbility begin targetBundle=%{public}s, targetAbility=%{public}s", targetBundle_.c_str(), targetAbility_.c_str()); - APP_LOGI("FormStServiceAbilityE::StartOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("FormStServiceAbilityE::StartOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -88,11 +88,11 @@ void FormStServiceAbilityE::StartOtherAbility() } void FormStServiceAbilityE::ConnectOtherAbility() { - APP_LOGI( + HILOG_INFO( "FormStServiceAbilityE::ConnectOtherAbility begin targetBundleConn=%{public}s, targetAbilityConn=%{public}s", targetBundleConn_.c_str(), targetAbilityConn_.c_str()); - APP_LOGI("FormStServiceAbilityE::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " + HILOG_INFO("FormStServiceAbilityE::ConnectOtherAbility begin nextTargetBundleConn=%{public}s, " "nextTargetAbilityConn=%{public}s", nextTargetBundleConn_.c_str(), nextTargetAbilityConn_.c_str()); @@ -111,35 +111,35 @@ void FormStServiceAbilityE::ConnectOtherAbility() want.SetParam("targetAbilityConn", nextTargetAbilityConn_); stub_ = new (std::nothrow) AbilityConnectCallback(); connCallback_ = new (std::nothrow) AbilityConnectionProxy(stub_); - APP_LOGI("FormStServiceAbilityE::ConnectOtherAbility->ConnectAbility"); + HILOG_INFO("FormStServiceAbilityE::ConnectOtherAbility->ConnectAbility"); bool ret = ConnectAbility(want, connCallback_); sleep(1); if (!ret) { - APP_LOGE("FormStServiceAbilityE::ConnectAbility failed!"); + HILOG_ERROR("FormStServiceAbilityE::ConnectAbility failed!"); } } } } void FormStServiceAbilityE::DisConnectOtherAbility() { - APP_LOGI("FormStServiceAbilityE::DisConnectOtherAbility begin"); + HILOG_INFO("FormStServiceAbilityE::DisConnectOtherAbility begin"); if (connCallback_ != nullptr) { DisconnectAbility(connCallback_); sleep(1); } - APP_LOGI("FormStServiceAbilityE::DisConnectOtherAbility end"); + HILOG_INFO("FormStServiceAbilityE::DisConnectOtherAbility end"); } void FormStServiceAbilityE::StopSelfAbility() { - APP_LOGI("FormStServiceAbilityE::StopSelfAbility"); + HILOG_INFO("FormStServiceAbilityE::StopSelfAbility"); TerminateAbility(); } void FormStServiceAbilityE::OnStart(const Want &want) { - APP_LOGI("FormStServiceAbilityE::OnStart"); + HILOG_INFO("FormStServiceAbilityE::OnStart"); GetWantInfo(want); Ability::OnStart(want); @@ -154,7 +154,7 @@ void FormStServiceAbilityE::OnStart(const Want &want) } void FormStServiceAbilityE::OnCommand(const AAFwk::Want &want, bool restart, int startId) { - APP_LOGI("FormStServiceAbilityE::OnCommand"); + HILOG_INFO("FormStServiceAbilityE::OnCommand"); GetWantInfo(want); Ability::OnCommand(want, restart, startId); @@ -162,35 +162,35 @@ void FormStServiceAbilityE::OnCommand(const AAFwk::Want &want, bool restart, int } void FormStServiceAbilityE::OnNewWant(const Want &want) { - APP_LOGI("FormStServiceAbilityE::OnNewWant"); + HILOG_INFO("FormStServiceAbilityE::OnNewWant"); GetWantInfo(want); Ability::OnNewWant(want); } void FormStServiceAbilityE::OnStop() { - APP_LOGI("FormStServiceAbilityE::OnStop"); + HILOG_INFO("FormStServiceAbilityE::OnStop"); Ability::OnStop(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INITIAL, "OnStop"); } void FormStServiceAbilityE::OnActive() { - APP_LOGI("FormStServiceAbilityE::OnActive"); + HILOG_INFO("FormStServiceAbilityE::OnActive"); Ability::OnActive(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::ACTIVE, "OnActive"); } void FormStServiceAbilityE::OnInactive() { - APP_LOGI("FormStServiceAbilityE::OnInactive"); + HILOG_INFO("FormStServiceAbilityE::OnInactive"); Ability::OnInactive(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::INACTIVE, "OnInactive"); } void FormStServiceAbilityE::OnBackground() { - APP_LOGI("FormStServiceAbilityE::OnBackground"); + HILOG_INFO("FormStServiceAbilityE::OnBackground"); Ability::OnBackground(); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnBackground"); @@ -225,7 +225,7 @@ void FormStServiceAbilityE::GetWantInfo(const Want &want) } bool FormStServiceAbilityE::PublishEvent(const std::string &eventName, const int &code, const std::string &data) { - APP_LOGI("FormStServiceAbilityE::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("FormStServiceAbilityE::PublishEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), code, data.c_str()); @@ -240,7 +240,7 @@ bool FormStServiceAbilityE::PublishEvent(const std::string &eventName, const int } sptr FormStServiceAbilityE::OnConnect(const Want &want) { - APP_LOGI("FormStServiceAbilityE::OnConnect"); + HILOG_INFO("FormStServiceAbilityE::OnConnect"); sptr formProviderClient = new (std::nothrow) FormProviderClient(); std::shared_ptr thisAbility = this->shared_from_this(); @@ -250,7 +250,7 @@ sptr FormStServiceAbilityE::OnConnect(const Want &want) } void FormStServiceAbilityE::OnDisconnect(const Want &want) { - APP_LOGI("FormStServiceAbilityE::OnDisconnect"); + HILOG_INFO("FormStServiceAbilityE::OnDisconnect"); Ability::OnDisconnect(want); PublishEvent(APP_A_RESP_EVENT_NAME, AbilityLifecycleExecutor::LifecycleState::BACKGROUND, "OnDisconnect"); @@ -269,13 +269,13 @@ void FormStServiceAbilityE::AppEventSubscriber::OnReceiveEvent(const CommonEvent { auto eventName = data.GetWant().GetAction(); auto dataContent = data.GetData(); - APP_LOGI("FormStServiceAbilityE::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", + HILOG_INFO("FormStServiceAbilityE::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), dataContent.c_str()); if (APP_A_REQ_EVENT_NAME.compare(eventName) == 0) { if (funcMap_.find(dataContent) == funcMap_.end()) { - APP_LOGI( + HILOG_INFO( "FormStServiceAbilityE::OnReceiveEvent eventName = %{public}s, code = %{public}d, data = %{public}s", eventName.c_str(), data.GetCode(), @@ -290,10 +290,10 @@ void FormStServiceAbilityE::AppEventSubscriber::OnReceiveEvent(const CommonEvent FormProviderInfo FormStServiceAbilityE::OnCreate(const Want &want) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); FormProviderInfo formProviderInfo; if (!want.HasParameter(Constants::PARAM_FORM_IDENTITY_KEY)) { - APP_LOGE("%{public}s, formId not exist", __func__); + HILOG_ERROR("%{public}s, formId not exist", __func__); return formProviderInfo; } std::string formId = want.GetStringParam(Constants::PARAM_FORM_IDENTITY_KEY); @@ -301,51 +301,51 @@ FormProviderInfo FormStServiceAbilityE::OnCreate(const Want &want) FormProviderData formProviderData = FormProviderData(jsonData); formProviderInfo.SetFormData(formProviderData); PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnCreate"); - APP_LOGI("%{public}s end, formId: %{public}s", __func__, formId.c_str()); + HILOG_INFO("%{public}s end, formId: %{public}s", __func__, formId.c_str()); return formProviderInfo; } void FormStServiceAbilityE::OnUpdate(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnUpdate"); - APP_LOGI("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), currentTime); } void FormStServiceAbilityE::OnTriggerEvent(const int64_t formId, const std::string &message) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnTriggerEvent"); - APP_LOGI("%{public}s end, formId: %{public}s, message: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, message: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), message.c_str(), currentTime); } void FormStServiceAbilityE::OnDelete(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); long currentTime = ts.tv_sec * SEC_TO_MILLISEC + ts.tv_nsec / MILLISEC_TO_NANOSEC; PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnDelete"); - APP_LOGI("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), currentTime); } void FormStServiceAbilityE::OnCastTemptoNormal(const int64_t formId) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); @@ -353,13 +353,13 @@ void FormStServiceAbilityE::OnCastTemptoNormal(const int64_t formId) PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnCastTemptoNormal"); - APP_LOGI("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, + HILOG_INFO("%{public}s end, formId: %{public}s, current time: %{public}ld", __func__, std::to_string(formId).c_str(), currentTime); } void FormStServiceAbilityE::OnVisibilityChanged(const std::map &formEventsMap) { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); @@ -367,7 +367,7 @@ void FormStServiceAbilityE::OnVisibilityChanged(const std::map PublishEvent(COMMON_EVENT_TEST_ACTION1, FORM_EVENT_TRIGGER_RESULT::FORM_EVENT_TRIGGER_RESULT_OK, "OnVisibilityChanged"); - APP_LOGI("%{public}s end, current time: %{public}ld", __func__, currentTime); + HILOG_INFO("%{public}s end, current time: %{public}ld", __func__, currentTime); } REGISTER_AA(FormStServiceAbilityE); diff --git a/test/systemtest/common/ams/BUILD.gn b/test/systemtest/common/ams/BUILD.gn index 950b5b9d13..d7e4a35259 100755 --- a/test/systemtest/common/ams/BUILD.gn +++ b/test/systemtest/common/ams/BUILD.gn @@ -16,8 +16,8 @@ import("//foundation/appexecfwk/standard/appexecfwk.gni") config("ams_system_test_config") { defines = [ - # "APP_LOG_TAG = \"AmsSystemTest\"", - # "LOG_DOMAIN = 0xD00111F", + # "AMS_LOG_TAG = \"AmsSystemTest\"", + # "AMS_LOG_DOMAIN = 0xD00111F", ] configs = [ diff --git a/test/systemtest/common/ams/ams_ability_state_age_manual_test/BUILD.gn b/test/systemtest/common/ams/ams_ability_state_age_manual_test/BUILD.gn index 4079e50d3c..24d3f6febf 100644 --- a/test/systemtest/common/ams/ams_ability_state_age_manual_test/BUILD.gn +++ b/test/systemtest/common/ams/ams_ability_state_age_manual_test/BUILD.gn @@ -19,6 +19,15 @@ module_output_path = "appexecfwk_standard/ams/" config("system_test_ams_ability_state_age_manual_test_config") { include_dirs = [ "//foundation/aafwk/standard/frameworks/kits/appkit/native/app/include", + "${aafwk_path}/interfaces/innerkits/intent/include", + "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core/include/bundlemgr", + "${aafwk_path}/interfaces/innerkits/want/include", + "//utils/system/safwk/native/include", + "${aafwk_path}/interfaces/innerkits/app_manager/include/appmgr", + "${aafwk_path}/frameworks/kits/ability/native/include", + "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", + "//third_party/json/include", + "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", ] cflags = [] if (target_cpu == "arm") { @@ -46,7 +55,8 @@ ohos_systemtest("ams_ability_state_age_manual_test") { configs = [ "${aafwk_path}/services/abilitymgr:abilityms_config", "${aafwk_path}/services/appmgr:appmgr_config", - "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_config", + + # "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_config", ":system_test_ams_ability_state_age_manual_test_config", "//foundation/appexecfwk/standard/test/systemtest/common/ams/tool/:system_test_ability_util_config", diff --git a/test/systemtest/common/ams/ams_ability_state_test/BUILD.gn b/test/systemtest/common/ams/ams_ability_state_test/BUILD.gn index 926fbe5dd4..bf903032e8 100644 --- a/test/systemtest/common/ams/ams_ability_state_test/BUILD.gn +++ b/test/systemtest/common/ams/ams_ability_state_test/BUILD.gn @@ -19,6 +19,15 @@ module_output_path = "appexecfwk_standard/ams/" config("system_test_ams_ability_state_test_config") { include_dirs = [ "//foundation/aafwk/standard/frameworks/kits/appkit/native/app/include", + "${aafwk_path}/interfaces/innerkits/intent/include", + "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core/include/bundlemgr", + "${aafwk_path}/interfaces/innerkits/want/include", + "//utils/system/safwk/native/include", + "${aafwk_path}/interfaces/innerkits/app_manager/include/appmgr", + "${aafwk_path}/frameworks/kits/ability/native/include", + "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", + "//third_party/json/include", + "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", ] cflags = [] if (target_cpu == "arm") { @@ -46,7 +55,8 @@ ohos_systemtest("ams_ability_state_test") { configs = [ "${aafwk_path}/services/abilitymgr:abilityms_config", "${aafwk_path}/services/appmgr:appmgr_config", - "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_config", + + # "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_config", ":system_test_ams_ability_state_test_config", "//foundation/appexecfwk/standard/test/systemtest/common/ams/tool/:system_test_ability_util_config", diff --git a/test/systemtest/common/ams/ams_check_service/BUILD.gn b/test/systemtest/common/ams/ams_check_service/BUILD.gn index 0ed3e287fc..39c2cf6920 100644 --- a/test/systemtest/common/ams/ams_check_service/BUILD.gn +++ b/test/systemtest/common/ams/ams_check_service/BUILD.gn @@ -19,6 +19,15 @@ module_output_path = "appexecfwk_standard/ams/" config("ams_check_service_config") { include_dirs = [ "//foundation/aafwk/standard/frameworks/kits/appkit/native/app/include", + "${aafwk_path}/interfaces/innerkits/intent/include", + "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core/include/bundlemgr", + "${aafwk_path}/interfaces/innerkits/want/include", + "//utils/system/safwk/native/include", + "${aafwk_path}/interfaces/innerkits/app_manager/include/appmgr", + "${aafwk_path}/frameworks/kits/ability/native/include", + "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", + "//third_party/json/include", + "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", ] cflags = [] if (target_cpu == "arm") { @@ -46,7 +55,8 @@ ohos_systemtest("ams_check_service") { configs = [ "${aafwk_path}/services/abilitymgr:abilityms_config", "${aafwk_path}/services/appmgr:appmgr_config", - "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_config", + + # "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_config", ":ams_check_service_config", "//foundation/appexecfwk/standard/test/systemtest/common/ams/tool/:system_test_ability_util_config", "//foundation/appexecfwk/standard/libs/libeventhandler:libeventhandler_config", diff --git a/test/systemtest/common/fms/BUILD.gn b/test/systemtest/common/fms/BUILD.gn index 2c34894a86..80b7d9ff97 100755 --- a/test/systemtest/common/fms/BUILD.gn +++ b/test/systemtest/common/fms/BUILD.gn @@ -16,8 +16,8 @@ import("//foundation/appexecfwk/standard/appexecfwk.gni") config("form_manager_test_config") { defines = [ - "APP_LOG_TAG = \"FormManagerTest\"", - "LOG_DOMAIN = 0xD00666F", + "AMS_LOG_TAG = \"FormManagerTest\"", + "AMS_LOG_DOMAIN = 0xD00666F", ] configs = [ diff --git a/test/systemtest/common/fms/fms_acquire_form_test/BUILD.gn b/test/systemtest/common/fms/fms_acquire_form_test/BUILD.gn index 7391847ab9..9b9812f0e0 100644 --- a/test/systemtest/common/fms/fms_acquire_form_test/BUILD.gn +++ b/test/systemtest/common/fms/fms_acquire_form_test/BUILD.gn @@ -50,7 +50,7 @@ ohos_systemtest("FmsAcquireFormTest") { "//third_party/googletest:gtest_main", ] - defines = [ "APP_LOG_TAG = \"FMSAcquireFormTest\"" ] + defines = [ "AMS_LOG_TAG = \"FMSAcquireFormTest\"" ] external_deps = [ "ability_base:base", diff --git a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp index f6ec766758..349e9550d9 100644 --- a/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test/fms_acquire_form_test.cpp @@ -22,7 +22,7 @@ #include "ability_info.h" #include "ability_local_record.h" #include "ability_start_setting.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" #include "context_deal.h" diff --git a/test/systemtest/common/fms/fms_acquire_form_test_max/BUILD.gn b/test/systemtest/common/fms/fms_acquire_form_test_max/BUILD.gn index d29328ea20..3fcd8ba543 100644 --- a/test/systemtest/common/fms/fms_acquire_form_test_max/BUILD.gn +++ b/test/systemtest/common/fms/fms_acquire_form_test_max/BUILD.gn @@ -50,7 +50,7 @@ ohos_systemtest("FmsAcquireFormTestMax") { "//third_party/googletest:gtest_main", ] - defines = [ "APP_LOG_TAG = \"FMSAcquireFormTestMax\"" ] + defines = [ "AMS_LOG_TAG = \"FMSAcquireFormTestMax\"" ] external_deps = [ "ability_base:base", diff --git a/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp b/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp index 197ced8c13..a88ad8810f 100644 --- a/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_batch.cpp @@ -22,7 +22,7 @@ #include "ability_info.h" #include "ability_local_record.h" #include "ability_start_setting.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" #include "context_deal.h" diff --git a/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_max.cpp b/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_max.cpp index a37652d27e..171042f74e 100644 --- a/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_max.cpp +++ b/test/systemtest/common/fms/fms_acquire_form_test_max/fms_acquire_form_test_max.cpp @@ -22,7 +22,7 @@ #include "ability_info.h" #include "ability_local_record.h" #include "ability_start_setting.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" #include "context_deal.h" diff --git a/test/systemtest/common/fms/fms_delete_form_test/BUILD.gn b/test/systemtest/common/fms/fms_delete_form_test/BUILD.gn index a4add6d37f..7f5cf61c35 100644 --- a/test/systemtest/common/fms/fms_delete_form_test/BUILD.gn +++ b/test/systemtest/common/fms/fms_delete_form_test/BUILD.gn @@ -50,7 +50,7 @@ ohos_systemtest("FormDeleteFormTest") { "//third_party/googletest:gtest_main", ] - defines = [ "APP_LOG_TAG = \"FMSDeleteFormTest\"" ] + defines = [ "AMS_LOG_TAG = \"FMSDeleteFormTest\"" ] external_deps = [ "ability_base:base", diff --git a/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp b/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp index 045002daac..60b14f3745 100644 --- a/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp +++ b/test/systemtest/common/fms/fms_delete_form_test/fms_delete_form_test.cpp @@ -22,7 +22,7 @@ #include "ability_info.h" #include "ability_local_record.h" #include "ability_start_setting.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" #include "context_deal.h" diff --git a/test/systemtest/common/fms/fms_fuzz_test/BUILD.gn b/test/systemtest/common/fms/fms_fuzz_test/BUILD.gn index 74d95b2ff4..988fd66ee0 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/BUILD.gn +++ b/test/systemtest/common/fms/fms_fuzz_test/BUILD.gn @@ -50,7 +50,7 @@ ohos_systemtest("fmsFuzzTest") { "//third_party/googletest:gtest_main", ] - defines = [ "APP_LOG_TAG = \"fmsFuzzTest\"" ] + defines = [ "AMS_LOG_TAG = \"fmsFuzzTest\"" ] external_deps = [ "ability_base:base", diff --git a/test/systemtest/common/fms/fms_fuzz_test/src/fms_fuzz_test.cpp b/test/systemtest/common/fms/fms_fuzz_test/src/fms_fuzz_test.cpp index ee78075c9c..c01e39b3ef 100755 --- a/test/systemtest/common/fms/fms_fuzz_test/src/fms_fuzz_test.cpp +++ b/test/systemtest/common/fms/fms_fuzz_test/src/fms_fuzz_test.cpp @@ -18,7 +18,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "../include/fuzz_test_manager.h" #include "../include/get_param.h" #include "nlohmann/json.hpp" diff --git a/test/systemtest/common/fms/fms_performance_test/BUILD.gn b/test/systemtest/common/fms/fms_performance_test/BUILD.gn index 762b962fe3..9ebac2a92b 100755 --- a/test/systemtest/common/fms/fms_performance_test/BUILD.gn +++ b/test/systemtest/common/fms/fms_performance_test/BUILD.gn @@ -50,7 +50,7 @@ ohos_systemtest("FmsPerformanceTest") { "//third_party/googletest:gtest_main", ] - defines = [ "APP_LOG_TAG = \"FmsPerformanceTest\"" ] + defines = [ "AMS_LOG_TAG = \"FmsPerformanceTest\"" ] external_deps = [ "ability_base:base", diff --git a/test/systemtest/common/fms/fms_performance_test/fms_performance_test.cpp b/test/systemtest/common/fms/fms_performance_test/fms_performance_test.cpp index d9093e5201..f41b2b7c90 100755 --- a/test/systemtest/common/fms/fms_performance_test/fms_performance_test.cpp +++ b/test/systemtest/common/fms/fms_performance_test/fms_performance_test.cpp @@ -20,7 +20,7 @@ #include #include -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "ability_handler.h" #include "ability_info.h" #include "ability_local_record.h" diff --git a/test/systemtest/common/fms/fms_release_form_test/BUILD.gn b/test/systemtest/common/fms/fms_release_form_test/BUILD.gn index 55a314dfcc..9e75c00aac 100644 --- a/test/systemtest/common/fms/fms_release_form_test/BUILD.gn +++ b/test/systemtest/common/fms/fms_release_form_test/BUILD.gn @@ -50,7 +50,7 @@ ohos_systemtest("FormReleaseFormTest") { "//third_party/googletest:gtest_main", ] - defines = [ "APP_LOG_TAG = \"FMSReleaseFormTest\"" ] + defines = [ "AMS_LOG_TAG = \"FMSReleaseFormTest\"" ] external_deps = [ "ability_base:base", diff --git a/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp b/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp index f12f44272e..4ddd768518 100644 --- a/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp +++ b/test/systemtest/common/fms/fms_release_form_test/fms_release_form_test.cpp @@ -22,7 +22,7 @@ #include "ability_info.h" #include "ability_local_record.h" #include "ability_start_setting.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" #include "context_deal.h" diff --git a/test/systemtest/common/fms/fms_self_starting_test/BUILD.gn b/test/systemtest/common/fms/fms_self_starting_test/BUILD.gn index 7dc12830ef..2cd0707dc4 100644 --- a/test/systemtest/common/fms/fms_self_starting_test/BUILD.gn +++ b/test/systemtest/common/fms/fms_self_starting_test/BUILD.gn @@ -55,7 +55,7 @@ ohos_systemtest("FmsSelfStartingTest") { "//third_party/googletest:gtest_main", ] - defines = [ "APP_LOG_TAG = \"FmsSelfStartingTest\"" ] + defines = [ "AMS_LOG_TAG = \"FmsSelfStartingTest\"" ] external_deps = [ "ability_base:base", diff --git a/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp b/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp index 4c19a1b705..18db67bfd8 100644 --- a/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp +++ b/test/systemtest/common/fms/fms_self_starting_test/fms_self_starting_test.cpp @@ -24,7 +24,7 @@ #include "ability_info.h" #include "ability_local_record.h" #include "ability_start_setting.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" #include "context_deal.h" @@ -121,7 +121,7 @@ void FmsSelfStartingTest::SetUpTestCase() want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_FALSE); want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME1, FORM_PROVIDER_ABILITY_NAME1); - APP_LOGI("%{public}s, formCount: %{public}d", __func__, iCount + 1); + HILOG_INFO("%{public}s, formCount: %{public}d", __func__, iCount + 1); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, iCount + 1); // Set Want info end int errorCode = STtools::SystemTestFormUtil::DistributedDataAddForm(want); @@ -141,7 +141,7 @@ void FmsSelfStartingTest::SetUpTestCase() want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); want.SetParam(Constants::PARAM_FORM_TEMPORARY_KEY, FORM_TEMP_FORM_FLAG_TRUE); want.SetElementName(FORM_TEST_DEVICEID, FORM_PROVIDER_BUNDLE_NAME2, FORM_PROVIDER_ABILITY_NAME2); - APP_LOGI("%{public}s, formCount: %{public}d", __func__, iCount + 1); + HILOG_INFO("%{public}s, formCount: %{public}d", __func__, iCount + 1); want.SetParam(Constants::PARAM_FORM_ADD_COUNT, iCount + 1); // Set Want info end int errorCode = STtools::SystemTestFormUtil::DistributedDataAddForm(want); diff --git a/test/systemtest/common/fms/fms_self_starting_test/self_starting_test_config_parser.h b/test/systemtest/common/fms/fms_self_starting_test/self_starting_test_config_parser.h index b02ca7be21..d8d94fbde0 100644 --- a/test/systemtest/common/fms/fms_self_starting_test/self_starting_test_config_parser.h +++ b/test/systemtest/common/fms/fms_self_starting_test/self_starting_test_config_parser.h @@ -158,7 +158,7 @@ public: } } bool ret = true; - APP_LOGD("%{public}s called, formId[%{public}s]", __func__, formId.c_str()); + HILOG_DEBUG("%{public}s called, formId[%{public}s]", __func__, formId.c_str()); DistributedKv::Status status = DistributedKv::Status::ERROR; std::vector allEntries; @@ -169,20 +169,20 @@ public: } if (status != DistributedKv::Status::SUCCESS) { - APP_LOGE("get entries error: %{public}d", status); + HILOG_ERROR("get entries error: %{public}d", status); ret = false; } else { if (allEntries.empty()) { - APP_LOGE("%{public}s not match any FormInfo", formId.c_str()); + HILOG_ERROR("%{public}s not match any FormInfo", formId.c_str()); ret = false; } else { nlohmann::json jsonObject = nlohmann::json::parse(allEntries.front().value.ToString(), nullptr, false); if (jsonObject.is_discarded()) { - APP_LOGE("error key: %{private}s", allEntries.front().key.ToString().c_str()); + HILOG_ERROR("error key: %{private}s", allEntries.front().key.ToString().c_str()); ret = false; } if (innerFormInfo.FromJson(jsonObject) != true) { - APP_LOGE("error key: %{private}s", allEntries.front().key.ToString().c_str()); + HILOG_ERROR("error key: %{private}s", allEntries.front().key.ToString().c_str()); ret = false; } } diff --git a/test/systemtest/common/fms/fms_stress_test/BUILD.gn b/test/systemtest/common/fms/fms_stress_test/BUILD.gn index 09f0b2836c..f9dacb1d51 100755 --- a/test/systemtest/common/fms/fms_stress_test/BUILD.gn +++ b/test/systemtest/common/fms/fms_stress_test/BUILD.gn @@ -50,7 +50,7 @@ ohos_systemtest("FmsStressTest") { "//third_party/googletest:gtest_main", ] - defines = [ "APP_LOG_TAG = \"FmsStressTest\"" ] + defines = [ "AMS_LOG_TAG = \"FmsStressTest\"" ] external_deps = [ "ability_base:base", diff --git a/test/systemtest/common/fms/fms_stress_test/fms_stress_test.cpp b/test/systemtest/common/fms/fms_stress_test/fms_stress_test.cpp index b70576e9a6..4e2035c40b 100755 --- a/test/systemtest/common/fms/fms_stress_test/fms_stress_test.cpp +++ b/test/systemtest/common/fms/fms_stress_test/fms_stress_test.cpp @@ -22,7 +22,7 @@ #include "ability_handler.h" #include "ability_local_record.h" #include "ability_start_setting.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "common_event.h" #include "common_event_manager.h" #include "context_deal.h" diff --git a/test/systemtest/common/task_dispatcher/BUILD.gn b/test/systemtest/common/task_dispatcher/BUILD.gn index e759ed21a3..059c0fcdcb 100644 --- a/test/systemtest/common/task_dispatcher/BUILD.gn +++ b/test/systemtest/common/task_dispatcher/BUILD.gn @@ -21,6 +21,15 @@ config("system_test_task_dispatcher_config") { "//foundation/aafwk/standard/common/task_dispatcher/include/threading", "//foundation/aafwk/standard/frameworks/kits/appkit/native/app/include/task", "//foundation/aafwk/standard/frameworks/kits/appkit/native/app/include", + "${aafwk_path}/interfaces/innerkits/intent/include", + "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core/include/bundlemgr", + "${aafwk_path}/interfaces/innerkits/want/include", + "//utils/system/safwk/native/include", + "${aafwk_path}/interfaces/innerkits/app_manager/include/appmgr", + "${aafwk_path}/frameworks/kits/ability/native/include", + "${aafwk_path}/interfaces/innerkits/want/include/ohos/aafwk/content", + "//third_party/json/include", + "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", ] cflags = [] if (target_cpu == "arm") { @@ -51,7 +60,8 @@ ohos_systemtest("task_dispatcher_test") { configs = [ "${aafwk_path}/services/abilitymgr:abilityms_config", "${aafwk_path}/services/appmgr:appmgr_config", - "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_config", + + # "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_config", ":system_test_task_dispatcher_config", "//foundation/appexecfwk/standard/test/systemtest/common/ams/tool/:system_test_ability_util_config", diff --git a/test/systemtest/common/task_dispatcher/include/task_dispatcher_tools.h b/test/systemtest/common/task_dispatcher/include/task_dispatcher_tools.h index d9edf34f69..c74fa400e1 100644 --- a/test/systemtest/common/task_dispatcher/include/task_dispatcher_tools.h +++ b/test/systemtest/common/task_dispatcher/include/task_dispatcher_tools.h @@ -23,7 +23,7 @@ #include "common_event_manager.h" #include "context.h" #include "group.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "task_dispatcher.h" #include "task_priority.h" #include "revocable.h" diff --git a/test/systemtest/common/task_dispatcher/src/task_dispatcher_tools.cpp b/test/systemtest/common/task_dispatcher/src/task_dispatcher_tools.cpp index a37c916d49..7c0869dfb4 100644 --- a/test/systemtest/common/task_dispatcher/src/task_dispatcher_tools.cpp +++ b/test/systemtest/common/task_dispatcher/src/task_dispatcher_tools.cpp @@ -159,11 +159,11 @@ void TaskList::makeDispatcher() void TaskList::executeSyncDispatch() { - APP_LOGI("TaskList::executeSyncDispatch"); + HILOG_INFO("TaskList::executeSyncDispatch"); if (funcList.size() == 0) { return; } - APP_LOGI("TaskList::executeSyncDispatch execute"); + HILOG_INFO("TaskList::executeSyncDispatch execute"); auto runnable = funcList.front(); funcList.pop(); taskDispatcher->SyncDispatch(runnable); @@ -171,11 +171,11 @@ void TaskList::executeSyncDispatch() }; void TaskList::executeAsyncDispatch() { - APP_LOGI("TaskList::executeAsyncDispatch"); + HILOG_INFO("TaskList::executeAsyncDispatch"); if (funcList.size() == 0) { return; } - APP_LOGI("TaskList::executeAsyncDispatch execute"); + HILOG_INFO("TaskList::executeAsyncDispatch execute"); auto runnable = funcList.front(); funcList.pop(); std::shared_ptr revocable = taskDispatcher->AsyncDispatch(runnable); @@ -184,11 +184,11 @@ void TaskList::executeAsyncDispatch() }; void TaskList::executeDelayDispatch() { - APP_LOGI("TaskList::executeDelayDispatch"); + HILOG_INFO("TaskList::executeDelayDispatch"); if (funcList.size() == 0 || delayTimes.size() == 0) { return; } - APP_LOGI("TaskList::executeDelayDispatch execute"); + HILOG_INFO("TaskList::executeDelayDispatch execute"); auto runnable = funcList.front(); funcList.pop(); std::shared_ptr revocable = taskDispatcher->DelayDispatch(runnable, delayTimes.front()); @@ -198,11 +198,11 @@ void TaskList::executeDelayDispatch() }; void TaskList::executeSyncDispatchBarrier() { - APP_LOGI("TaskList::executeSyncDispatchBarrier"); + HILOG_INFO("TaskList::executeSyncDispatchBarrier"); if (funcList.size() == 0) { return; } - APP_LOGI("TaskList::executeSyncDispatchBarrier execute"); + HILOG_INFO("TaskList::executeSyncDispatchBarrier execute"); auto runnable = funcList.front(); funcList.pop(); taskDispatcher->SyncDispatchBarrier(runnable); @@ -210,11 +210,11 @@ void TaskList::executeSyncDispatchBarrier() }; void TaskList::executeAsyncDispatchBarrier() { - APP_LOGI("TaskList::executeAsyncDispatchBarrier"); + HILOG_INFO("TaskList::executeAsyncDispatchBarrier"); if (funcList.size() == 0) { return; } - APP_LOGI("TaskList::executeAsyncDispatchBarrier execute"); + HILOG_INFO("TaskList::executeAsyncDispatchBarrier execute"); auto runnable = funcList.front(); funcList.pop(); taskDispatcher->AsyncDispatchBarrier(runnable); @@ -222,17 +222,17 @@ void TaskList::executeAsyncDispatchBarrier() }; void TaskList::executeCreateDispatchGroup() { - APP_LOGI("TaskList::executeCreateDispatchGroup execute"); + HILOG_INFO("TaskList::executeCreateDispatchGroup execute"); group = taskDispatcher->CreateDispatchGroup(); return; }; void TaskList::executeAsyncGroupDispatch() { - APP_LOGI("TaskList::executeAsyncGroupDispatch"); + HILOG_INFO("TaskList::executeAsyncGroupDispatch"); if (funcList.size() == 0) { return; } - APP_LOGI("TaskList::executeAsyncGroupDispatch execute"); + HILOG_INFO("TaskList::executeAsyncGroupDispatch execute"); auto runnable = funcList.front(); funcList.pop(); std::shared_ptr revocable = taskDispatcher->AsyncGroupDispatch(group, runnable); @@ -241,33 +241,33 @@ void TaskList::executeAsyncGroupDispatch() }; bool TaskList::executeGroupDispatchWait() { - APP_LOGI("TaskList::executeGroupDispatchWait"); + HILOG_INFO("TaskList::executeGroupDispatchWait"); if (groupWaitTimes.size() == 0) { return false; } - APP_LOGI("TaskList::executeGroupDispatchWait execute"); + HILOG_INFO("TaskList::executeGroupDispatchWait execute"); long waitTimeout = groupWaitTimes.front(); groupWaitTimes.pop(); return taskDispatcher->GroupDispatchWait(group, waitTimeout); }; void TaskList::executeGroupDispatchNotify() { - APP_LOGI("TaskList::executeGroupDispatchNotify"); + HILOG_INFO("TaskList::executeGroupDispatchNotify"); if (funcList.size() == 0) { return; } - APP_LOGI("TaskList::executeGroupDispatchNotify execute"); + HILOG_INFO("TaskList::executeGroupDispatchNotify execute"); auto runnable = funcList.front(); funcList.pop(); taskDispatcher->GroupDispatchNotify(group, runnable); }; void TaskList::executeApplyDispatch() { - APP_LOGI("TaskList::executeApplyDispatch"); + HILOG_INFO("TaskList::executeApplyDispatch"); if (funcList.size() == 0 || applyTimes.size() == 0) { return; } - APP_LOGI("TaskList::executeApplyDispatch execute"); + HILOG_INFO("TaskList::executeApplyDispatch execute"); auto func = funcList.front(); funcList.pop(); auto runnable = std::make_shared>([func](long applyTime) { (*func.get())(); }); @@ -276,7 +276,7 @@ void TaskList::executeApplyDispatch() }; bool TaskList::executeRevokeTask() { - APP_LOGI("TaskList::executeRevokeTask"); + HILOG_INFO("TaskList::executeRevokeTask"); if (revokeTaskNumber.size() == 0 || revocableList.size() == 0) { if (revokeTaskNumber.size() > 0) { revokeTaskNumber.pop(); @@ -287,7 +287,7 @@ bool TaskList::executeRevokeTask() revokeTaskNumber.pop(); return false; } - APP_LOGI("TaskList::executeRevokeTask execute"); + HILOG_INFO("TaskList::executeRevokeTask execute"); bool result = revocableList[revokeTaskNumber.front() - 1]->Revoke(); revokeTaskNumber.pop(); return result; diff --git a/tools/aa/BUILD.gn b/tools/aa/BUILD.gn index fdab47d612..937d6ef7f8 100644 --- a/tools/aa/BUILD.gn +++ b/tools/aa/BUILD.gn @@ -51,19 +51,19 @@ ohos_source_set("tools_aa_source_set") { deps = [ "${aafwk_path}/interfaces/innerkits/ability_manager:ability_manager", "${aafwk_path}/interfaces/innerkits/app_manager:app_manager", - "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base:appexecfwk_base", - "${appexecfwk_path}/interfaces/innerkits/libeventhandler:libeventhandler", - "${innerkits_path}/base:base", - "${innerkits_path}/want:want", "${services_path}/abilitymgr:abilityms", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//utils/native/base:utils", ] external_deps = [ + "ability_base:base", + "ability_base:want", + "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", + "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] } diff --git a/tools/fm/BUILD.gn b/tools/fm/BUILD.gn index 5572577b61..1a2c5de0aa 100755 --- a/tools/fm/BUILD.gn +++ b/tools/fm/BUILD.gn @@ -20,6 +20,7 @@ config("tools_fm_config") { "${aafwk_path}/interfaces/innerkits/base/include", "${aafwk_path}/services/common/include", "${aafwk_path}/tools/aa/include", + "${aafwk_path}/services/common/include", "${appexecfwk_path}/common/log/include", "${appexecfwk_path}/interfaces/innerkits/libeventhandler/include", "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include", @@ -37,8 +38,8 @@ ohos_source_set("tools_fm_source_set") { ] defines = [ - "APP_LOG_TAG = \"FmsTool\"", - "LOG_DOMAIN = 0xD001152", + "AMS_LOG_TAG = \"FmsTool\"", + "AMS_LOG_DOMAIN = 0xD001152", ] public_configs = [ ":tools_fm_config" ] @@ -48,20 +49,18 @@ ohos_source_set("tools_fm_source_set") { cflags += [ "-DBINDER_IPC_32BIT" ] } - deps = [ - "${aafwk_path}/interfaces/innerkits/app_manager:app_manager", - "${aafwk_path}/interfaces/innerkits/form_manager:form_manager", - "${aafwk_path}/interfaces/innerkits/want:want", - "${appexecfwk_path}/common:libappexecfwk_common", - "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base:appexecfwk_base", - "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", - "//utils/native/base:utils", - ] + deps = [ "${appexecfwk_path}/common:libappexecfwk_common" ] external_deps = [ + "ability_base:want", + "ability_runtime:app_manager", + "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", + "form_runtime:form_manager", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", + "samgr_standard:samgr_proxy", + "utils_base:utils", ] } diff --git a/tools/fm/src/fms_command.cpp b/tools/fm/src/fms_command.cpp index 71a49c2bf0..507d607d10 100755 --- a/tools/fm/src/fms_command.cpp +++ b/tools/fm/src/fms_command.cpp @@ -17,7 +17,7 @@ #include #include "appexecfwk_errors.h" -#include "app_log_wrapper.h" +#include "hilog_wrapper.h" #include "fms_command.h" #include "if_system_ability_manager.h" #include "ipc_skeleton.h" @@ -122,13 +122,13 @@ ErrCode FormMgrShellCommand::RunAsQueryCommand() while (true) { counter++; option = getopt_long(argc_, argv_, SHORT_OPTIONS.c_str(), LONG_OPTIONS, nullptr); - APP_LOGI("option: %{public}d, optopt: %{public}d, optind: %{public}d", option, optopt, optind); + HILOG_INFO("option: %{public}d, optopt: %{public}d, optind: %{public}d", option, optopt, optind); if (optind < 0 || optind > argc_) { return OHOS::ERR_INVALID_VALUE; } for (int i = 0; i < argc_; i++) { - APP_LOGI("argv_[%{public}d]: %{public}s", i, argv_[i]); + HILOG_INFO("argv_[%{public}d]: %{public}s", i, argv_[i]); } if (option == -1) { @@ -137,7 +137,7 @@ ErrCode FormMgrShellCommand::RunAsQueryCommand() if (strcmp(argv_[optind], cmd_.c_str()) == 0) { // 'fm query' with no option: fm query // 'fm query' with a wrong argument: fm query xxx - APP_LOGE("'fm query' with no option."); + HILOG_ERROR("'fm query' with no option."); resultReceiver_.append(HELP_MSG_NO_OPTION + "\n"); result = OHOS::ERR_INVALID_VALUE; } @@ -176,7 +176,7 @@ int32_t FormMgrShellCommand::HandleUnknownOption(const char optopt) // 'fm query --bundle-name' with no argument: fm query --bundle-name // 'fm query -i' with no argument: fm query -i // 'fm query --form-id' with no argument: fm query --form-id - APP_LOGE("'fm query' %{public}s with no argument.", argv_[optind - 1]); + HILOG_ERROR("'fm query' %{public}s with no argument.", argv_[optind - 1]); resultReceiver_.append("error: option '"); resultReceiver_.append(argv_[optind - 1]); resultReceiver_.append("' requires a value.\n"); @@ -188,7 +188,7 @@ int32_t FormMgrShellCommand::HandleUnknownOption(const char optopt) // 'fm query' with a unknown option: fm query --xxx std::string unknownOption = ""; std::string unknownOptionMsg = GetUnknownOptionMsg(unknownOption); - APP_LOGE("'fm query' with a unknown option: %{public}s", unknownOption.c_str()); + HILOG_ERROR("'fm query' with a unknown option: %{public}s", unknownOption.c_str()); resultReceiver_.append(unknownOptionMsg); result = OHOS::ERR_INVALID_VALUE; break; @@ -198,7 +198,7 @@ int32_t FormMgrShellCommand::HandleUnknownOption(const char optopt) // 'fm query' with a unknown option: fm query -xxx std::string unknownOption = ""; std::string unknownOptionMsg = GetUnknownOptionMsg(unknownOption); - APP_LOGE("'fm query' with a unknown option: %{public}s", unknownOption.c_str()); + HILOG_ERROR("'fm query' with a unknown option: %{public}s", unknownOption.c_str()); resultReceiver_.append(unknownOptionMsg); result = OHOS::ERR_INVALID_VALUE; break; @@ -217,13 +217,13 @@ int32_t FormMgrShellCommand::HandleUnknownOption(const char optopt) */ int32_t FormMgrShellCommand::HandleNormalOption(const int option, std::string &bundleName, int64_t &formId, int32_t &cmdFlag) { - APP_LOGI("%{public}s start, option: %{public}d", __func__, option); + HILOG_INFO("%{public}s start, option: %{public}d", __func__, option); int32_t result = OHOS::ERR_OK; switch (option) { case 'h': { // 'fm query -h' // 'fm query --help' - APP_LOGI("'fm query' %{public}s", argv_[optind - 1]); + HILOG_INFO("'fm query' %{public}s", argv_[optind - 1]); result = OHOS::ERR_INVALID_VALUE; break; } @@ -263,11 +263,11 @@ int32_t FormMgrShellCommand::HandleNormalOption(const int option, std::string &b } default: { result = OHOS::ERR_INVALID_VALUE; - APP_LOGI("'fm query' invalid option."); + HILOG_INFO("'fm query' invalid option."); break; } } - APP_LOGI("%{public}s end, result: %{public}d", __func__, result); + HILOG_INFO("%{public}s end, result: %{public}d", __func__, result); return result; } /** @@ -279,7 +279,7 @@ int32_t FormMgrShellCommand::HandleNormalOption(const int option, std::string &b */ int32_t FormMgrShellCommand::ExecuteQuery(const std::string &bundleName, const int64_t formId, const int32_t cmdFlag) { - APP_LOGI("%{public}s start, bundleName: %{public}s, formId:%{public}" PRId64 "", __func__, bundleName.c_str(), formId); + HILOG_INFO("%{public}s start, bundleName: %{public}s, formId:%{public}" PRId64 "", __func__, bundleName.c_str(), formId); int32_t result = OHOS::ERR_OK; switch (cmdFlag) { case COMMAND_QUERY_STORAGE: { @@ -295,10 +295,10 @@ int32_t FormMgrShellCommand::ExecuteQuery(const std::string &bundleName, const i break; } default: { - APP_LOGI("'fm query' invalid command."); + HILOG_INFO("'fm query' invalid command."); break; } - APP_LOGI("%{public}s end, cmdFlag: %{public}d", __func__, cmdFlag); + HILOG_INFO("%{public}s end, cmdFlag: %{public}d", __func__, cmdFlag); } if (result == OHOS::ERR_OK) { @@ -319,7 +319,7 @@ int32_t FormMgrShellCommand::ExecuteQuery(const std::string &bundleName, const i */ int32_t FormMgrShellCommand::QueryStorageFormInfos() { - APP_LOGI("%{public}s start", __func__); + HILOG_INFO("%{public}s start", __func__); int errCode = ConnectFms(); if (errCode != OHOS::ERR_OK) { @@ -329,7 +329,7 @@ int32_t FormMgrShellCommand::QueryStorageFormInfos() std::string formInfos; MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -337,9 +337,9 @@ int32_t FormMgrShellCommand::QueryStorageFormInfos() if (result == ERR_OK) { resultReceiver_= formInfos; } else { - APP_LOGE("'fm query' failed to query form info."); + HILOG_ERROR("'fm query' failed to query form info."); } - APP_LOGI("%{public}s end, formInfo: %{public}s", __func__, resultReceiver_.c_str()); + HILOG_INFO("%{public}s end, formInfo: %{public}s", __func__, resultReceiver_.c_str()); return result; } @@ -350,7 +350,7 @@ int32_t FormMgrShellCommand::QueryStorageFormInfos() */ int32_t FormMgrShellCommand::QueryFormInfoByBundleName(const std::string& bundleName) { - APP_LOGI("%{public}s start, bundleName: %{public}s", __func__, bundleName.c_str()); + HILOG_INFO("%{public}s start, bundleName: %{public}s", __func__, bundleName.c_str()); int errCode = ConnectFms(); if (errCode != OHOS::ERR_OK) { @@ -360,23 +360,23 @@ int32_t FormMgrShellCommand::QueryFormInfoByBundleName(const std::string& bundle std::string formInfos; MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteString(bundleName)) { - APP_LOGE("%{public}s, failed to write bundleName", __func__); + HILOG_ERROR("%{public}s, failed to write bundleName", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } int result = GetStringInfo(IFormMgr::Message::FORM_MGR_FORM_INFOS_BY_NAME, data, formInfos); if (result == ERR_OK) { - APP_LOGI("%{public}s, DumpFormInfoByBundleName success", __func__); + HILOG_INFO("%{public}s, DumpFormInfoByBundleName success", __func__); resultReceiver_ = formInfos; } else { - APP_LOGE("'fm query' failed to query form info."); + HILOG_ERROR("'fm query' failed to query form info."); } - APP_LOGI("%{public}s end, formInfo: %{public}s", __func__, resultReceiver_.c_str()); + HILOG_INFO("%{public}s end, formInfo: %{public}s", __func__, resultReceiver_.c_str()); return result; } @@ -387,7 +387,7 @@ int32_t FormMgrShellCommand::QueryFormInfoByBundleName(const std::string& bundle */ int32_t FormMgrShellCommand::QueryFormInfoByFormId(const std::int64_t formId) { - APP_LOGI("%{public}s start, formId: %{public}" PRId64 "", __func__, formId); + HILOG_INFO("%{public}s start, formId: %{public}" PRId64 "", __func__, formId); int errCode = ConnectFms(); if (errCode != OHOS::ERR_OK) { @@ -397,11 +397,11 @@ int32_t FormMgrShellCommand::QueryFormInfoByFormId(const std::int64_t formId) std::string formInfo; MessageParcel data; if (!WriteInterfaceToken(data)) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } if (!data.WriteInt64(formId)) { - APP_LOGE("%{public}s, failed to write formId", __func__); + HILOG_ERROR("%{public}s, failed to write formId", __func__); return ERR_APPEXECFWK_PARCEL_ERROR; } @@ -409,18 +409,18 @@ int32_t FormMgrShellCommand::QueryFormInfoByFormId(const std::int64_t formId) if (result == ERR_OK) { resultReceiver_ = formInfo; } else if (result == OHOS::ERR_APPEXECFWK_FORM_NOT_EXIST_ID) { - APP_LOGW("'fm query' no form info."); + HILOG_WARN("'fm query' no form info."); } else { - APP_LOGE("'fm query' failed to query form info."); + HILOG_ERROR("'fm query' failed to query form info."); } - APP_LOGI("%{public}s end, formInfo: %{public}s", __func__, resultReceiver_.c_str()); + HILOG_INFO("%{public}s end, formInfo: %{public}s", __func__, resultReceiver_.c_str()); return result; } bool FormMgrShellCommand::WriteInterfaceToken(MessageParcel &data) { if (!data.WriteInterfaceToken(IFormMgr::GetDescriptor())) { - APP_LOGE("%{public}s, failed to write interface token", __func__); + HILOG_ERROR("%{public}s, failed to write interface token", __func__); return false; } return true; @@ -436,22 +436,22 @@ int FormMgrShellCommand::GetStringInfo(IFormMgr::Message code, MessageParcel &da error = reply.ReadInt32(); if (error != ERR_OK) { - APP_LOGE("%{public}s, failed to read reply result: %{public}d", __func__, error); + HILOG_ERROR("%{public}s, failed to read reply result: %{public}d", __func__, error); return error; } std::vector stringInfoList; if (!reply.ReadStringVector(&stringInfoList)) { - APP_LOGE("%{public}s, failed to read string vector from reply", __func__); + HILOG_ERROR("%{public}s, failed to read string vector from reply", __func__); return false; } if (stringInfoList.empty()) { - APP_LOGI("%{public}s, No string info", __func__); + HILOG_INFO("%{public}s, No string info", __func__); return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; } for (auto &info : stringInfoList) { stringInfo += info; } - APP_LOGD("%{public}s, get string info success", __func__); + HILOG_DEBUG("%{public}s, get string info success", __func__); return ERR_OK; } int FormMgrShellCommand::SendTransactCmd(IFormMgr::Message code, MessageParcel &data, MessageParcel &reply) @@ -459,12 +459,12 @@ int FormMgrShellCommand::SendTransactCmd(IFormMgr::Message code, MessageParcel & MessageOption option(MessageOption::TF_SYNC); if (!remoteObject_) { - APP_LOGE("%{public}s, failed to get remote object, cmd: %{public}d", __func__, code); + HILOG_ERROR("%{public}s, failed to get remote object, cmd: %{public}d", __func__, code); return ERR_APPEXECFWK_SERVICE_NOT_CONNECTED; } int32_t result = remoteObject_->SendRequest(static_cast(code), data, reply, option); if (result != ERR_OK) { - APP_LOGE("%{public}s, failed to SendRequest: %{public}d, cmd: %{public}d", __func__, result, code); + HILOG_ERROR("%{public}s, failed to SendRequest: %{public}d, cmd: %{public}d", __func__, result, code); return result; } return ERR_OK; @@ -480,16 +480,16 @@ int32_t FormMgrShellCommand::ConnectFms() } sptr systemManager = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (systemManager == nullptr) { - APP_LOGE("%{private}s:fail to get system ability manager", __func__); + HILOG_ERROR("%{private}s:fail to get system ability manager", __func__); return ERR_APPEXECFWK_FORM_GET_FMS_FAILED; } remoteObject_ = systemManager->GetSystemAbility(FORM_MGR_SERVICE_ID); if (remoteObject_ == nullptr) { - APP_LOGE("%{private}s:fail to connect FormMgrService", __func__); + HILOG_ERROR("%{private}s:fail to connect FormMgrService", __func__); return ERR_APPEXECFWK_FORM_GET_FMS_FAILED; } - APP_LOGI("%{public}s end, get fms proxy success", __func__); + HILOG_INFO("%{public}s end, get fms proxy success", __func__); return OHOS::ERR_OK; } } // namespace AppExecFwk