From 535b36ad0644c8e09dbc955b68f548e23bb72ffb Mon Sep 17 00:00:00 2001 From: wanchengzhen Date: Sat, 26 Feb 2022 14:23:34 +0800 Subject: [PATCH] codex Signed-off-by: wanchengzhen --- frameworks/kits/appkit/BUILD.gn | 1 + .../appkit/native/app/src/main_thread.cpp | 62 +- interfaces/innerkits/app_manager/BUILD.gn | 2 - .../include/appmgr/ams_mgr_interface.h | 10 +- .../include/appmgr/ams_mgr_proxy.h | 9 +- .../include/appmgr/app_mgr_client.h | 46 +- .../include/appmgr/app_mgr_interface.h | 53 +- .../include/appmgr/app_mgr_proxy.h | 48 +- .../app_manager/include/appmgr/app_mgr_stub.h | 7 +- .../include/appmgr/irender_scheduler.h | 45 -- .../include/appmgr/render_scheduler_host.h | 51 -- .../include/appmgr/render_scheduler_proxy.h | 50 -- .../app_manager/src/appmgr/ams_mgr_proxy.cpp | 23 +- .../app_manager/src/appmgr/ams_mgr_stub.cpp | 10 +- .../app_manager/src/appmgr/app_mgr_client.cpp | 67 +- .../app_manager/src/appmgr/app_mgr_proxy.cpp | 138 ++-- .../app_manager/src/appmgr/app_mgr_stub.cpp | 62 +- .../src/appmgr/render_scheduler_host.cpp | 63 -- .../src/appmgr/render_scheduler_proxy.cpp | 66 -- .../form_manager/src/form_provider_data.cpp | 35 +- .../runtime/include/js_runtime_utils.h | 8 +- ohos.build | 4 +- services/BUILD.gn | 1 - services/abilitymgr/BUILD.gn | 1 - services/abilitymgr/abilitymgr.gni | 1 + .../include/ability_connect_manager.h | 10 +- .../include/ability_manager_service.h | 9 +- .../abilitymgr/include/data_ability_manager.h | 4 +- .../include/kernal_system_app_manager.h | 168 +++++ .../abilitymgr/include/mission_list_manager.h | 4 +- .../src/ability_connect_manager.cpp | 118 ++-- .../src/ability_manager_service.cpp | 288 ++++---- .../abilitymgr/src/data_ability_manager.cpp | 27 +- .../src/kernal_system_app_manager.cpp | 408 ++++++++++++ .../abilitymgr/src/mission_list_manager.cpp | 28 +- services/abilitymgr/test/BUILD.gn | 2 + .../src/appmgr/app_mgr_client.cpp | 17 +- .../BUILD.gn | 3 +- .../BUILD.gn | 3 +- .../ability_connect_manage_test/BUILD.gn | 3 +- .../unittest/phone/ability_dump_test/BUILD.gn | 3 +- .../ability_dump_test/ability_dump_test.cpp | 2 + .../phone/ability_manager_proxy_test/BUILD.gn | 3 +- .../ability_manager_service_test/BUILD.gn | 3 +- .../ability_manager_service_test.cpp | 204 ++++++ .../phone/ability_manager_stub_test/BUILD.gn | 3 +- .../phone/ability_record_test/BUILD.gn | 3 +- .../ability_scheduler_proxy_test/BUILD.gn | 3 +- .../ability_scheduler_stub_test/BUILD.gn | 3 +- .../phone/ability_service_start_test/BUILD.gn | 3 +- .../phone/ability_stack_manager_test/BUILD.gn | 3 +- .../ability_stack_manager_test.cpp | 2 + .../phone/ability_token_proxy_test/BUILD.gn | 3 +- .../phone/ability_token_stub_test/BUILD.gn | 3 +- .../ability_with_applications_test/BUILD.gn | 3 +- .../ability_with_applications_test.cpp | 2 + .../phone/abilityms_appms_test/BUILD.gn | 3 +- .../abilityms_appms_test.cpp | 2 + .../phone/app_scheduler_test/BUILD.gn | 3 +- .../phone/configuration_test/BUILD.gn | 3 +- .../phone/connection_record_test/BUILD.gn | 3 +- .../phone/data_ability_manager_test/BUILD.gn | 3 +- .../phone/data_ability_record_test/BUILD.gn | 3 +- .../test/unittest/phone/info_test/BUILD.gn | 3 +- .../kernal_system_app_manager_test/BUILD.gn | 72 ++ .../kernal_system_app_manager_test.cpp | 614 ++++++++++++++++++ .../phone/lifecycle_deal_test/BUILD.gn | 3 +- .../unittest/phone/lifecycle_test/BUILD.gn | 3 +- .../phone/lifecycle_test/lifecycle_test.cpp | 2 + .../lock_screen_white_list_test/BUILD.gn | 3 +- .../unittest/phone/mission_list_test/BUILD.gn | 3 +- .../phone/mission_record_test/BUILD.gn | 3 +- .../phone/mission_stack_test/BUILD.gn | 3 +- .../test/unittest/phone/mission_test/BUILD.gn | 3 +- .../phone/pending_want_key_test/BUILD.gn | 3 +- .../phone/pending_want_manager_test/BUILD.gn | 3 +- .../phone/pending_want_record_test/BUILD.gn | 3 +- .../resume_mission_container_test/BUILD.gn | 3 +- .../phone/screenshot_handler_test/BUILD.gn | 3 +- .../unittest/phone/sender_info_test/BUILD.gn | 3 +- .../phone/terminate_ability_test/BUILD.gn | 3 +- .../terminate_ability_test.cpp | 2 + .../phone/want_receiver_proxy_test/BUILD.gn | 3 +- .../phone/want_receiver_stub_test/BUILD.gn | 3 +- .../phone/want_sender_info_test/BUILD.gn | 3 +- .../phone/want_sender_proxy_test/BUILD.gn | 3 +- .../phone/want_sender_stub_test/BUILD.gn | 3 +- .../unittest/phone/wants_info_test/BUILD.gn | 3 +- .../unittest/phone/window_info_test/BUILD.gn | 3 +- services/appmgr/BUILD.gn | 2 - services/appmgr/include/ams_mgr_scheduler.h | 9 +- services/appmgr/include/app_death_recipient.h | 3 - services/appmgr/include/app_mgr_service.h | 34 +- .../appmgr/include/app_mgr_service_inner.h | 55 +- services/appmgr/include/app_running_manager.h | 2 - services/appmgr/include/app_running_record.h | 50 -- services/appmgr/include/app_spawn_client.h | 2 +- .../appmgr/include/app_spawn_msg_wrapper.h | 1 - services/appmgr/include/app_spawn_socket.h | 2 +- services/appmgr/include/process_optimizer.h | 4 +- .../appmgr/include/process_optimizer_uba.h | 4 +- .../appmgr/include/remote_client_manager.h | 3 - services/appmgr/src/ams_mgr_scheduler.cpp | 11 +- services/appmgr/src/app_death_recipient.cpp | 7 +- services/appmgr/src/app_mgr_service.cpp | 55 +- services/appmgr/src/app_mgr_service_inner.cpp | 389 ++--------- services/appmgr/src/app_running_manager.cpp | 45 +- services/appmgr/src/app_running_record.cpp | 107 +-- services/appmgr/src/app_spawn_client.cpp | 4 +- services/appmgr/src/app_spawn_socket.cpp | 10 +- services/appmgr/src/lmks/lmks_utils.cpp | 10 +- services/appmgr/src/process_optimizer.cpp | 25 +- services/appmgr/src/process_optimizer_uba.cpp | 22 +- services/appmgr/src/remote_client_manager.cpp | 8 +- services/appmgr/test/BUILD.gn | 2 - .../test/mock/include/mock_app_mgr_service.h | 2 - .../test/mock/include/mock_app_spawn_socket.h | 2 +- .../ams_ability_running_record_test/BUILD.gn | 2 - .../ams_app_death_recipient_test/BUILD.gn | 1 - .../unittest/ams_app_life_cycle_test/BUILD.gn | 2 - .../ams_app_life_cycle_test.cpp | 17 +- .../unittest/ams_app_mgr_client_test/BUILD.gn | 3 +- .../ams_app_running_record_test/BUILD.gn | 2 - .../unittest/ams_app_workflow_test/BUILD.gn | 2 - .../ams_ipc_appmgr_interface_test.cpp | 29 +- .../ams_mgr_scheduler_test.cpp | 28 +- .../ams_recent_app_list_test/BUILD.gn | 2 - .../BUILD.gn | 1 - .../ams_service_event_drive_test/BUILD.gn | 1 - .../ams_service_event_drive_test.cpp | 70 +- .../BUILD.gn | 2 - .../ams_service_startup_test/BUILD.gn | 1 - .../BUILD.gn | 1 - services/common/BUILD.gn | 28 +- .../common/include/permission_constants.h | 32 - .../common/include/permission_verification.h | 42 -- .../common/src/permission_verification.cpp | 72 -- services/formmgr/BUILD.gn | 2 - services/formmgr/include/form_info_mgr.h | 2 - services/formmgr/include/form_mgr_service.h | 12 + services/formmgr/include/form_timer.h | 12 +- services/formmgr/src/form_info_mgr.cpp | 62 +- services/formmgr/src/form_mgr_adapter.cpp | 13 +- services/formmgr/src/form_mgr_service.cpp | 33 +- services/formmgr/src/form_provider_mgr.cpp | 2 +- services/formmgr/src/form_timer_mgr.cpp | 2 +- .../ability_mgr_service_test/BUILD.gn | 2 +- .../ability_mgr_module_test.cpp | 2 + .../moduletest/ability_record_test/BUILD.gn | 2 +- .../moduletest/ability_stack_test/BUILD.gn | 2 +- .../ability_stack_module_test.cpp | 2 + .../ams/ability_running_record_test/BUILD.gn | 7 +- .../common/ams/app_life_cycle_test/BUILD.gn | 7 +- .../ams_app_life_cycle_module_test.cpp | 8 + .../common/ams/app_mgr_service_test/BUILD.gn | 3 +- .../ams_app_mgr_service_module_test.cpp | 36 + .../common/ams/app_recent_list_test/BUILD.gn | 7 +- .../ams/app_running_record_test/BUILD.gn | 7 +- .../common/ams/app_service_flow_test/BUILD.gn | 7 +- .../common/ams/ipc_ams_mgr_test/BUILD.gn | 3 +- .../common/ams/ipc_app_mgr_test/BUILD.gn | 7 +- .../ams_ipc_app_mgr_module_test.cpp | 31 + .../ams/ipc_app_scheduler_test/BUILD.gn | 7 +- .../ams/process_optimizer_uba_test/BUILD.gn | 5 +- .../service_app_spawn_client_test/BUILD.gn | 3 +- .../ams/service_event_drive_test/BUILD.gn | 3 +- .../ams/service_start_process_test/BUILD.gn | 3 +- .../test/moduletest/dump_module_test/BUILD.gn | 3 +- .../dump_module_test/dump_module_test.cpp | 2 + .../ipc_ability_connect_test/BUILD.gn | 3 +- .../moduletest/ipc_ability_mgr_test/BUILD.gn | 3 +- .../ipc_ability_scheduler_test/BUILD.gn | 3 +- .../panding_want_manager_test/BUILD.gn | 1 - .../abilitySrc/amsStDataAbility/BUILD.gn | 2 +- .../include/verify_act_data_ability.h | 9 +- .../src/verify_act_data_ability.cpp | 439 ++++++++++++- zidl/bundle.json | 37 -- zidl/test/native/BUILD.gn | 69 -- zidl/test/native/include/izidl_test_service.h | 36 - zidl/test/native/include/test_client.h | 34 - zidl/test/native/include/test_service.h | 36 - .../native/include/zidl_test_service_proxy.h | 49 -- .../native/include/zidl_test_service_stub.h | 38 -- zidl/test/native/src/main_client.cpp | 75 --- zidl/test/native/src/main_server.cpp | 31 - zidl/test/native/src/test_client.cpp | 65 -- zidl/test/native/src/test_service.cpp | 64 -- .../native/src/zidl_test_service_proxy.cpp | 64 -- .../native/src/zidl_test_service_stub.cpp | 48 -- zidl/test/zidlgen/IZidlTestService.zidl | 19 - zidl/test/zidlgen/zidl | Bin 216360 -> 0 bytes 191 files changed, 3103 insertions(+), 2506 deletions(-) delete mode 100644 interfaces/innerkits/app_manager/include/appmgr/irender_scheduler.h delete mode 100644 interfaces/innerkits/app_manager/include/appmgr/render_scheduler_host.h delete mode 100644 interfaces/innerkits/app_manager/include/appmgr/render_scheduler_proxy.h delete mode 100644 interfaces/innerkits/app_manager/src/appmgr/render_scheduler_host.cpp delete mode 100644 interfaces/innerkits/app_manager/src/appmgr/render_scheduler_proxy.cpp create mode 100644 services/abilitymgr/include/kernal_system_app_manager.h create mode 100644 services/abilitymgr/src/kernal_system_app_manager.cpp create mode 100755 services/abilitymgr/test/unittest/phone/kernal_system_app_manager_test/BUILD.gn create mode 100644 services/abilitymgr/test/unittest/phone/kernal_system_app_manager_test/kernal_system_app_manager_test.cpp delete mode 100644 services/common/include/permission_constants.h delete mode 100644 services/common/include/permission_verification.h delete mode 100644 services/common/src/permission_verification.cpp delete mode 100644 zidl/bundle.json delete mode 100644 zidl/test/native/BUILD.gn delete mode 100644 zidl/test/native/include/izidl_test_service.h delete mode 100644 zidl/test/native/include/test_client.h delete mode 100644 zidl/test/native/include/test_service.h delete mode 100644 zidl/test/native/include/zidl_test_service_proxy.h delete mode 100644 zidl/test/native/include/zidl_test_service_stub.h delete mode 100644 zidl/test/native/src/main_client.cpp delete mode 100644 zidl/test/native/src/main_server.cpp delete mode 100644 zidl/test/native/src/test_client.cpp delete mode 100644 zidl/test/native/src/test_service.cpp delete mode 100644 zidl/test/native/src/zidl_test_service_proxy.cpp delete mode 100644 zidl/test/native/src/zidl_test_service_stub.cpp delete mode 100644 zidl/test/zidlgen/IZidlTestService.zidl delete mode 100644 zidl/test/zidlgen/zidl diff --git a/frameworks/kits/appkit/BUILD.gn b/frameworks/kits/appkit/BUILD.gn index 43cb6d0433d..969611ed98a 100644 --- a/frameworks/kits/appkit/BUILD.gn +++ b/frameworks/kits/appkit/BUILD.gn @@ -170,6 +170,7 @@ ohos_shared_library("appkit_native") { "bytrace_standard:bytrace_core", "hisysevent_native:libhisysevent", "hiviewdfx_hilog_native:libhilog", + "hisysevent_native:libhisysevent", "ipc:ipc_core", "napi:ace_napi", ] diff --git a/frameworks/kits/appkit/native/app/src/main_thread.cpp b/frameworks/kits/appkit/native/app/src/main_thread.cpp index faace598f7c..be52ac2a8bc 100644 --- a/frameworks/kits/appkit/native/app/src/main_thread.cpp +++ b/frameworks/kits/appkit/native/app/src/main_thread.cpp @@ -46,6 +46,8 @@ #include "task_handler_client.h" #include "faultloggerd_client.h" #include "dfx_dump_catcher.h" +#include "hisysevent.h" +#include "js_runtime_utils.h" #if defined(ABILITY_LIBRARY_LOADER) || defined(APPLICATION_LIBRARY_LOADER) #include @@ -60,6 +62,13 @@ namespace { constexpr int32_t DELIVERY_TIME = 200; constexpr int32_t DISTRIBUTE_TIME = 100; constexpr int32_t UNSPECIFIED_USERID = -2; + +constexpr char EVENT_KEY_UID[] = "UID"; +constexpr char EVENT_KEY_PID[] = "PID"; +constexpr char EVENT_KEY_MESSAGE[] = "MSG"; +constexpr char EVENT_KEY_PACKAGE_NAME[] = "PACKAGE_NAME"; +constexpr char EVENT_KEY_PROCESS_NAME[] = "PROCESS_NAME"; +constexpr uint8_t CAP_MAX_SIZE = 64; } #define ACEABILITY_LIBRARY_LOADER @@ -870,7 +879,58 @@ void MainThread::HandleLaunchApplication(const AppLaunchData &appLaunchData, con APP_LOGE("OHOSApplication::OHOSApplication: Failed to create runtime"); return; } - + auto& jsEngine = (static_cast(*runtime)).GetNativeEngine(); + auto bundleName = appInfo.bundleName; + auto uid = appInfo.uid; + auto processName = processInfo.GetProcessName(); + auto processPid = processInfo.GetPid(); + wptr weak = this; + auto uncaughtTask = [weak, uid, processPid, bundleName, processName](NativeValue* v) { + APP_LOGI("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"); + return; + } + size_t messagebufferLen = messageStr->GetLength(); + size_t messagestrLen = 0; + char messagecap[CAP_MAX_SIZE] = { 0 }; + messageStr->GetCString(messagecap, messagebufferLen + 1, &messagestrLen); + APP_LOGI("messagecap = %{public}s", messagecap); + NativeValue* stack = obj->GetProperty("stack"); + NativeString* stackStr = AbilityRuntime::ConvertNativeValueTo(stack); + if (stackStr == nullptr) { + APP_LOGE("stackStr Convert failed"); + return; + } + size_t stackbufferLen = stackStr->GetLength(); + size_t stackstrLen = 0; + char stackcap[CAP_MAX_SIZE] = { 0 }; + messageStr->GetCString(stackcap, stackbufferLen + 1, &stackstrLen); + APP_LOGI("stackcap = %{public}s", stackcap); + auto appThread = weak.promote(); + if (appThread == nullptr) { + APP_LOGE("appThread is nullptr, HandleLaunchApplication failed."); + return; + } + std::string eventType = "JS_EXCEPTION"; + std::string msgContent; + std::string tempMessageStr(messagecap); + std::string tempStackStr(stackcap); + msgContent = "message:" + tempMessageStr + "tempStack:" + tempStackStr; + auto ret = OHOS::HiviewDFX::HiSysEvent::Write(OHOS::HiviewDFX::HiSysEvent::Domain::AAFWK, eventType, + OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, + EVENT_KEY_UID, std::to_string(uid), + EVENT_KEY_PID, std::to_string(processPid), + EVENT_KEY_PACKAGE_NAME, bundleName, + EVENT_KEY_PROCESS_NAME, processName, + EVENT_KEY_MESSAGE, msgContent); + appThread->ScheduleProcessSecurityExit(); + APP_LOGI("RegisterUncaughtExceptionHandler End ret = %{public}d", ret); + }; + jsEngine.RegisterUncaughtExceptionHandler(uncaughtTask); application_->SetRuntime(std::move(runtime)); auto usertestInfo = appLaunchData.GetUserTestInfo(); if (usertestInfo.observer) { diff --git a/interfaces/innerkits/app_manager/BUILD.gn b/interfaces/innerkits/app_manager/BUILD.gn index 19ae968ddfd..ac8817a19cf 100644 --- a/interfaces/innerkits/app_manager/BUILD.gn +++ b/interfaces/innerkits/app_manager/BUILD.gn @@ -59,8 +59,6 @@ ohos_shared_library("app_manager") { "src/appmgr/process_data.cpp", "src/appmgr/process_info.cpp", "src/appmgr/profile.cpp", - "src/appmgr/render_scheduler_host.cpp", - "src/appmgr/render_scheduler_proxy.cpp", "src/appmgr/running_process_info.cpp", "src/appmgr/start_specified_ability_response_proxy.cpp", "src/appmgr/start_specified_ability_response_stub.cpp", diff --git a/interfaces/innerkits/app_manager/include/appmgr/ams_mgr_interface.h b/interfaces/innerkits/app_manager/include/appmgr/ams_mgr_interface.h index 28d20995083..0656a1b6243 100644 --- a/interfaces/innerkits/app_manager/include/appmgr/ams_mgr_interface.h +++ b/interfaces/innerkits/app_manager/include/appmgr/ams_mgr_interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -80,6 +80,13 @@ public: */ virtual void RegisterAppStateCallback(const sptr &callback) = 0; + /** + * Reset,call Reset() through the proxy object, reset DFX of AppMgr. + * + * @return + */ + virtual void Reset() = 0; + /** * AbilityBehaviorAnalysis,call AbilityBehaviorAnalysis() through the proxy object, * ability behavior analysis assistant process optimization. @@ -178,6 +185,7 @@ public: UPDATE_ABILITY_STATE, UPDATE_EXTENSION_STATE, REGISTER_APP_STATE_CALLBACK, + RESET, ABILITY_BEHAVIOR_ANALYSIS, KILL_PEOCESS_BY_ABILITY_TOKEN, KILL_PROCESSES_BY_USERID, diff --git a/interfaces/innerkits/app_manager/include/appmgr/ams_mgr_proxy.h b/interfaces/innerkits/app_manager/include/appmgr/ams_mgr_proxy.h index 4be57ed5e91..ef95912b1a2 100644 --- a/interfaces/innerkits/app_manager/include/appmgr/ams_mgr_proxy.h +++ b/interfaces/innerkits/app_manager/include/appmgr/ams_mgr_proxy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -74,6 +74,13 @@ public: */ virtual void RegisterAppStateCallback(const sptr &callback) override; + /** + * Reset,call Reset() through the proxy object, reset DFX of AppMgr. + * + * @return + */ + virtual void Reset() override; + /** * AbilityBehaviorAnalysis,call AbilityBehaviorAnalysis() through the proxy object, * ability behavior analysis assistant process optimization. diff --git a/interfaces/innerkits/app_manager/include/appmgr/app_mgr_client.h b/interfaces/innerkits/app_manager/include/appmgr/app_mgr_client.h index 432cf349e9e..c392772e6d4 100644 --- a/interfaces/innerkits/app_manager/include/appmgr/app_mgr_client.h +++ b/interfaces/innerkits/app_manager/include/appmgr/app_mgr_client.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -25,7 +25,6 @@ #include "app_mgr_constants.h" #include "bundle_info.h" #include "iapp_state_callback.h" -#include "irender_scheduler.h" #include "running_process_info.h" #include "system_memory_attr.h" #include "istart_specified_ability_response.h" @@ -84,6 +83,13 @@ public: */ virtual AppMgrResultCode ConnectAppMgrService(); + /** + * Ability manager resst. + * + * @return Returns RESULT_OK on success, others on failure. + */ + virtual AppMgrResultCode Reset(); + /** * AbilityBehaviorAnalysis, ability behavior analysis assistant process optimization. * @@ -169,6 +175,23 @@ public: */ virtual AppMgrResultCode GetConfiguration(Configuration& config); + /** + * SetAppSuspendTimes, Setting the Freezing Time of APP Background. + * + * @param time, The timeout recorded when the application enters the background . + * + * @return Success or Failure . + */ + virtual AppMgrResultCode SetAppFreezingTime(int time); + + /** + * GetAppFreezingTime, Getting the Freezing Time of APP Background. + * + * @param time, The timeout recorded when the application enters the background . + * + * @return Success or Failure . + */ + virtual AppMgrResultCode GetAppFreezingTime(int &time); virtual void AbilityAttachTimeOut(const sptr &token); virtual void PrepareTerminate(const sptr &token); @@ -233,25 +256,6 @@ public: */ virtual int GetAbilityRecordsByProcessID(const int pid, std::vector> &tokens); - /** - * Start webview render process, called by webview host. - * - * @param renderParam, params passed to renderprocess. - * @param ipcFd, ipc file descriptior for web browser and render process. - * @param sharedFd, shared memory file descriptior. - * @param renderPid, created render pid. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartRenderProcess(const std::string &renderParam, int32_t ipcFd, - int32_t sharedFd, pid_t &renderPid); - - /** - * Render process call this to attach app manager service. - * - * @param renderScheduler, scheduler of render process. - */ - virtual void AttachRenderProcess(const sptr &renderScheduler); - private: void SetServiceManager(std::unique_ptr serviceMgr); diff --git a/interfaces/innerkits/app_manager/include/appmgr/app_mgr_interface.h b/interfaces/innerkits/app_manager/include/appmgr/app_mgr_interface.h index 4a34d7ab390..26302e4fd87 100644 --- a/interfaces/innerkits/app_manager/include/appmgr/app_mgr_interface.h +++ b/interfaces/innerkits/app_manager/include/appmgr/app_mgr_interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -105,6 +105,15 @@ public: */ virtual int32_t ClearUpApplicationData(const std::string &bundleName) = 0; + /** + * IsBackgroundRunningRestricted, call IsBackgroundRunningRestricted() through proxy project, + * Checks whether the process of this application is forbidden to run in the background. + * + * @param bundleName, bundle name in Application record. + * @return ERR_OK, return back success, others fail. + */ + virtual int IsBackgroundRunningRestricted(const std::string &bundleName) = 0; + /** * GetAllRunningProcesses, call GetAllRunningProcesses() through proxy project. * Obtains information about application processes that are running on the device. @@ -124,6 +133,24 @@ public: */ virtual int GetProcessRunningInfosByUserId(std::vector &info, int32_t userId) = 0; + /** + * SetAppSuspendTimes, Setting the Freezing Time of APP Background. + * + * @param time, The timeout recorded when the application enters the background . + * + * @return Success or Failure . + */ + virtual void SetAppFreezingTime(int time) = 0; + + /** + * GetAppFreezingTime, Getting the Freezing Time of APP Background. + * + * @param time, The timeout recorded when the application enters the background . + * + * @return Success or Failure . + */ + virtual void GetAppFreezingTime(int &time) = 0; + /** * Get system memory information. * @param SystemMemoryAttr, memory information. @@ -183,25 +210,6 @@ public: */ virtual int GetAbilityRecordsByProcessID(const int pid, std::vector> &tokens) = 0; - /** - * Start webview render process, called by webview host. - * - * @param renderParam, params passed to renderprocess. - * @param ipcFd, ipc file descriptior for web browser and render process. - * @param sharedFd, shared memory file descriptior. - * @param renderPid, created render pid. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartRenderProcess(const std::string &renderParam, int32_t ipcFd, - int32_t sharedFd, pid_t &renderPid) = 0; - - /** - * Render process call this to attach app manager service. - * - * @param renderScheduler, scheduler of render process. - */ - virtual void AttachRenderProcess(const sptr &renderScheduler) = 0; - enum class Message { APP_ATTACH_APPLICATION = 0, APP_APPLICATION_FOREGROUNDED, @@ -211,8 +219,11 @@ public: APP_ABILITY_CLEANED, APP_GET_MGR_INSTANCE, APP_CLEAR_UP_APPLICATION_DATA, + APP_IS_BACKGROUND_RUNNING_RESTRICTED, APP_GET_ALL_RUNNING_PROCESSES, APP_GET_RUNNING_PROCESSES_BY_USER_ID, + APP_SET_APP_FREEZING_TIME, + APP_GET_APP_FREEZING_TIME, APP_GET_SYSTEM_MEMORY_ATTR, APP_ADD_ABILITY_STAGE_INFO_DONE, STARTUP_RESIDENT_PROCESS, @@ -222,8 +233,6 @@ public: START_USER_TEST_PROCESS, SCHEDULE_ACCEPT_WANT_DONE, APP_GET_ABILITY_RECORDS_BY_PROCESS_ID, - START_RENDER_PROCESS, - ATTACH_RENDER_PROCESS, }; }; } // namespace AppExecFwk diff --git a/interfaces/innerkits/app_manager/include/appmgr/app_mgr_proxy.h b/interfaces/innerkits/app_manager/include/appmgr/app_mgr_proxy.h index 0a2b53f4384..20f1cb3eddf 100644 --- a/interfaces/innerkits/app_manager/include/appmgr/app_mgr_proxy.h +++ b/interfaces/innerkits/app_manager/include/appmgr/app_mgr_proxy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -98,6 +98,15 @@ public: */ virtual int32_t ClearUpApplicationData(const std::string &bundleName) override; + /** + * IsBackgroundRunningRestricted, call IsBackgroundRunningRestricted() through proxy project, + * Checks whether the process of this application is forbidden to run in the background. + * + * @param bundleName, bundle name in Application record. + * @return ERR_OK, return back success, others fail. + */ + virtual int32_t IsBackgroundRunningRestricted(const std::string &bundleName) override; + /** * GetAllRunningProcesses, call GetAllRunningProcesses() through proxy project. * Obtains information about application processes that are running on the device. @@ -116,6 +125,24 @@ public: */ virtual int32_t GetProcessRunningInfosByUserId(std::vector &info, int32_t userId) override; + /** + * SetAppSuspendTimes, Setting the Freezing Time of APP Background. + * + * @param time, The timeout recorded when the application enters the background . + * + * @return Success or Failure . + */ + virtual void SetAppFreezingTime(int time) override; + + /** + * GetAppFreezingTime, Getting the Freezing Time of APP Background. + * + * @param time, The timeout recorded when the application enters the background . + * + * @return Success or Failure . + */ + virtual void GetAppFreezingTime(int &time) override; + /** * Get system memory information. * @param SystemMemoryAttr, memory information. @@ -176,25 +203,6 @@ public: */ virtual int GetAbilityRecordsByProcessID(const int pid, std::vector> &tokens) override; - /** - * Start webview render process, called by webview host. - * - * @param renderParam, params passed to renderprocess. - * @param ipcFd, ipc file descriptior for web browser and render process. - * @param sharedFd, shared memory file descriptior. - * @param renderPid, created render pid. - * @return Returns ERR_OK on success, others on failure. - */ - virtual int StartRenderProcess(const std::string &renderParam, int32_t ipcFd, - int32_t sharedFd, pid_t &renderPid) override; - - /** - * Render process call this to attach app manager service. - * - * @param renderApp, information needed to start the Application. - */ - virtual void AttachRenderProcess(const sptr &renderApp) override; - private: bool SendTransactCmd(IAppMgr::Message code, MessageParcel &data, MessageParcel &reply); bool WriteInterfaceToken(MessageParcel &data); diff --git a/interfaces/innerkits/app_manager/include/appmgr/app_mgr_stub.h b/interfaces/innerkits/app_manager/include/appmgr/app_mgr_stub.h index 0de454b1fb2..396f34aa2f5 100644 --- a/interfaces/innerkits/app_manager/include/appmgr/app_mgr_stub.h +++ b/interfaces/innerkits/app_manager/include/appmgr/app_mgr_stub.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -63,8 +63,11 @@ private: int32_t HandleAbilityCleaned(MessageParcel &data, MessageParcel &reply); int32_t HandleGetAmsMgr(MessageParcel &data, MessageParcel &reply); int32_t HandleClearUpApplicationData(MessageParcel &data, MessageParcel &reply); + int32_t HandleIsBackgroundRunningRestricted(MessageParcel &data, MessageParcel &reply); int32_t HandleGetAllRunningProcesses(MessageParcel &data, MessageParcel &reply); int32_t HandleGetProcessRunningInfosByUserId(MessageParcel &data, MessageParcel &reply); + int32_t HandleSetAppFreezingTime(MessageParcel &data, MessageParcel &reply); + int32_t HandleGetAppFreezingTime(MessageParcel &data, MessageParcel &reply); int32_t HandleGetSystemMemoryAttr(MessageParcel &data, MessageParcel &reply); int32_t HandleAddAbilityStageDone(MessageParcel &data, MessageParcel &reply); int32_t HandleStartupResidentProcess(MessageParcel &data, MessageParcel &reply); @@ -74,8 +77,6 @@ private: int32_t HandleStartUserTestProcess(MessageParcel &data, MessageParcel &reply); int32_t HandleScheduleAcceptWantDone(MessageParcel &data, MessageParcel &reply); int32_t HandleGetAbilityRecordsByProcessID(MessageParcel &data, MessageParcel &reply); - int32_t HandleStartRenderProcess(MessageParcel &data, MessageParcel &reply); - int32_t HandleAttachRenderProcess(MessageParcel &data, MessageParcel &reply); using AppMgrFunc = int32_t (AppMgrStub::*)(MessageParcel &data, MessageParcel &reply); std::map memberFuncMap_; diff --git a/interfaces/innerkits/app_manager/include/appmgr/irender_scheduler.h b/interfaces/innerkits/app_manager/include/appmgr/irender_scheduler.h deleted file mode 100644 index d4d7cba7c0d..00000000000 --- a/interfaces/innerkits/app_manager/include/appmgr/irender_scheduler.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_APPMGR_IRENDER_SCHEDULER_H -#define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_APPMGR_IRENDER_SCHEDULER_H - -#include "iremote_broker.h" - -namespace OHOS { -namespace AppExecFwk { -/** - * @class IRenderScheduler - * Ipc interface of render process to app mgr service. - */ -class IRenderScheduler : public IRemoteBroker { -public: - DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.RenderScheduler"); - - /** - * Notify Browser's fd to render process. - * - * @param ipcFd, ipc file descriptior for web browser and render process. - * @param sharedFd, shared memory file descriptior. - */ - virtual void NotifyBrowserFd(int32_t ipcFd, int32_t sharedFd) = 0; - - enum class Message { - NOTIFY_BROWSER_FD = 1, - }; -}; -} // namespace AppExecFwk -} // namespace OHOS -#endif // FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_APPMGR_IRENDER_SCHEDULER_H diff --git a/interfaces/innerkits/app_manager/include/appmgr/render_scheduler_host.h b/interfaces/innerkits/app_manager/include/appmgr/render_scheduler_host.h deleted file mode 100644 index 5b13f250e8a..00000000000 --- a/interfaces/innerkits/app_manager/include/appmgr/render_scheduler_host.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_APPMGR_RENDER_SCHEDULER_HOST_H -#define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_APPMGR_RENDER_SCHEDULER_HOST_H - -#include - -#include "irender_scheduler.h" -#include "iremote_object.h" -#include "iremote_stub.h" -#include "nocopyable.h" - -namespace OHOS { -namespace AppExecFwk { -/** - * @class RenderSchedulerHost - * RenderScheduler stub. - */ -class RenderSchedulerHost : public IRemoteStub { -public: - RenderSchedulerHost(); - virtual ~RenderSchedulerHost(); - - virtual int OnRemoteRequest( - uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - -private: - int32_t HandleNotifyBrowserFd(MessageParcel &data, MessageParcel &reply); - - using RenderSchedulerFunc = int32_t (RenderSchedulerHost::*)(MessageParcel &data, MessageParcel &reply); - std::map memberFuncMap_; - - DISALLOW_COPY_AND_MOVE(RenderSchedulerHost); -}; -} // namespace AppExecFwk -} // namespace OHOS - -#endif // FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_APPMGR_RENDER_SCHEDULER_HOST_H diff --git a/interfaces/innerkits/app_manager/include/appmgr/render_scheduler_proxy.h b/interfaces/innerkits/app_manager/include/appmgr/render_scheduler_proxy.h deleted file mode 100644 index 196fe3d9d06..00000000000 --- a/interfaces/innerkits/app_manager/include/appmgr/render_scheduler_proxy.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_APPMGR_RENDER_SCHEDULER_PROXY_H -#define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_APPMGR_RENDER_SCHEDULER_PROXY_H - -#include "irender_scheduler.h" - -#include "iremote_proxy.h" - -namespace OHOS { -namespace AppExecFwk { -/** - * @class RenderSchedulerProxy - * RenderScheduler proxy. - */ -class RenderSchedulerProxy : public IRemoteProxy { -public: - explicit RenderSchedulerProxy(const sptr &impl); - - virtual ~RenderSchedulerProxy() = default; - - /** - * Notify Browser's fd to render process. - * - * @param ipcFd, ipc file descriptior for web browser and render process. - * @param sharedFd, shared memory file descriptior. - */ - virtual void NotifyBrowserFd(int32_t ipcFd, int32_t sharedFd) override; - -private: - bool WriteInterfaceToken(MessageParcel &data); - static inline BrokerDelegator delegator_; -}; -} // namespace AppExecFwk -} // namespace OHOS - -#endif // FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_APPMGR_RENDER_SCHEDULER_PROXY_H 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 f0801563e30..d1b349653f5 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/ams_mgr_proxy.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/ams_mgr_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -170,6 +170,27 @@ void AmsMgrProxy::RegisterAppStateCallback(const sptr &callba APP_LOGD("end"); } +void AmsMgrProxy::Reset() +{ + APP_LOGD("start"); + MessageParcel data; + MessageParcel reply; + MessageOption option(MessageOption::TF_SYNC); + if (!WriteInterfaceToken(data)) { + return; + } + sptr remote = Remote(); + if (remote == nullptr) { + APP_LOGE("Remote() is NULL"); + return; + } + int32_t ret = remote->SendRequest(static_cast(IAmsMgr::Message::RESET), data, reply, option); + if (ret != NO_ERROR) { + APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + } + APP_LOGD("end"); +} + void AmsMgrProxy::AbilityBehaviorAnalysis(const sptr &token, const sptr &preToken, const int32_t visibility, const int32_t perceptibility, const int32_t connectionState) { 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 ec7cc1ef193..eb7e502a844 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/ams_mgr_stub.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/ams_mgr_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -40,6 +40,7 @@ AmsMgrStub::AmsMgrStub() &AmsMgrStub::HandleUpdateExtensionState; memberFuncMap_[static_cast(IAmsMgr::Message::REGISTER_APP_STATE_CALLBACK)] = &AmsMgrStub::HandleRegisterAppStateCallback; + memberFuncMap_[static_cast(IAmsMgr::Message::RESET)] = &AmsMgrStub::HandleReset; memberFuncMap_[static_cast(IAmsMgr::Message::ABILITY_BEHAVIOR_ANALYSIS)] = &AmsMgrStub::HandleAbilityBehaviorAnalysis; memberFuncMap_[static_cast(IAmsMgr::Message::KILL_PEOCESS_BY_ABILITY_TOKEN)] = @@ -155,6 +156,13 @@ ErrCode AmsMgrStub::HandleRegisterAppStateCallback(MessageParcel &data, MessageP return NO_ERROR; } +ErrCode AmsMgrStub::HandleReset(MessageParcel &data, MessageParcel &reply) +{ + BYTRACE(BYTRACE_TAG_APP); + Reset(); + return NO_ERROR; +} + ErrCode AmsMgrStub::HandleAbilityBehaviorAnalysis(MessageParcel &data, MessageParcel &reply) { BYTRACE(BYTRACE_TAG_APP); 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 a3f7aeb8326..1591d40106c 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/app_mgr_client.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/app_mgr_client.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -106,6 +106,19 @@ AppMgrResultCode AppMgrClient::RegisterAppStateCallback(const sptr service = iface_cast(remote_); + if (service != nullptr) { + sptr amsService = service->GetAmsMgr(); + if (amsService != nullptr) { + amsService->Reset(); + return AppMgrResultCode::RESULT_OK; + } + } + return AppMgrResultCode::ERROR_SERVICE_NOT_CONNECTED; +} + AppMgrResultCode AppMgrClient::AbilityBehaviorAnalysis(const sptr &token, const sptr &preToken, const int32_t visibility, const int32_t perceptibility, const int32_t connectionState) @@ -234,6 +247,26 @@ AppMgrResultCode AppMgrClient::GetConfiguration(Configuration& config) return AppMgrResultCode::ERROR_SERVICE_NOT_CONNECTED; } +AppMgrResultCode AppMgrClient::SetAppFreezingTime(int time) +{ + sptr service = iface_cast(remote_); + if (service != nullptr) { + service->SetAppFreezingTime(time); + return AppMgrResultCode::RESULT_OK; + } + return AppMgrResultCode::ERROR_SERVICE_NOT_CONNECTED; +} + +AppMgrResultCode AppMgrClient::GetAppFreezingTime(int &time) +{ + sptr service = iface_cast(remote_); + if (service != nullptr) { + service->GetAppFreezingTime(time); + return AppMgrResultCode::RESULT_OK; + } + return AppMgrResultCode::ERROR_SERVICE_NOT_CONNECTED; +} + AppMgrResultCode AppMgrClient::ConnectAppMgrService() { if (!serviceManager_) { @@ -414,37 +447,5 @@ int AppMgrClient::GetAbilityRecordsByProcessID(const int pid, std::vectorGetAbilityRecordsByProcessID(pid, tokens); } - -int AppMgrClient::StartRenderProcess(const std::string &renderParam, int32_t ipcFd, - int32_t sharedFd, pid_t &renderPid) -{ - if (!remote_) { - ConnectAppMgrService(); - } - - sptr service = iface_cast(remote_); - if (service != nullptr) { - return service->StartRenderProcess(renderParam, ipcFd, sharedFd, renderPid); - } - return AppMgrResultCode::ERROR_SERVICE_NOT_CONNECTED; -} - -void AppMgrClient::AttachRenderProcess(const sptr &renderScheduler) -{ - if (!renderScheduler) { - APP_LOGI("renderScheduler is nullptr"); - return; - } - - if (!remote_) { - ConnectAppMgrService(); - } - - sptr service = iface_cast(remote_); - if (service != nullptr) { - APP_LOGI("AttachRenderProcess"); - service->AttachRenderProcess(renderScheduler->AsObject()); - } -} } // namespace AppExecFwk } // namespace OHOS 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 6b36e57d4fc..a5528332597 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/app_mgr_proxy.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/app_mgr_proxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -226,6 +226,34 @@ int32_t AppMgrProxy::ClearUpApplicationData(const std::string &bundleName) return reply.ReadInt32(); } +int32_t AppMgrProxy::IsBackgroundRunningRestricted(const std::string &bundleName) +{ + APP_LOGD("start"); + MessageParcel data; + MessageParcel reply; + MessageOption option(MessageOption::TF_SYNC); + if (!WriteInterfaceToken(data)) { + return ERR_FLATTEN_OBJECT; + } + sptr remote = Remote(); + if (remote == nullptr) { + APP_LOGE("Remote() is NULL"); + return ERR_NULL_OBJECT; + } + if (!data.WriteString(bundleName)) { + APP_LOGE("parcel WriteString failed"); + return ERR_FLATTEN_OBJECT; + } + int32_t ret = remote->SendRequest( + static_cast(IAppMgr::Message::APP_IS_BACKGROUND_RUNNING_RESTRICTED), data, reply, option); + if (ret != NO_ERROR) { + APP_LOGW("SendRequest is failed, error code: %{public}d", ret); + return ret; + } + APP_LOGD("end"); + return reply.ReadInt32(); +} + int32_t AppMgrProxy::GetAllRunningProcesses(std::vector &info) { APP_LOGD("start"); @@ -298,6 +326,46 @@ bool AppMgrProxy::SendTransactCmd(IAppMgr::Message code, MessageParcel &data, Me return true; } +void AppMgrProxy::SetAppFreezingTime(int time) +{ + APP_LOGD("start"); + MessageParcel data; + MessageParcel reply; + MessageOption option(MessageOption::TF_SYNC); + if (!WriteInterfaceToken(data)) { + return; + } + + if (!data.WriteInt32(time)) { + APP_LOGE("parcel WriteInt32 failed"); + return; + } + if (!SendTransactCmd(IAppMgr::Message::APP_SET_APP_FREEZING_TIME, data, reply)) { + APP_LOGE("SendTransactCmd faild"); + return; + } + APP_LOGD("end"); +} + +void AppMgrProxy::GetAppFreezingTime(int &time) +{ + APP_LOGD("start"); + MessageParcel data; + MessageParcel reply; + MessageOption option(MessageOption::TF_SYNC); + if (!WriteInterfaceToken(data)) { + APP_LOGE("WriteInterfaceToken faild"); + return; + } + + if (!SendTransactCmd(IAppMgr::Message::APP_GET_APP_FREEZING_TIME, data, reply)) { + APP_LOGE("SendTransactCmd faild"); + return; + } + time = reply.ReadInt32(); + APP_LOGE("get freeze time : %{public}d ", time); +} + /** * Get system memory information. * @param SystemMemoryAttr, memory information. @@ -537,73 +605,5 @@ int AppMgrProxy::GetAbilityRecordsByProcessID(const int pid, std::vectorSendRequest(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); - return ret; - } - - auto result = reply.ReadInt32(); - renderPid = reply.ReadInt32(); - if (result != 0) { - APP_LOGW("StartRenderProcess failed, result: %{public}d", ret); - return ret; - } - return 0; -} - -void AppMgrProxy::AttachRenderProcess(const sptr &renderScheduler) -{ - if (!renderScheduler) { - APP_LOGE("renderScheduler is null"); - return; - } - - APP_LOGD("AttachRenderProcess start"); - MessageParcel data; - MessageParcel reply; - MessageOption option; - if (!WriteInterfaceToken(data)) { - return; - } - if (!data.WriteParcelable(renderScheduler)) { - APP_LOGE("renderScheduler write failed."); - return; - } - - if (!SendTransactCmd(IAppMgr::Message::ATTACH_RENDER_PROCESS, data, reply)) { - APP_LOGE("SendTransactCmd ATTACH_RENDER_PROCESS faild"); - return; - } -} } // namespace AppExecFwk } // namespace OHOS 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 12bc8d566b0..e5ba070ede8 100644 --- a/interfaces/innerkits/app_manager/src/appmgr/app_mgr_stub.cpp +++ b/interfaces/innerkits/app_manager/src/appmgr/app_mgr_stub.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -48,10 +48,16 @@ AppMgrStub::AppMgrStub() memberFuncMap_[static_cast(IAppMgr::Message::APP_GET_MGR_INSTANCE)] = &AppMgrStub::HandleGetAmsMgr; memberFuncMap_[static_cast(IAppMgr::Message::APP_CLEAR_UP_APPLICATION_DATA)] = &AppMgrStub::HandleClearUpApplicationData; + memberFuncMap_[static_cast(IAppMgr::Message::APP_IS_BACKGROUND_RUNNING_RESTRICTED)] = + &AppMgrStub::HandleIsBackgroundRunningRestricted; memberFuncMap_[static_cast(IAppMgr::Message::APP_GET_ALL_RUNNING_PROCESSES)] = &AppMgrStub::HandleGetAllRunningProcesses; memberFuncMap_[static_cast(IAppMgr::Message::APP_GET_RUNNING_PROCESSES_BY_USER_ID)] = &AppMgrStub::HandleGetProcessRunningInfosByUserId; + memberFuncMap_[static_cast(IAppMgr::Message::APP_SET_APP_FREEZING_TIME)] = + &AppMgrStub::HandleSetAppFreezingTime; + memberFuncMap_[static_cast(IAppMgr::Message::APP_GET_APP_FREEZING_TIME)] = + &AppMgrStub::HandleGetAppFreezingTime; memberFuncMap_[static_cast(IAppMgr::Message::APP_GET_SYSTEM_MEMORY_ATTR)] = &AppMgrStub::HandleGetSystemMemoryAttr; memberFuncMap_[static_cast(IAppMgr::Message::APP_ADD_ABILITY_STAGE_INFO_DONE)] = @@ -70,10 +76,6 @@ AppMgrStub::AppMgrStub() &AppMgrStub::HandleScheduleAcceptWantDone; memberFuncMap_[static_cast(IAppMgr::Message::APP_GET_ABILITY_RECORDS_BY_PROCESS_ID)] = &AppMgrStub::HandleGetAbilityRecordsByProcessID; - memberFuncMap_[static_cast(IAppMgr::Message::START_RENDER_PROCESS)] = - &AppMgrStub::HandleStartRenderProcess; - memberFuncMap_[static_cast(IAppMgr::Message::ATTACH_RENDER_PROCESS)] = - &AppMgrStub::HandleAttachRenderProcess; } AppMgrStub::~AppMgrStub() @@ -175,6 +177,15 @@ int32_t AppMgrStub::HandleClearUpApplicationData(MessageParcel &data, MessagePar return NO_ERROR; } +int32_t AppMgrStub::HandleIsBackgroundRunningRestricted(MessageParcel &data, MessageParcel &reply) +{ + BYTRACE(BYTRACE_TAG_APP); + std::string bundleName = data.ReadString(); + int32_t result = IsBackgroundRunningRestricted(bundleName); + reply.WriteInt32(result); + return NO_ERROR; +} + int32_t AppMgrStub::HandleGetAllRunningProcesses(MessageParcel &data, MessageParcel &reply) { BYTRACE(BYTRACE_TAG_APP); @@ -210,6 +221,22 @@ int32_t AppMgrStub::HandleGetProcessRunningInfosByUserId(MessageParcel &data, Me return NO_ERROR; } +int32_t AppMgrStub::HandleSetAppFreezingTime(MessageParcel &data, MessageParcel &reply) +{ + BYTRACE(BYTRACE_TAG_APP); + SetAppFreezingTime(data.ReadInt32()); + return NO_ERROR; +} + +int32_t AppMgrStub::HandleGetAppFreezingTime(MessageParcel &data, MessageParcel &reply) +{ + BYTRACE(BYTRACE_TAG_APP); + int time = 0; + GetAppFreezingTime(time); + reply.WriteInt32(time); + return NO_ERROR; +} + int32_t AppMgrStub::HandleGetSystemMemoryAttr(MessageParcel &data, MessageParcel &reply) { BYTRACE(BYTRACE_TAG_APP); @@ -336,30 +363,5 @@ int32_t AppMgrStub::HandleGetAbilityRecordsByProcessID(MessageParcel &data, Mess } return NO_ERROR; } - -int32_t AppMgrStub::HandleStartRenderProcess(MessageParcel &data, MessageParcel &reply) -{ - std::string renderParam = data.ReadString(); - int32_t ipcFd = data.ReadFileDescriptor(); - int32_t sharedFd = data.ReadFileDescriptor(); - int32_t renderPid = 0; - int32_t result = StartRenderProcess(renderParam, ipcFd, sharedFd, renderPid); - if (!reply.WriteInt32(result)) { - APP_LOGE("write result error."); - return ERR_INVALID_VALUE; - } - if (!reply.WriteInt32(renderPid)) { - APP_LOGE("write renderPid error."); - return ERR_INVALID_VALUE; - } - return result; -} - -int32_t AppMgrStub::HandleAttachRenderProcess(MessageParcel &data, MessageParcel &reply) -{ - sptr scheduler = data.ReadParcelable(); - AttachRenderProcess(scheduler); - return NO_ERROR; -} } // namespace AppExecFwk } // namespace OHOS diff --git a/interfaces/innerkits/app_manager/src/appmgr/render_scheduler_host.cpp b/interfaces/innerkits/app_manager/src/appmgr/render_scheduler_host.cpp deleted file mode 100644 index 91a2db26d84..00000000000 --- a/interfaces/innerkits/app_manager/src/appmgr/render_scheduler_host.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "render_scheduler_host.h" - -#include "app_log_wrapper.h" -#include "ipc_types.h" - -namespace OHOS { -namespace AppExecFwk { -RenderSchedulerHost::RenderSchedulerHost() -{ - memberFuncMap_[static_cast(IRenderScheduler::Message::NOTIFY_BROWSER_FD)] = - &RenderSchedulerHost::HandleNotifyBrowserFd; -} - -RenderSchedulerHost::~RenderSchedulerHost() -{ - memberFuncMap_.clear(); -} - -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()); - std::u16string descriptor = RenderSchedulerHost::GetDescriptor(); - std::u16string remoteDescriptor = data.ReadInterfaceToken(); - if (descriptor != remoteDescriptor) { - APP_LOGE("local descriptor is not equal to remote"); - return ERR_INVALID_STATE; - } - - auto itFunc = memberFuncMap_.find(code); - if (itFunc != memberFuncMap_.end()) { - auto memberFunc = itFunc->second; - if (memberFunc != nullptr) { - return (this->*memberFunc)(data, reply); - } - } - return IPCObjectStub::OnRemoteRequest(code, data, reply, option); -} - -int RenderSchedulerHost::HandleNotifyBrowserFd(MessageParcel &data, MessageParcel &reply) -{ - int32_t ipcFd = data.ReadFileDescriptor(); - int32_t sharedFd = data.ReadFileDescriptor(); - NotifyBrowserFd(ipcFd, sharedFd); - return 0; -} -} // namespace AppExecFwk -} // namespace OHOS diff --git a/interfaces/innerkits/app_manager/src/appmgr/render_scheduler_proxy.cpp b/interfaces/innerkits/app_manager/src/appmgr/render_scheduler_proxy.cpp deleted file mode 100644 index e409655b648..00000000000 --- a/interfaces/innerkits/app_manager/src/appmgr/render_scheduler_proxy.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "render_scheduler_proxy.h" - -#include "ipc_types.h" - -#include "app_log_wrapper.h" - -namespace OHOS { -namespace AppExecFwk { -RenderSchedulerProxy::RenderSchedulerProxy( - const sptr &impl) : IRemoteProxy(impl) -{} - -bool RenderSchedulerProxy::WriteInterfaceToken(MessageParcel &data) -{ - if (!data.WriteInterfaceToken(RenderSchedulerProxy::GetDescriptor())) { - APP_LOGE("write interface token failed"); - return false; - } - return true; -} - -void RenderSchedulerProxy::NotifyBrowserFd(int32_t ipcFd, int32_t sharedFd) -{ - APP_LOGD("NotifyBrowserFd start"); - MessageParcel data; - MessageParcel reply; - MessageOption option(MessageOption::TF_ASYNC); - if (!WriteInterfaceToken(data)) { - return; - } - - if (!data.WriteFileDescriptor(ipcFd) || !data.WriteFileDescriptor(sharedFd)) { - APP_LOGE("want fd failed, ipcFd:%{public}d, sharedFd:%{public}d", ipcFd, sharedFd); - return; - } - - sptr remote = Remote(); - if (remote == nullptr) { - APP_LOGE("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); - } - APP_LOGD("NotifyBrowserFd end"); -} -} // namespace AppExecFwk -} // namespace OHOS diff --git a/interfaces/innerkits/form_manager/src/form_provider_data.cpp b/interfaces/innerkits/form_manager/src/form_provider_data.cpp index da96cab7fa9..66072d55240 100755 --- a/interfaces/innerkits/form_manager/src/form_provider_data.cpp +++ b/interfaces/innerkits/form_manager/src/form_provider_data.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include "form_provider_data.h" @@ -106,10 +105,6 @@ void FormProviderData::AddImageData(std::string picName, char *data, int32_t siz return; } - auto iterator = rawImageBytesMap_.find(picName); - if (iterator != rawImageBytesMap_.end()) { - delete[] iterator->second.first; - } rawImageBytesMap_[picName] = std::make_pair(data, size); imageDataState_ = IMAGE_DATA_STATE_ADDED; @@ -123,24 +118,34 @@ void FormProviderData::AddImageData(std::string picName, char *data, int32_t siz void FormProviderData::AddImageData(std::string picName, int fd) { HILOG_INFO("%{public}s called", __func__); - if (fd < 0) { + if (fd <= 0) { return; } - - int32_t size = lseek(fd, 0L, SEEK_END); - if (size <= 0) { - HILOG_ERROR("Get file size failed, errno is %{public}d", errno); + std::string fdPath = "/proc/self/fd/" + std::to_string(fd); + char fileName[PATH_MAX + 1] = {0}; + int ret = readlink(fdPath.c_str(), fileName, PATH_MAX); + if (ret < 0 || ret > PATH_MAX) { + HILOG_ERROR("Get fileName failed, ret is: %{public}d!", ret); return; } - HILOG_INFO("File size is %{public}d", size); - if (lseek(fd, 0L, SEEK_SET) == -1) { + fileName[ret] = '\0'; + + std::ifstream file(fileName, std::ios::in | std::ios::binary | std::ios::ate); + if (!file.is_open()) { + HILOG_INFO("open failed"); return; } - char *data = new char[size]; - if (read(fd, data, size) < 0) { - HILOG_ERROR("Read failed, errno is %{public}d", errno); + + file.seekg(0, std::ios::end); + int32_t size = file.tellg(); + HILOG_INFO("File size %{public}d", size); + if (size < 0) { return; } + file.seekg(0, std::ios::beg); + char *data = new char[size]; + file.read(data, size); + file.close(); AddImageData(picName, data, size); HILOG_INFO("%{public}s called end.", __func__); } diff --git a/interfaces/innerkits/runtime/include/js_runtime_utils.h b/interfaces/innerkits/runtime/include/js_runtime_utils.h index 85fb368679d..047fe42ea45 100644 --- a/interfaces/innerkits/runtime/include/js_runtime_utils.h +++ b/interfaces/innerkits/runtime/include/js_runtime_utils.h @@ -81,11 +81,9 @@ inline bool ConvertFromJsValue(NativeEngine& engine, NativeValue* jsValue, T& va if (stringValue == nullptr) { return false; } - size_t len = stringValue->GetLength() + 1; - auto buffer = std::make_unique(len); - size_t strLength = 0; - stringValue->GetCString(buffer.get(), len, &strLength); - value = buffer.get(); + size_t len = stringValue->GetLength(); + value.resize(len); + stringValue->GetCString(value.data(), len, &len); return true; } else if constexpr (std::is_enum_v) { auto numberValue = ConvertNativeValueTo(jsValue); diff --git a/ohos.build b/ohos.build index 210459f71cf..b40f83d76ae 100644 --- a/ohos.build +++ b/ohos.build @@ -82,9 +82,7 @@ "appmgr/iapp_state_callback.h", "appmgr/app_state_callback_host.h", "appmgr/app_mgr_constants.h", - "appmgr/app_process_data.h", - "appmgr/irender_scheduler.h", - "appmgr/render_scheduler_host.h" + "appmgr/app_process_data.h" ] }, "name": "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager" diff --git a/services/BUILD.gn b/services/BUILD.gn index 5770614a362..c11ef1cb046 100644 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -15,7 +15,6 @@ group("services_target") { deps = [ "abilitymgr:abilityms_target", "appmgr:ams_target", - "common:perm_verification", "dataobsmgr:dataobsms", "uripermmgr:upms_target", ] diff --git a/services/abilitymgr/BUILD.gn b/services/abilitymgr/BUILD.gn index 99e4e269f86..15cce174228 100644 --- a/services/abilitymgr/BUILD.gn +++ b/services/abilitymgr/BUILD.gn @@ -80,7 +80,6 @@ ohos_shared_library("abilityms") { "${innerkits_path}/base:base", "${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", diff --git a/services/abilitymgr/abilitymgr.gni b/services/abilitymgr/abilitymgr.gni index 286ba3d4b74..c23b483029c 100644 --- a/services/abilitymgr/abilitymgr.gni +++ b/services/abilitymgr/abilitymgr.gni @@ -46,6 +46,7 @@ abilityms_files = [ "${services_path}/abilitymgr/src/ability_mission_info.cpp", "${services_path}/abilitymgr/src/mission_description_info.cpp", "${services_path}/abilitymgr/src/mission_snapshot.cpp", + "${services_path}/abilitymgr/src/kernal_system_app_manager.cpp", "${services_path}/abilitymgr/src/caller_info.cpp", "${services_path}/abilitymgr/src/sender_info.cpp", "${services_path}/abilitymgr/src/wants_info.cpp", diff --git a/services/abilitymgr/include/ability_connect_manager.h b/services/abilitymgr/include/ability_connect_manager.h index 99fa6b0c8f4..09313891463 100644 --- a/services/abilitymgr/include/ability_connect_manager.h +++ b/services/abilitymgr/include/ability_connect_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -183,13 +183,9 @@ public: ConnectListType GetConnectRecordListByCallback(sptr callback); void RemoveAll(); - void GetExtensionRunningInfos(int upperLimit, std::vector &info, - const int32_t userId, bool isPerm); + void GetExtensionRunningInfos(int upperLimit, std::vector &info, const int32_t userId); - void GetAbilityRunningInfos(std::vector &info, bool isPerm); - - void GetExtensionRunningInfo(std::shared_ptr &abilityRecord, const int32_t userId, - std::vector &info); + void GetAbilityRunningInfos(std::vector &info); /** * SetEventHandler. diff --git a/services/abilitymgr/include/ability_manager_service.h b/services/abilitymgr/include/ability_manager_service.h index 705e9ea224d..e413cb5de48 100644 --- a/services/abilitymgr/include/ability_manager_service.h +++ b/services/abilitymgr/include/ability_manager_service.h @@ -32,6 +32,7 @@ #include "data_ability_manager.h" #include "hilog_wrapper.h" #include "iremote_object.h" +#include "kernal_system_app_manager.h" #include "mission_list_manager.h" #include "system_ability.h" #include "uri.h" @@ -746,9 +747,6 @@ public: virtual int GetExtensionRunningInfos(int upperLimit, std::vector &info) override; virtual int GetProcessRunningInfos(std::vector &info) override; int GetProcessRunningInfosByUserId(std::vector &info, int32_t userId); - void GetAbilityRunningInfo(std::vector &info, std::shared_ptr &abilityRecord); - void GetExtensionRunningInfo(std::shared_ptr &abilityRecord, const int32_t userId, - std::vector &info); int GetMissionSaveTime() const; @@ -1141,10 +1139,6 @@ private: bool IsNeedTimeoutForTest(const std::string &abilityName, const std::string &state) const; void StartupResidentProcess(); - int VerifyMissionPermission(); - - int VerifyAccountPermission(int32_t userId); - using DumpFuncType = void (AbilityManagerService::*)(const std::string &args, std::vector &info); std::map dumpFuncMap_; @@ -1175,6 +1169,7 @@ private: std::shared_ptr systemDataAbilityManager_; std::unordered_map> pendingWantManagers_; std::shared_ptr pendingWantManager_; + std::shared_ptr systemAppManager_; std::shared_ptr amsConfigResolver_; const static std::map dumpMap; const static std::map dumpsysMap; diff --git a/services/abilitymgr/include/data_ability_manager.h b/services/abilitymgr/include/data_ability_manager.h index f1ac566670d..a3561ea6511 100644 --- a/services/abilitymgr/include/data_ability_manager.h +++ b/services/abilitymgr/include/data_ability_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -48,8 +48,8 @@ public: void Dump(const char *func, int line); void DumpState(std::vector &info, const std::string &args = "") const; void DumpSysState(std::vector &info, bool isClient = false, const std::string &args = "") const; + void GetAbilityRunningInfos(std::vector &info); bool ContainsDataAbility(const sptr &scheduler); - void GetAbilityRunningInfos(std::vector &info, bool isPerm); private: using DataAbilityRecordPtr = std::shared_ptr; diff --git a/services/abilitymgr/include/kernal_system_app_manager.h b/services/abilitymgr/include/kernal_system_app_manager.h new file mode 100644 index 00000000000..eb30240281a --- /dev/null +++ b/services/abilitymgr/include/kernal_system_app_manager.h @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_AAFWK_KERNAL_SYSTEM_APP_MANAGER_H +#define OHOS_AAFWK_KERNAL_SYSTEM_APP_MANAGER_H + +#include +#include + +#include "mission_record.h" +#include "mission_stack.h" +#include "want.h" + +namespace OHOS { +namespace AAFwk { +/** + * @class KernalSystemAppManager + * KernalSystemAppManager provides a facility for managing systerm ability life cycle. + */ +class KernalSystemAppManager : public std::enable_shared_from_this { +public: + explicit KernalSystemAppManager(int userId); + ~KernalSystemAppManager(); + + /** + * init kernal system app manager. + * + */ + void Init(); + /** + * StartAbility with request. + * + * @param abilityRequest, the request of the ability to start. + * @return Returns ERR_OK on success, others on failure. + */ + int StartAbility(const AbilityRequest &abilityRequest); + /** + * attach ability thread ipc object. + * + * @param scheduler, ability thread ipc object. + * @param token, the token of ability. + * @return Returns ERR_OK on success, others on failure. + */ + int AttachAbilityThread(const sptr &scheduler, const sptr &token); + /** + * AbilityTransitionDone, ability call this interface after lift cycle was changed. + * + * @param token,.ability's token. + * @param state,.the state of ability lift cycle. + * @return Returns ERR_OK on success, others on failure. + */ + int AbilityTransitionDone(const sptr &token, int state); + /** + * OnAbilityRequestDone, app manager service call this interface after ability request done. + * + * @param token,ability's token. + * @param state,the state of ability lift cycle. + */ + void OnAbilityRequestDone(const sptr &token, const int32_t state); + + void OnAppStateChanged(const AppInfo &info); + + /** + * get manager's user id. + */ + int GetManagerUserId() const; + + void DumpState(std::vector &info); + + void DumpSysState(std::vector &info, bool isClient = false); + + void OnAbilityDied(std::shared_ptr abilityRecord); + + void OnTimeOut(uint32_t msgId, int64_t eventId); + + /** + * get the ability record by token. + * + * @return abilityRecord, target ability. + */ + std::shared_ptr GetAbilityRecordByToken(const sptr &token); + + void RestartAbility(const std::shared_ptr abilityRecord); + +private: + /** + * StartAbilityLocked. + * + * @param abilityRequest the request of the ability to start. + * @return Returns ERR_OK on success, others on failure. + */ + int StartAbilityLocked(const AbilityRequest &abilityRequest); + /** + * push waitting ability to queue. + * + * @param abilityRequest, the request of ability. + */ + void EnqueueWaittingAbility(const AbilityRequest &abilityRequest); + /** + * pop waitting ability. + * + */ + void DequeueWaittingAbility(); + /** + * get current top ability of stack. + * + * @return top ability record. + */ + std::shared_ptr GetCurrentTopAbility() const; + /** + * get or create the target ability record of system app. + * + * @param abilityRequest, the request of ability. + * @param targetAbility, target ability record. + */ + void GetOrCreateAbilityRecord(const AbilityRequest &abilityRequest, std::shared_ptr &targetAbility); + /** + * get the flag of the target ability record. + * + * @param bundleName, target bundleName. + * @param abilityName, target ability name. + */ + static std::string GetFlagOfAbility(const std::string &bundleName, const std::string &abilityName); + /** + * get the ability record by eventId. + * + * @return abilityRecord, target ability. + */ + std::shared_ptr GetAbilityRecordByEventId(const int64_t eventId) const; + /** + * dispatch ability life cycle . + * + * @param abilityRecord. + * @param state. + */ + int DispatchActive(const std::shared_ptr &abilityRecord, int state); + int DispatchInactive(const std::shared_ptr &abilityRecord, int state); + /** + * complete ability life cycle . + * + * @param abilityRecord. + */ + void CompleteActive(const std::shared_ptr &abilityRecord); + void CompleteInactive(const std::shared_ptr &abilityRecord); + + bool RemoveAbilityRecord(std::shared_ptr ability); + +private: + std::recursive_mutex stackLock_; + std::list> abilities_; + std::queue waittingAbilityQueue_; + int userId_; +}; +} // namespace AAFwk +} // namespace OHOS +#endif // OHOS_AAFWK_KERNAL_SYSTEM_APP_MANAGER_H diff --git a/services/abilitymgr/include/mission_list_manager.h b/services/abilitymgr/include/mission_list_manager.h index 00e9b20baee..632cfb5dfe7 100644 --- a/services/abilitymgr/include/mission_list_manager.h +++ b/services/abilitymgr/include/mission_list_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -322,7 +322,7 @@ public: */ bool GetMissionSnapshot(int32_t missionId, const sptr& abilityToken, MissionSnapshot& missionSnapshot); - void GetAbilityRunningInfos(std::vector &info, bool isPerm); + void GetAbilityRunningInfos(std::vector &info); /** * @brief get current top ability by bundle name diff --git a/services/abilitymgr/src/ability_connect_manager.cpp b/services/abilitymgr/src/ability_connect_manager.cpp index e09a1150e17..1fe56f890a1 100755 --- a/services/abilitymgr/src/ability_connect_manager.cpp +++ b/services/abilitymgr/src/ability_connect_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -990,94 +990,80 @@ void AbilityConnectManager::DumpState(std::vector &info, bool isCli } void AbilityConnectManager::GetExtensionRunningInfos(int upperLimit, std::vector &info, - const int32_t userId, bool isPerm) + const int32_t userId) { HILOG_INFO("Get extension running info."); std::lock_guard guard(Lock_); - auto mgr = shared_from_this(); - auto queryInfo = [&info, upperLimit, userId, isPerm, mgr](ServiceMapType::reference service) { + auto queryInfo = [&info, upperLimit, userId](ServiceMapType::reference service) { if (static_cast(info.size()) >= upperLimit) { return; } auto abilityRecord = service.second; CHECK_POINTER(abilityRecord); - - if (isPerm) { - mgr->GetExtensionRunningInfo(abilityRecord, userId, info); - } else { - auto callingTokenId = IPCSkeleton::GetCallingTokenID(); - auto tokenID = abilityRecord->GetApplicationInfo().accessTokenId; - if (callingTokenId == tokenID) { - mgr->GetExtensionRunningInfo(abilityRecord, userId, info); + ExtensionRunningInfo extensionInfo; + AppExecFwk::RunningProcessInfo processInfo; + extensionInfo.extension = abilityRecord->GetWant().GetElement(); + auto bms = AbilityUtil::GetBundleManager(); + CHECK_POINTER(bms); + std::vector extensionInfos; + bool queryResult = bms->QueryExtensionAbilityInfos(abilityRecord->GetWant(), + AppExecFwk::AbilityInfoFlag::GET_ABILITY_INFO_WITH_APPLICATION, userId, extensionInfos); + if (queryResult) { + HILOG_INFO("Query Extension Ability Infos Success."); + auto abilityInfo = abilityRecord->GetAbilityInfo(); + auto isExist = [&abilityInfo](const AppExecFwk::ExtensionAbilityInfo &extensionInfo) { + HILOG_INFO("%{public}s, %{public}s", extensionInfo.bundleName.c_str(), extensionInfo.name.c_str()); + return extensionInfo.bundleName == abilityInfo.bundleName && extensionInfo.name == abilityInfo.name + && extensionInfo.applicationInfo.uid == abilityInfo.applicationInfo.uid; + }; + auto infoIter = std::find_if(extensionInfos.begin(), extensionInfos.end(), isExist); + if (infoIter != extensionInfos.end()) { + HILOG_INFO("Get target success."); + extensionInfo.type = (*infoIter).type; } } + DelayedSingleton::GetInstance()-> + GetRunningProcessInfoByToken(abilityRecord->GetToken(), processInfo); + extensionInfo.pid = processInfo.pid_; + extensionInfo.uid = processInfo.uid_; + extensionInfo.processName = processInfo.processName_; + extensionInfo.startTime = abilityRecord->GetStartTime(); + ConnectListType connectRecordList = abilityRecord->GetConnectRecordList(); + for (auto &connectRecord : connectRecordList) { + CHECK_POINTER(connectRecord); + auto callerAbilityRecord = Token::GetAbilityRecordByToken(connectRecord->GetToken()); + CHECK_POINTER(callerAbilityRecord); + std::string package = callerAbilityRecord->GetAbilityInfo().bundleName; + extensionInfo.clientPackage.emplace_back(package); + } + info.emplace_back(extensionInfo); + // extension type }; std::for_each(serviceMap_.begin(), serviceMap_.end(), queryInfo); } -void AbilityConnectManager::GetAbilityRunningInfos(std::vector &info, bool isPerm) +void AbilityConnectManager::GetAbilityRunningInfos(std::vector &info) { HILOG_INFO("Query running ability infos."); std::lock_guard guard(Lock_); - auto queryInfo = [&info, isPerm](ServiceMapType::reference service) { + auto queryInfo = [&info](ServiceMapType::reference service) { auto abilityRecord = service.second; CHECK_POINTER(abilityRecord); - - if (isPerm) { - DelayedSingleton::GetInstance()->GetAbilityRunningInfo(info, abilityRecord); - } else { - auto callingTokenId = IPCSkeleton::GetCallingTokenID(); - auto tokenID = abilityRecord->GetApplicationInfo().accessTokenId; - if (callingTokenId == tokenID) { - DelayedSingleton::GetInstance()->GetAbilityRunningInfo(info, abilityRecord); - } - } + AbilityRunningInfo runningInfo; + AppExecFwk::RunningProcessInfo processInfo; + runningInfo.ability = abilityRecord->GetWant().GetElement(); + DelayedSingleton::GetInstance()-> + GetRunningProcessInfoByToken(abilityRecord->GetToken(), processInfo); + runningInfo.pid = processInfo.pid_; + runningInfo.uid = processInfo.uid_; + runningInfo.processName = processInfo.processName_; + runningInfo.startTime = abilityRecord->GetStartTime(); + runningInfo.abilityState = static_cast(abilityRecord->GetAbilityState()); + info.emplace_back(runningInfo); }; std::for_each(serviceMap_.begin(), serviceMap_.end(), queryInfo); } - -void AbilityConnectManager::GetExtensionRunningInfo(std::shared_ptr &abilityRecord, const int32_t userId, - std::vector &info) -{ - ExtensionRunningInfo extensionInfo; - AppExecFwk::RunningProcessInfo processInfo; - extensionInfo.extension = abilityRecord->GetWant().GetElement(); - auto bms = AbilityUtil::GetBundleManager(); - CHECK_POINTER(bms); - std::vector extensionInfos; - bool queryResult = bms->QueryExtensionAbilityInfos(abilityRecord->GetWant(), - AppExecFwk::AbilityInfoFlag::GET_ABILITY_INFO_WITH_APPLICATION, userId, extensionInfos); - if (queryResult) { - HILOG_INFO("Query Extension Ability Infos Success."); - auto abilityInfo = abilityRecord->GetAbilityInfo(); - auto isExist = [&abilityInfo](const AppExecFwk::ExtensionAbilityInfo &extensionInfo) { - HILOG_INFO("%{public}s, %{public}s", extensionInfo.bundleName.c_str(), extensionInfo.name.c_str()); - return extensionInfo.bundleName == abilityInfo.bundleName && extensionInfo.name == abilityInfo.name - && extensionInfo.applicationInfo.uid == abilityInfo.applicationInfo.uid; - }; - auto infoIter = std::find_if(extensionInfos.begin(), extensionInfos.end(), isExist); - if (infoIter != extensionInfos.end()) { - HILOG_INFO("Get target success."); - extensionInfo.type = (*infoIter).type; - } - } - DelayedSingleton::GetInstance()-> - GetRunningProcessInfoByToken(abilityRecord->GetToken(), processInfo); - extensionInfo.pid = processInfo.pid_; - extensionInfo.uid = processInfo.uid_; - extensionInfo.processName = processInfo.processName_; - extensionInfo.startTime = abilityRecord->GetStartTime(); - ConnectListType connectRecordList = abilityRecord->GetConnectRecordList(); - for (auto &connectRecord : connectRecordList) { - CHECK_POINTER(connectRecord); - auto callerAbilityRecord = Token::GetAbilityRecordByToken(connectRecord->GetToken()); - CHECK_POINTER(callerAbilityRecord); - std::string package = callerAbilityRecord->GetAbilityInfo().bundleName; - extensionInfo.clientPackage.emplace_back(package); - } - info.emplace_back(extensionInfo); -} } // namespace AAFwk } // namespace OHOS diff --git a/services/abilitymgr/src/ability_manager_service.cpp b/services/abilitymgr/src/ability_manager_service.cpp index 5ea8d0a8ede..f41c9e1bd3f 100644 --- a/services/abilitymgr/src/ability_manager_service.cpp +++ b/services/abilitymgr/src/ability_manager_service.cpp @@ -41,8 +41,6 @@ #include "lock_screen_white_list.h" #include "mission/mission_info_converter.h" #include "mission_info_mgr.h" -#include "permission_constants.h" -#include "permission_verification.h" #include "sa_mgr_client.h" #include "softbus_bus_center.h" #include "string_ex.h" @@ -191,6 +189,8 @@ bool AbilityManagerService::Init() useNewMission_ = amsConfigResolver_->IsUseNewMission(); SetStackManager(userId, true); + systemAppManager_ = std::make_shared(0); + CHECK_POINTER_RETURN_BOOL(systemAppManager_); InitMissionListManager(userId, true); @@ -264,9 +264,9 @@ int AbilityManagerService::StartAbilityInner(const Want &want, const sptrStartAbility(abilityRequest); } else { + if (IsSystemUiApp(abilityRequest.abilityInfo)) { + HILOG_DEBUG("%{public}s OldMission Start SystemUiApp", __func__); + return systemAppManager_->StartAbility(abilityRequest); + } + auto stackManager = GetStackManagerByUserId(validUserId); if (!stackManager) { HILOG_ERROR("stackManager is nullptr. userId=%{public}d", validUserId); @@ -360,9 +365,9 @@ int AbilityManagerService::StartAbility(const Want &want, const AbilityStartSett BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_DEBUG("Start ability setting."); - if (VerifyAccountPermission(userId) == CHECK_PERMISSION_FAILED) { - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; + if (userId != INVALID_USER_ID && !CheckCallerIsSystemAppByIpc()) { + HILOG_ERROR("caller is not systemApp"); + return CALLER_ISNOT_SYSTEMAPP; } if (callerToken != nullptr && !VerificationAllToken(callerToken)) { @@ -430,6 +435,10 @@ int AbilityManagerService::StartAbility(const Want &want, const AbilityStartSett } return missionListManager->StartAbility(abilityRequest); } else { + if (IsSystemUiApp(abilityRequest.abilityInfo)) { + return systemAppManager_->StartAbility(abilityRequest); + } + auto stackManager = GetStackManagerByUserId(validUserId); if (!stackManager) { HILOG_ERROR("stackManager is nullptr. userId=%{public}d", validUserId); @@ -445,9 +454,9 @@ int AbilityManagerService::StartAbility(const Want &want, const StartOptions &st BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); HILOG_DEBUG("Start ability options."); - if (VerifyAccountPermission(userId) == CHECK_PERMISSION_FAILED) { - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; + if (userId != INVALID_USER_ID && !CheckCallerIsSystemAppByIpc()) { + HILOG_ERROR("caller is not systemApp"); + return CALLER_ISNOT_SYSTEMAPP; } if (callerToken != nullptr && !VerificationAllToken(callerToken)) { @@ -632,7 +641,7 @@ int AbilityManagerService::TerminateAbilityWithFlag(const sptr &t if ((resultWant != nullptr) && AbilityUtil::IsSystemDialogAbility( - abilityRecord->GetAbilityInfo().bundleName, abilityRecord->GetAbilityInfo().name) && + abilityRecord->GetAbilityInfo().bundleName, abilityRecord->GetAbilityInfo().name) && resultWant->HasParameter(AbilityConfig::SYSTEM_DIALOG_KEY) && resultWant->HasParameter(AbilityConfig::SYSTEM_DIALOG_CALLER_BUNDLENAME) && resultWant->HasParameter(AbilityConfig::SYSTEM_DIALOG_REQUEST_PERMISSIONS)) { @@ -972,9 +981,9 @@ int AbilityManagerService::ConnectAbility( CHECK_POINTER_AND_RETURN(connect, ERR_INVALID_VALUE); CHECK_POINTER_AND_RETURN(connect->AsObject(), ERR_INVALID_VALUE); - if (VerifyAccountPermission(userId) == CHECK_PERMISSION_FAILED) { - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; + if (userId != INVALID_USER_ID && !CheckCallerIsSystemAppByIpc()) { + HILOG_ERROR("caller is not systemApp"); + return CALLER_ISNOT_SYSTEMAPP; } if (CheckIfOperateRemote(want)) { @@ -1372,10 +1381,11 @@ int AbilityManagerService::LockMissionForCleanup(int32_t missionId) HILOG_INFO("request unlock mission for clean up all, id :%{public}d", missionId); CHECK_POINTER_AND_RETURN(currentStackManager_, ERR_NO_INIT); - if (VerifyMissionPermission() == CHECK_PERMISSION_FAILED) { - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; + if (!CheckCallerIsSystemAppByIpc()) { + HILOG_ERROR("caller is not system app"); + return CALLER_ISNOT_SYSTEMAPP; } + return currentMissionListManager_->SetMissionLockedState(missionId, true); } @@ -1384,10 +1394,11 @@ int AbilityManagerService::UnlockMissionForCleanup(int32_t missionId) HILOG_INFO("request unlock mission for clean up all, id :%{public}d", missionId); CHECK_POINTER_AND_RETURN(currentStackManager_, ERR_NO_INIT); - if (VerifyMissionPermission() == CHECK_PERMISSION_FAILED) { - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; + if (!CheckCallerIsSystemAppByIpc()) { + HILOG_ERROR("caller is not system app"); + return CALLER_ISNOT_SYSTEMAPP; } + return currentMissionListManager_->SetMissionLockedState(missionId, false); } @@ -1395,11 +1406,13 @@ int AbilityManagerService::RegisterMissionListener(const sptr { HILOG_INFO("request RegisterMissionListener "); CHECK_POINTER_AND_RETURN(currentMissionListManager_, ERR_NO_INIT); + CHECK_POINTER_AND_RETURN(iBundleManager_, ERR_NO_INIT); - if (VerifyMissionPermission() == CHECK_PERMISSION_FAILED) { - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; + if (!CheckCallerIsSystemAppByIpc()) { + HILOG_ERROR("caller is not system app"); + return CALLER_ISNOT_SYSTEMAPP; } + return currentMissionListManager_->RegisterMissionListener(listener); } @@ -1407,11 +1420,13 @@ int AbilityManagerService::UnRegisterMissionListener(const sptrUnRegisterMissionListener(listener); } @@ -1420,10 +1435,11 @@ int AbilityManagerService::GetMissionInfos(const std::string& deviceId, int32_t { HILOG_INFO("request GetMissionInfos."); CHECK_POINTER_AND_RETURN(currentMissionListManager_, ERR_NO_INIT); + CHECK_POINTER_AND_RETURN(iBundleManager_, ERR_NO_INIT); - if (VerifyMissionPermission() == CHECK_PERMISSION_FAILED) { - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; + if (!CheckCallerIsSystemAppByIpc()) { + HILOG_ERROR("caller is not system app"); + return CALLER_ISNOT_SYSTEMAPP; } if (CheckIsRemote(deviceId)) { @@ -1451,10 +1467,11 @@ int AbilityManagerService::GetMissionInfo(const std::string& deviceId, int32_t m { HILOG_INFO("request GetMissionInfo, missionId:%{public}d", missionId); CHECK_POINTER_AND_RETURN(currentMissionListManager_, ERR_NO_INIT); + CHECK_POINTER_AND_RETURN(iBundleManager_, ERR_NO_INIT); - if (VerifyMissionPermission() == CHECK_PERMISSION_FAILED) { - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; + if (!CheckCallerIsSystemAppByIpc()) { + HILOG_ERROR("caller is not system app"); + return CALLER_ISNOT_SYSTEMAPP; } if (CheckIsRemote(deviceId)) { @@ -1487,10 +1504,11 @@ int AbilityManagerService::CleanMission(int32_t missionId) { HILOG_INFO("request CleanMission, missionId:%{public}d", missionId); CHECK_POINTER_AND_RETURN(currentMissionListManager_, ERR_NO_INIT); + CHECK_POINTER_AND_RETURN(iBundleManager_, ERR_NO_INIT); - if (VerifyMissionPermission() == CHECK_PERMISSION_FAILED) { - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; + if (!CheckCallerIsSystemAppByIpc()) { + HILOG_ERROR("caller is not system app"); + return CALLER_ISNOT_SYSTEMAPP; } return currentMissionListManager_->ClearMission(missionId); @@ -1500,10 +1518,11 @@ int AbilityManagerService::CleanAllMissions() { HILOG_INFO("request CleanAllMissions "); CHECK_POINTER_AND_RETURN(currentMissionListManager_, ERR_NO_INIT); + CHECK_POINTER_AND_RETURN(iBundleManager_, ERR_NO_INIT); - if (VerifyMissionPermission() == CHECK_PERMISSION_FAILED) { - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; + if (!CheckCallerIsSystemAppByIpc()) { + HILOG_ERROR("caller is not system app"); + return CALLER_ISNOT_SYSTEMAPP; } return currentMissionListManager_->ClearAllMissions(); @@ -1513,10 +1532,11 @@ int AbilityManagerService::MoveMissionToFront(int32_t missionId) { HILOG_INFO("request MoveMissionToFront, missionId:%{public}d", missionId); CHECK_POINTER_AND_RETURN(currentMissionListManager_, ERR_NO_INIT); + CHECK_POINTER_AND_RETURN(iBundleManager_, ERR_NO_INIT); - if (VerifyMissionPermission() == CHECK_PERMISSION_FAILED) { - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; + if (!CheckCallerIsSystemAppByIpc()) { + HILOG_ERROR("caller is not system app"); + return CALLER_ISNOT_SYSTEMAPP; } return currentMissionListManager_->MoveMissionToFront(missionId); @@ -1526,10 +1546,11 @@ int AbilityManagerService::MoveMissionToFront(int32_t missionId, const StartOpti { HILOG_INFO("request MoveMissionToFront, missionId:%{public}d", missionId); CHECK_POINTER_AND_RETURN(currentMissionListManager_, ERR_NO_INIT); + CHECK_POINTER_AND_RETURN(iBundleManager_, ERR_NO_INIT); - if (VerifyMissionPermission() == CHECK_PERMISSION_FAILED) { - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; + if (!CheckCallerIsSystemAppByIpc()) { + HILOG_ERROR("caller is not system app"); + return CALLER_ISNOT_SYSTEMAPP; } auto options = std::make_shared(startOptions); @@ -1954,6 +1975,7 @@ void AbilityManagerService::DataDumpSysStateInner( void AbilityManagerService::SystemDumpSysStateInner( const std::string& args, std::vector& info, bool isClient, bool isUserID, int userId) { + systemAppManager_->DumpSysState(info, isClient); } void AbilityManagerService::DumpInner(const std::string &args, std::vector &info) @@ -2094,6 +2116,7 @@ void AbilityManagerService::DataDumpStateInner(const std::string &args, std::vec void AbilityManagerService::SystemDumpStateInner(const std::string &args, std::vector &info) { + systemAppManager_->DumpState(info); } void AbilityManagerService::DumpState(const std::string &args, std::vector &info) @@ -2189,6 +2212,9 @@ int AbilityManagerService::AbilityTransitionDone(const sptr &toke } return missionListManager->AbilityTransactionDone(token, state, saveData); } else { + if (IsSystemUiApp(abilityInfo)) { + return systemAppManager_->AbilityTransitionDone(token, state); + } auto stackManager = GetStackManagerByUserId(userId); if (!stackManager) { HILOG_ERROR("stackManager is nullptr. userId=%{public}d", userId); @@ -2329,6 +2355,10 @@ void AbilityManagerService::OnAbilityRequestDone(const sptr &toke } missionListManager->OnAbilityRequestDone(token, state); } else { + if (IsSystemUiApp(abilityRecord->GetAbilityInfo())) { + systemAppManager_->OnAbilityRequestDone(token, state); + break; + } auto stackManager = GetStackManagerByUserId(userId); if (!stackManager) { HILOG_ERROR("stackManager is nullptr. userId=%{public}d", userId); @@ -2349,6 +2379,7 @@ void AbilityManagerService::OnAppStateChanged(const AppInfo &info) currentMissionListManager_->OnAppStateChanged(info); } else { currentStackManager_->OnAppStateChanged(info); + systemAppManager_->OnAppStateChanged(info); } dataAbilityManager_->OnAppStateChanged(info); } @@ -2661,6 +2692,11 @@ void AbilityManagerService::OnAbilityDied(std::shared_ptr ability return; } } else { + if (systemAppManager_ && abilityRecord->IsKernalSystemAbility()) { + systemAppManager_->OnAbilityDied(abilityRecord); + return; + } + auto manager = GetStackManagerByToken(abilityRecord->GetToken()); if (manager) { manager->OnAbilityDied(abilityRecord); @@ -2703,6 +2739,11 @@ bool AbilityManagerService::IsUseNewMission() int AbilityManagerService::KillProcess(const std::string &bundleName) { HILOG_DEBUG("Kill process, bundleName: %{public}s", bundleName.c_str()); + if (!CheckCallerIsSystemAppByIpc()) { + HILOG_ERROR("caller is not systemApp"); + return CALLER_ISNOT_SYSTEMAPP; + } + auto bms = GetBundleManager(); CHECK_POINTER_AND_RETURN(bms, KILL_PROCESS_FAILED); int32_t userId = GetUserId(); @@ -2727,6 +2768,10 @@ int AbilityManagerService::KillProcess(const std::string &bundleName) int AbilityManagerService::ClearUpApplicationData(const std::string &bundleName) { HILOG_DEBUG("ClearUpApplicationData, bundleName: %{public}s", bundleName.c_str()); + if (!CheckCallerIsSystemAppByIpc()) { + HILOG_ERROR("caller is not systemApp"); + return CALLER_ISNOT_SYSTEMAPP; + } int ret = DelayedSingleton::GetInstance()->ClearUpApplicationData(bundleName); if (ret != ERR_OK) { return CLEAR_APPLICATION_DATA_FAIL; @@ -2737,13 +2782,6 @@ int AbilityManagerService::ClearUpApplicationData(const std::string &bundleName) int AbilityManagerService::UninstallApp(const std::string &bundleName) { HILOG_DEBUG("Uninstall app, bundleName: %{public}s", bundleName.c_str()); - pid_t callingPid = IPCSkeleton::GetCallingPid(); - pid_t pid = getpid(); - if (callingPid != pid) { - HILOG_ERROR("%{public}s: Not bundleMgr call.", __func__); - return CHECK_PERMISSION_FAILED; - } - CHECK_POINTER_AND_RETURN(currentStackManager_, ERR_NO_INIT); currentStackManager_->UninstallApp(bundleName); CHECK_POINTER_AND_RETURN(pendingWantManager_, ERR_NO_INIT); @@ -2847,6 +2885,9 @@ void AbilityManagerService::HandleLoadTimeOut(int64_t eventId) } } } else { + if (systemAppManager_) { + systemAppManager_->OnTimeOut(AbilityManagerService::LOAD_TIMEOUT_MSG, eventId); + } for (auto& item : stackManagers_) { if (item.second) { item.second->OnTimeOut(AbilityManagerService::LOAD_TIMEOUT_MSG, eventId); @@ -2866,6 +2907,9 @@ void AbilityManagerService::HandleActiveTimeOut(int64_t eventId) } } } else { + if (systemAppManager_) { + systemAppManager_->OnTimeOut(AbilityManagerService::ACTIVE_TIMEOUT_MSG, eventId); + } for (auto& item : stackManagers_) { if (item.second) { item.second->OnTimeOut(AbilityManagerService::ACTIVE_TIMEOUT_MSG, eventId); @@ -2902,6 +2946,9 @@ void AbilityManagerService::HandleForegroundNewTimeOut(int64_t eventId) } } } else { + if (systemAppManager_) { + systemAppManager_->OnTimeOut(AbilityManagerService::FOREGROUNDNEW_TIMEOUT_MSG, eventId); + } for (auto& item : stackManagers_) { if (item.second) { item.second->OnTimeOut(AbilityManagerService::FOREGROUNDNEW_TIMEOUT_MSG, eventId); @@ -2920,6 +2967,9 @@ void AbilityManagerService::HandleBackgroundNewTimeOut(int64_t eventId) } } } else { + if (systemAppManager_) { + systemAppManager_->OnTimeOut(AbilityManagerService::BACKGROUNDNEW_TIMEOUT_MSG, eventId); + } for (auto& item : stackManagers_) { if (item.second) { item.second->OnTimeOut(AbilityManagerService::BACKGROUNDNEW_TIMEOUT_MSG, eventId); @@ -2934,6 +2984,7 @@ bool AbilityManagerService::VerificationToken(const sptr &token) CHECK_POINTER_RETURN_BOOL(dataAbilityManager_); CHECK_POINTER_RETURN_BOOL(connectManager_); CHECK_POINTER_RETURN_BOOL(currentStackManager_); + CHECK_POINTER_RETURN_BOOL(systemAppManager_); CHECK_POINTER_RETURN_BOOL(currentMissionListManager_); if (useNewMission_) { @@ -2961,6 +3012,12 @@ bool AbilityManagerService::VerificationToken(const sptr &token) return true; } + if (!useNewMission_) { + if (systemAppManager_->GetAbilityRecordByToken(token)) { + return true; + } + } + HILOG_ERROR("Failed to verify token."); return false; } @@ -3003,6 +3060,12 @@ bool AbilityManagerService::VerificationAllToken(const sptr &toke } } + if (!useNewMission_) { + if (systemAppManager_->GetAbilityRecordByToken(token)) { + return true; + } + } + HILOG_ERROR("Failed to verify all token."); return false; } @@ -3257,6 +3320,7 @@ void AbilityManagerService::RestartAbility(const sptr &token) { HILOG_INFO("%{public}s called", __func__); CHECK_POINTER(currentStackManager_); + CHECK_POINTER(systemAppManager_); if (!VerificationAllToken(token)) { return; } @@ -3613,12 +3677,6 @@ int AbilityManagerService::SetMissionLabel(const sptr &token, con int AbilityManagerService::StartUser(int userId) { HILOG_DEBUG("%{public}s, userId:%{public}d", __func__, userId); - auto isSaCall = AAFwk::PermissionVerification::GetInstance()->IsSACall(); - if (!isSaCall) { - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; - } - if (userController_) { return userController_->StartUser(userId, true); } @@ -3628,12 +3686,6 @@ int AbilityManagerService::StartUser(int userId) int AbilityManagerService::StopUser(int userId, const sptr &callback) { HILOG_DEBUG("%{public}s", __func__); - auto isSaCall = AAFwk::PermissionVerification::GetInstance()->IsSACall(); - if (!isSaCall) { - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; - } - auto ret = -1; if (userController_) { ret = userController_->StopUser(userId); @@ -3659,15 +3711,27 @@ void AbilityManagerService::OnStartSpecifiedAbilityTimeoutResponse(const AAFwk:: { return; } - int AbilityManagerService::GetAbilityRunningInfos(std::vector &info) { HILOG_DEBUG("Get running ability infos."); - auto isPerm = AAFwk::PermissionVerification::GetInstance()->VerifyRunningInfoPerm(); + auto bundleMgr = GetBundleManager(); + if (!bundleMgr) { + HILOG_ERROR("bundleMgr is nullptr."); + return INNER_ERR; + } - currentMissionListManager_->GetAbilityRunningInfos(info, isPerm); - connectManager_->GetAbilityRunningInfos(info, isPerm); - dataAbilityManager_->GetAbilityRunningInfos(info, isPerm); + auto callerUid = IPCSkeleton::GetCallingUid(); + auto isSystem = bundleMgr->CheckIsSystemAppByUid(callerUid); + HILOG_DEBUG("callerUid : %{public}d, isSystem : %{public}d", callerUid, static_cast(isSystem)); + + if (!isSystem) { + HILOG_ERROR("callar is not system app."); + return INNER_ERR; + } + + currentMissionListManager_->GetAbilityRunningInfos(info); + connectManager_->GetAbilityRunningInfos(info); + dataAbilityManager_->GetAbilityRunningInfos(info); return ERR_OK; } @@ -3675,9 +3739,22 @@ int AbilityManagerService::GetAbilityRunningInfos(std::vector &info) { HILOG_DEBUG("Get extension infos, upperLimit : %{public}d", upperLimit); - auto isPerm = AAFwk::PermissionVerification::GetInstance()->VerifyRunningInfoPerm(); + auto bundleMgr = GetBundleManager(); + if (!bundleMgr) { + HILOG_ERROR("bundleMgr is nullptr."); + return INNER_ERR; + } + + auto callerUid = IPCSkeleton::GetCallingUid(); + auto isSystem = bundleMgr->CheckIsSystemAppByUid(callerUid); + HILOG_DEBUG("callerUid : %{public}d, isSystem : %{public}d", callerUid, static_cast(isSystem)); + + if (!isSystem) { + HILOG_ERROR("callar is not system app."); + return INNER_ERR; + } - connectManager_->GetExtensionRunningInfos(upperLimit, info, GetUserId(), isPerm); + connectManager_->GetExtensionRunningInfos(upperLimit, info, GetUserId()); return ERR_OK; } @@ -3703,12 +3780,6 @@ void AbilityManagerService::ClearUserData(int32_t userId) int AbilityManagerService::RegisterSnapshotHandler(const sptr& handler) { - auto isSaCall = AAFwk::PermissionVerification::GetInstance()->IsSACall(); - if (!isSaCall) { - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return 0; - } - if (!currentMissionListManager_) { HILOG_ERROR("snapshot: currentMissionListManager_ is nullptr."); return INNER_ERR; @@ -3721,11 +3792,6 @@ int AbilityManagerService::RegisterSnapshotHandler(const sptr& int32_t AbilityManagerService::GetMissionSnapshot(const std::string& deviceId, int32_t missionId, MissionSnapshot& missionSnapshot) { - if (VerifyMissionPermission() == CHECK_PERMISSION_FAILED) { - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; - } - if (CheckIsRemote(deviceId)) { HILOG_INFO("get remote mission snapshot."); return GetRemoteMissionSnapshotInfo(deviceId, missionId, missionSnapshot); @@ -3987,12 +4053,6 @@ int AbilityManagerService::SetAbilityController(const sptr & int AbilityManagerService::SendANRProcessID(int pid) { - auto isSaCall = AAFwk::PermissionVerification::GetInstance()->IsSACall(); - if (!isSaCall) { - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; - } - int anrTimeOut = amsConfigResolver_->GetANRTimeOutTime(); auto timeoutTask = [pid]() { if (kill(pid, SIGKILL) != ERR_OK) { @@ -4502,57 +4562,5 @@ void AbilityManagerService::StartupResidentProcess() DelayedSingleton::GetInstance()->StartupResidentProcess(); } - -int AbilityManagerService::VerifyMissionPermission() -{ - auto isSaCall = AAFwk::PermissionVerification::GetInstance()->IsSACall(); - if (isSaCall) { - return ERR_OK; - } - auto isCallingPerm = AAFwk::PermissionVerification::GetInstance()->VerifyCallingPermission( - PermissionConstants::PERMISSION_MANAGE_MISSION); - if (isCallingPerm) { - HILOG_DEBUG("%{public}s: Permission verification succeeded.", __func__); - return ERR_OK; - } - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; -} - -void AbilityManagerService::GetAbilityRunningInfo(std::vector &info, - std::shared_ptr &abilityRecord) -{ - AbilityRunningInfo runningInfo; - AppExecFwk::RunningProcessInfo processInfo; - - runningInfo.ability = abilityRecord->GetWant().GetElement(); - runningInfo.startTime = abilityRecord->GetStartTime(); - runningInfo.abilityState = static_cast(abilityRecord->GetAbilityState()); - - DelayedSingleton::GetInstance()-> - GetRunningProcessInfoByToken(abilityRecord->GetToken(), processInfo); - runningInfo.pid = processInfo.pid_; - runningInfo.uid = processInfo.uid_; - runningInfo.processName = processInfo.processName_; - info.emplace_back(runningInfo); -} - -int AbilityManagerService::VerifyAccountPermission(int32_t userId) -{ - if ((userId < 0) || (userController_ && (userController_->GetCurrentUserId() == userId))) { - return ERR_OK; - } - auto isSaCall = AAFwk::PermissionVerification::GetInstance()->IsSACall(); - if (isSaCall) { - return ERR_OK; - } - auto isCallingPerm = AAFwk::PermissionVerification::GetInstance()->VerifyCallingPermission( - PermissionConstants::PERMISSION_INTERACT_ACROSS_LOCAL_ACCOUNTS); - if (isCallingPerm) { - return ERR_OK; - } - HILOG_ERROR("%{public}s: Permission verification failed", __func__); - return CHECK_PERMISSION_FAILED; -} } // namespace AAFwk } // namespace OHOS diff --git a/services/abilitymgr/src/data_ability_manager.cpp b/services/abilitymgr/src/data_ability_manager.cpp index 42df78a47da..898ecdb4269 100644 --- a/services/abilitymgr/src/data_ability_manager.cpp +++ b/services/abilitymgr/src/data_ability_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -18,7 +18,6 @@ #include #include -#include "ability_manager_service.h" #include "ability_util.h" #include "hilog_wrapper.h" @@ -556,12 +555,12 @@ void DataAbilityManager::DumpSysState(std::vector &info, bool isCli return; } -void DataAbilityManager::GetAbilityRunningInfos(std::vector &info, bool isPerm) +void DataAbilityManager::GetAbilityRunningInfos(std::vector &info) { HILOG_INFO("Get ability running infos"); std::lock_guard locker(mutex_); - auto queryInfo = [&info, isPerm](DataAbilityRecordPtrMap::reference data) { + auto queryInfo = [&info](DataAbilityRecordPtrMap::reference data) { auto dataAbilityRecord = data.second; if (!dataAbilityRecord) { return; @@ -572,15 +571,17 @@ void DataAbilityManager::GetAbilityRunningInfos(std::vector return; } - if (isPerm) { - DelayedSingleton::GetInstance()->GetAbilityRunningInfo(info, abilityRecord); - } else { - auto callingTokenId = IPCSkeleton::GetCallingTokenID(); - auto tokenID = abilityRecord->GetApplicationInfo().accessTokenId; - if (callingTokenId == tokenID) { - DelayedSingleton::GetInstance()->GetAbilityRunningInfo(info, abilityRecord); - } - } + AbilityRunningInfo runningInfo; + AppExecFwk::RunningProcessInfo processInfo; + runningInfo.ability = abilityRecord->GetWant().GetElement(); + DelayedSingleton::GetInstance()-> + GetRunningProcessInfoByToken(abilityRecord->GetToken(), processInfo); + runningInfo.pid = processInfo.pid_; + runningInfo.uid = processInfo.uid_; + runningInfo.processName = processInfo.processName_; + runningInfo.startTime = abilityRecord->GetStartTime(); + runningInfo.abilityState = static_cast(abilityRecord->GetAbilityState()); + info.emplace_back(runningInfo); }; std::for_each(dataAbilityRecordsLoading_.begin(), dataAbilityRecordsLoading_.end(), queryInfo); diff --git a/services/abilitymgr/src/kernal_system_app_manager.cpp b/services/abilitymgr/src/kernal_system_app_manager.cpp new file mode 100644 index 00000000000..76ab01a7c45 --- /dev/null +++ b/services/abilitymgr/src/kernal_system_app_manager.cpp @@ -0,0 +1,408 @@ +/* + * 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. + */ + +#include "kernal_system_app_manager.h" + +#include "ability_manager_errors.h" +#include "ability_manager_service.h" +#include "ability_util.h" +#include "app_scheduler.h" +#include "bytrace.h" +#include "hilog_wrapper.h" + +namespace OHOS { +namespace AAFwk { +KernalSystemAppManager::KernalSystemAppManager(int userId) : userId_(userId) +{} + +KernalSystemAppManager::~KernalSystemAppManager() +{} + +int KernalSystemAppManager::StartAbility(const AbilityRequest &abilityRequest) +{ + BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); + HILOG_INFO("start kernal systerm ability."); + std::lock_guard guard(stackLock_); + if (!waittingAbilityQueue_.empty()) { + HILOG_INFO("waiting queue is not empty, so enqueue systerm ui ability for waiting."); + EnqueueWaittingAbility(abilityRequest); + return START_ABILITY_WAITING; + } + + std::shared_ptr topAbilityRecord = GetCurrentTopAbility(); + auto requestFlag = GetFlagOfAbility(abilityRequest.abilityInfo.bundleName, abilityRequest.abilityInfo.name); + if (topAbilityRecord != nullptr) { + auto topFlag = + GetFlagOfAbility(topAbilityRecord->GetAbilityInfo().bundleName, topAbilityRecord->GetAbilityInfo().name); + if (topFlag == requestFlag && topAbilityRecord->GetAbilityState() == INITIAL) { + HILOG_INFO("top systerm ui ability need to restart."); + } + if (topAbilityRecord->GetAbilityState() == ACTIVATING) { + HILOG_INFO("top systerm ui ability is not active, so enqueue ability for waiting."); + EnqueueWaittingAbility(abilityRequest); + return START_ABILITY_WAITING; + } + } + + return StartAbilityLocked(abilityRequest); +} + +int KernalSystemAppManager::StartAbilityLocked(const AbilityRequest &abilityRequest) +{ + std::shared_ptr targetAbility; + GetOrCreateAbilityRecord(abilityRequest, targetAbility); + CHECK_POINTER_AND_RETURN(targetAbility, ERR_INVALID_VALUE); + targetAbility->SetKernalSystemAbility(); + + HILOG_INFO("Load kernal system ability, bundleName:%{public}s , abilityName:%{public}s", + abilityRequest.abilityInfo.bundleName.c_str(), + abilityRequest.abilityInfo.name.c_str()); + + if (targetAbility->IsAbilityState(AbilityState::ACTIVE) || + targetAbility->IsAbilityState(AbilityState::ACTIVATING)) { + HILOG_INFO("kernal system ability is already activing or activated."); + targetAbility->Activate(); + return ERR_OK; + } + return targetAbility->LoadAbility(); +} + +int KernalSystemAppManager::AttachAbilityThread( + const sptr &scheduler, const sptr &token) +{ + HILOG_INFO("Attach ability thread."); + std::lock_guard guard(stackLock_); + auto abilityRecord = GetAbilityRecordByToken(token); + CHECK_POINTER_AND_RETURN(abilityRecord, ERR_INVALID_VALUE); + + std::string flag = KernalSystemAppManager::GetFlagOfAbility( + abilityRecord->GetAbilityInfo().bundleName, abilityRecord->GetAbilityInfo().name); + HILOG_INFO("ability: %{public}s", flag.c_str()); + + auto handler = DelayedSingleton::GetInstance()->GetEventHandler(); + CHECK_POINTER_AND_RETURN(handler, ERR_INVALID_VALUE); + + handler->RemoveEvent(AbilityManagerService::LOAD_TIMEOUT_MSG, abilityRecord->GetEventId()); + + abilityRecord->SetScheduler(scheduler); + DelayedSingleton::GetInstance()->MoveToForground(token); + + return ERR_OK; +} + +void KernalSystemAppManager::OnAbilityRequestDone(const sptr &token, const int32_t state) +{ + HILOG_INFO("On ability request done."); + std::lock_guard guard(stackLock_); + AppAbilityState abilitState = DelayedSingleton::GetInstance()->ConvertToAppAbilityState(state); + if (abilitState == AppAbilityState::ABILITY_STATE_FOREGROUND) { + auto abilityRecord = GetAbilityRecordByToken(token); + CHECK_POINTER(abilityRecord); + abilityRecord->Activate(); + } +} + +void KernalSystemAppManager::OnAppStateChanged(const AppInfo &info) +{ + std::lock_guard guard(stackLock_); + for (auto ability : abilities_) { + if (ability && (info.processName == ability->GetAbilityInfo().process || + info.processName == ability->GetApplicationInfo().bundleName)) { + auto appName = ability->GetApplicationInfo().name; + auto isExist = [&appName](const AppData &appData) { + return appData.appName == appName; + }; + auto iter = std::find_if(info.appData.begin(), info.appData.end(), isExist); + if (iter != info.appData.end()) { + ability->SetAppState(info.state); + } + } + } +} + +int KernalSystemAppManager::AbilityTransitionDone(const sptr &token, int state) +{ + HILOG_INFO("Ability transition done."); + std::lock_guard guard(stackLock_); + auto abilityRecord = GetAbilityRecordByToken(token); + CHECK_POINTER_AND_RETURN(abilityRecord, ERR_INVALID_VALUE); + + std::string flag = KernalSystemAppManager::GetFlagOfAbility( + abilityRecord->GetAbilityInfo().bundleName, abilityRecord->GetAbilityInfo().name); + int targetState = AbilityRecord::ConvertLifeCycleToAbilityState(static_cast(state)); + std::string abilityState = AbilityRecord::ConvertAbilityState(static_cast(targetState)); + HILOG_INFO("ability: %{public}s, state: %{public}s", flag.c_str(), abilityState.c_str()); + + switch (targetState) { + case AbilityState::ACTIVE: { + return DispatchActive(abilityRecord, targetState); + } + default: { + HILOG_WARN("don't support transiting state: %d", targetState); + return ERR_INVALID_VALUE; + } + } +} + +int KernalSystemAppManager::DispatchActive(const std::shared_ptr &abilityRecord, int state) +{ + auto handler = DelayedSingleton::GetInstance()->GetEventHandler(); + CHECK_POINTER_AND_RETURN(handler, ERR_INVALID_VALUE); + CHECK_POINTER_AND_RETURN(abilityRecord, ERR_INVALID_VALUE); + + if (!abilityRecord->IsAbilityState(AbilityState::ACTIVATING)) { + HILOG_ERROR("kernal ability transition life state error. start:%{public}d", state); + return ERR_INVALID_VALUE; + } + handler->RemoveEvent(AbilityManagerService::ACTIVE_TIMEOUT_MSG, abilityRecord->GetEventId()); + + auto task = [weak = weak_from_this(), abilityRecord]() { + auto kernalManager = weak.lock(); + if (kernalManager == nullptr) { + HILOG_ERROR("kernalManager is null, CompleteActive failed"); + return; + } + kernalManager->CompleteActive(abilityRecord); + }; + handler->PostTask(task); + return ERR_OK; +} + +void KernalSystemAppManager::CompleteActive(const std::shared_ptr &abilityRecord) +{ + HILOG_INFO("Complete active."); + std::lock_guard guard(stackLock_); + abilityRecord->SetAbilityState(AbilityState::ACTIVE); + + auto handler = DelayedSingleton::GetInstance()->GetEventHandler(); + CHECK_POINTER(handler); + + auto task = [weak = weak_from_this()]() { + auto kernalManager = weak.lock(); + if (kernalManager == nullptr) { + HILOG_ERROR("kernalManager is null, DequeueWaittingAbility failed"); + return; + } + kernalManager->DequeueWaittingAbility(); + }; + handler->PostTask(task, "DequeueWaittingAbility"); +} + +void KernalSystemAppManager::GetOrCreateAbilityRecord( + const AbilityRequest &abilityRequest, std::shared_ptr &targetAbility) +{ + std::string abilityFlag = KernalSystemAppManager::GetFlagOfAbility( + abilityRequest.abilityInfo.bundleName, abilityRequest.abilityInfo.name); + auto isExist = [targetFlag = abilityFlag](const std::shared_ptr &ability) { + if (ability == nullptr) { + return false; + } + return KernalSystemAppManager::GetFlagOfAbility( + ability->GetAbilityInfo().bundleName, + ability->GetAbilityInfo().name) == targetFlag; + }; + auto iter = std::find_if(abilities_.begin(), abilities_.end(), isExist); + if (iter != abilities_.end()) { + targetAbility = *iter; + targetAbility->SetWant(abilityRequest.want); + targetAbility->SetIsNewWant(true); + return; + } + targetAbility = AbilityRecord::CreateAbilityRecord(abilityRequest); + abilities_.push_front(targetAbility); +} + +std::string KernalSystemAppManager::GetFlagOfAbility(const std::string &bundleName, const std::string &abilityName) +{ + return bundleName + ":" + abilityName; +} + +int KernalSystemAppManager::GetManagerUserId() const +{ + return userId_; +} + +std::shared_ptr KernalSystemAppManager::GetCurrentTopAbility() const +{ + if (abilities_.empty()) { + return nullptr; + } + return abilities_.front(); +} + +std::shared_ptr KernalSystemAppManager::GetAbilityRecordByToken(const sptr &token) +{ + std::lock_guard guard(stackLock_); + auto abilityToFind = Token::GetAbilityRecordByToken(token); + CHECK_POINTER_AND_RETURN(abilityToFind, nullptr); + + auto isExist = [targetAbility = abilityToFind](const std::shared_ptr &ability) { + if (ability == nullptr) { + return false; + } + return targetAbility == ability; + }; + auto iter = std::find_if(abilities_.begin(), abilities_.end(), isExist); + if (iter != abilities_.end()) { + return *iter; + } + + return nullptr; +} + +std::shared_ptr KernalSystemAppManager::GetAbilityRecordByEventId(const int64_t eventId) const +{ + auto isExist = [targetEventId = eventId](const std::shared_ptr &ability) { + if (ability == nullptr) { + return false; + } + return (ability->GetEventId() == targetEventId); + }; + auto iter = std::find_if(abilities_.begin(), abilities_.end(), isExist); + if (iter != abilities_.end()) { + return *iter; + } + return nullptr; +} + +bool KernalSystemAppManager::RemoveAbilityRecord(std::shared_ptr ability) +{ + CHECK_POINTER_RETURN_BOOL(ability); + for (auto iter = abilities_.begin(); iter != abilities_.end(); iter++) { + if ((*iter) == ability) { + abilities_.erase(iter); + return true; + } + } + HILOG_ERROR("can not find ability"); + return false; +} + +void KernalSystemAppManager::EnqueueWaittingAbility(const AbilityRequest &abilityRequest) +{ + waittingAbilityQueue_.push(abilityRequest); + return; +} + +void KernalSystemAppManager::DequeueWaittingAbility() +{ + std::lock_guard guard(stackLock_); + std::shared_ptr topAbility = GetCurrentTopAbility(); + if (topAbility != nullptr && topAbility->GetAbilityState() != ACTIVE) { + HILOG_INFO("top ability is not active, must return for waiting again"); + return; + } + if (!waittingAbilityQueue_.empty()) { + AbilityRequest abilityRequest = waittingAbilityQueue_.front(); + waittingAbilityQueue_.pop(); + HILOG_INFO("bundleName: %{public}s, abilityName: %{public}s", + abilityRequest.abilityInfo.bundleName.c_str(), + abilityRequest.abilityInfo.name.c_str()); + + StartAbilityLocked(abilityRequest); + } +} +void KernalSystemAppManager::DumpState(std::vector &info) +{ + info.emplace_back("SystemUIRecords:"); + for (auto &ability : abilities_) { + ability->Dump(info); + } +} +void KernalSystemAppManager::DumpSysState(std::vector &info, bool isClient) +{ + info.emplace_back("SystemUIRecords:"); + for (auto &ability : abilities_) { + ability->DumpSys(info, isClient); + } +} + +void KernalSystemAppManager::OnAbilityDied(std::shared_ptr abilityRecord) +{ + std::lock_guard guard(stackLock_); + CHECK_POINTER(abilityRecord); + if (!abilityRecord->IsKernalSystemAbility()) { + HILOG_ERROR("System UI on scheduler died, ability type is not system ui"); + return; + } + + if (GetAbilityRecordByToken(abilityRecord->GetToken()) == nullptr) { + HILOG_ERROR("System UI on scheduler died, record is not exist."); + return; + } + auto abilityms = DelayedSingleton::GetInstance(); + CHECK_POINTER(abilityms); + + auto handler = abilityms->GetEventHandler(); + CHECK_POINTER(handler); + + HILOG_INFO("System UI on scheduler died: '%{public}s'", abilityRecord->GetAbilityInfo().name.c_str()); + std::string name = abilityRecord->GetAbilityInfo().name; + abilityRecord->SetAbilityState(AbilityState::INITIAL); + auto timeoutTask = [abilityms, abilityRecord]() { + if (abilityRecord) { + abilityms->StartingSystemUiAbility(); + } + }; + handler->PostTask(timeoutTask, "SystemUi_Die_" + name, AbilityManagerService::RESTART_TIMEOUT); +} +void KernalSystemAppManager::OnTimeOut(uint32_t msgId, int64_t eventId) +{ + std::lock_guard guard(stackLock_); + if (abilities_.empty()) { + HILOG_ERROR("System UI on time out event: ability stack is empty."); + return; + } + + auto abilityRecord = GetAbilityRecordByEventId(eventId); + CHECK_POINTER(abilityRecord); + + auto abilityMS = DelayedSingleton::GetInstance(); + CHECK_POINTER(abilityMS); + + auto handler = abilityMS->GetEventHandler(); + CHECK_POINTER(handler); + + switch (msgId) { + case AbilityManagerService::LOAD_TIMEOUT_MSG: + case AbilityManagerService::ACTIVE_TIMEOUT_MSG: { + std::string bundleName = abilityRecord->GetAbilityInfo().bundleName; + std::string name = abilityRecord->GetAbilityInfo().name; + RemoveAbilityRecord(abilityRecord); + auto task = [abilityMS, bundleName]() { + abilityMS->KillProcess(bundleName); + HILOG_ERROR("System UI on time out event: KillProcess:%{public}s", bundleName.c_str()); + }; + handler->PostTask(task); + auto timeoutTask = [abilityMS, name]() { + abilityMS->StartingSystemUiAbility(); + HILOG_ERROR("System UI on time out event: restart:%{public}s", name.c_str()); + }; + handler->PostTask(timeoutTask, "SystemUi_Timeout_" + name, AbilityManagerService::RESTART_TIMEOUT); + break; + } + default: + break; + } +} + +void KernalSystemAppManager::RestartAbility(const std::shared_ptr abilityRecord) +{ + CHECK_POINTER(abilityRecord); + HILOG_DEBUG("Restart ability system ui. %{public}s", abilityRecord->GetAbilityInfo().name.c_str()); + return; +} +} // namespace AAFwk +} // namespace OHOS \ No newline at end of file diff --git a/services/abilitymgr/src/mission_list_manager.cpp b/services/abilitymgr/src/mission_list_manager.cpp index 0883b317598..bbfb8d8c588 100644 --- a/services/abilitymgr/src/mission_list_manager.cpp +++ b/services/abilitymgr/src/mission_list_manager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -2130,11 +2130,11 @@ bool MissionListManager::GetMissionSnapshot(int32_t missionId, const sptr &info, bool isPerm) +void MissionListManager::GetAbilityRunningInfos(std::vector &info) { std::lock_guard guard(managerLock_); - auto func = [&info, isPerm](const std::shared_ptr &mission) { + auto func = [&info](const std::shared_ptr &mission) { if (!mission) { return; } @@ -2144,15 +2144,19 @@ void MissionListManager::GetAbilityRunningInfos(std::vector return; } - if (isPerm) { - DelayedSingleton::GetInstance()->GetAbilityRunningInfo(info, ability); - } else { - auto callingTokenId = IPCSkeleton::GetCallingTokenID(); - auto tokenID = ability->GetApplicationInfo().accessTokenId; - if (callingTokenId == tokenID) { - DelayedSingleton::GetInstance()->GetAbilityRunningInfo(info, ability); - } - } + AbilityRunningInfo runningInfo; + AppExecFwk::RunningProcessInfo processInfo; + + runningInfo.ability = ability->GetWant().GetElement(); + runningInfo.startTime = ability->GetStartTime(); + runningInfo.abilityState = static_cast(ability->GetAbilityState()); + + DelayedSingleton::GetInstance()-> + GetRunningProcessInfoByToken(ability->GetToken(), processInfo); + runningInfo.pid = processInfo.pid_; + runningInfo.uid = processInfo.uid_; + runningInfo.processName = processInfo.processName_; + info.emplace_back(runningInfo); }; if (!(defaultStandardList_->GetAllMissions().empty())) { auto list = defaultStandardList_->GetAllMissions(); diff --git a/services/abilitymgr/test/BUILD.gn b/services/abilitymgr/test/BUILD.gn index f434c2e1399..62275bf0ba3 100644 --- a/services/abilitymgr/test/BUILD.gn +++ b/services/abilitymgr/test/BUILD.gn @@ -43,6 +43,7 @@ ohos_source_set("abilityms_test_source") { "${services_path}/abilitymgr/src/data_ability_record.cpp", "${services_path}/abilitymgr/src/image_info.cpp", "${services_path}/abilitymgr/src/inner_mission_info.cpp", + "${services_path}/abilitymgr/src/kernal_system_app_manager.cpp", "${services_path}/abilitymgr/src/launch_param.cpp", "${services_path}/abilitymgr/src/lifecycle_deal.cpp", "${services_path}/abilitymgr/src/lifecycle_state_info.cpp", @@ -186,6 +187,7 @@ group("unittest") { "unittest/phone/data_ability_manager_test:unittest", "unittest/phone/data_ability_record_test:unittest", "unittest/phone/info_test:unittest", + "unittest/phone/kernal_system_app_manager_test:unittest", "unittest/phone/lifecycle_deal_test:unittest", "unittest/phone/lifecycle_test:unittest", "unittest/phone/lock_screen_white_list_test:unittest", diff --git a/services/abilitymgr/test/mock/libs/appexecfwk_core/src/appmgr/app_mgr_client.cpp b/services/abilitymgr/test/mock/libs/appexecfwk_core/src/appmgr/app_mgr_client.cpp index 8b67084fd6b..5166af58d6f 100644 --- a/services/abilitymgr/test/mock/libs/appexecfwk_core/src/appmgr/app_mgr_client.cpp +++ b/services/abilitymgr/test/mock/libs/appexecfwk_core/src/appmgr/app_mgr_client.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -55,6 +55,11 @@ AppMgrResultCode AppMgrClient::RegisterAppStateCallback(const sptr &token, const sptr &preToken, const int32_t visibility, const int32_t perceptibility, const int32_t connectionState) @@ -87,6 +92,16 @@ AppMgrResultCode AppMgrClient::GetAllRunningProcesses(std::vectorSetStackManager(userId, true); EXPECT_TRUE(g_abilityMs->GetStackManager()); g_abilityMs->stackManagers_.emplace(0, g_abilityMs->GetStackManager()); + g_abilityMs->systemAppManager_ = std::make_shared(userId); + EXPECT_TRUE(g_abilityMs->systemAppManager_); g_abilityMs->eventLoop_->Run(); 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 bc4eb8244c2..f52e46e79d2 100755 --- a/services/abilitymgr/test/unittest/phone/ability_manager_proxy_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/ability_manager_proxy_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -44,7 +44,6 @@ ohos_unittest("ability_manager_proxy_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/ability_manager_service_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/ability_manager_service_test/BUILD.gn index ab7a3c736d9..e57df554d35 100755 --- a/services/abilitymgr/test/unittest/phone/ability_manager_service_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/ability_manager_service_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -44,7 +44,6 @@ ohos_unittest("ability_manager_service_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", diff --git a/services/abilitymgr/test/unittest/phone/ability_manager_service_test/ability_manager_service_test.cpp b/services/abilitymgr/test/unittest/phone/ability_manager_service_test/ability_manager_service_test.cpp index c75b01ef44c..6a0eb76d93e 100644 --- a/services/abilitymgr/test/unittest/phone/ability_manager_service_test/ability_manager_service_test.cpp +++ b/services/abilitymgr/test/unittest/phone/ability_manager_service_test/ability_manager_service_test.cpp @@ -149,6 +149,8 @@ void AbilityManagerServiceTest::OnStartAms() abilityMs_->SetStackManager(userId, true); EXPECT_TRUE(abilityMs_->GetStackManager()); abilityMs_->stackManagers_.emplace(0, abilityMs_->GetStackManager()); + abilityMs_->systemAppManager_ = std::make_shared(userId); + EXPECT_TRUE(abilityMs_->systemAppManager_); abilityMs_->eventLoop_->Run(); return; } @@ -1982,6 +1984,208 @@ HWTEST_F(AbilityManagerServiceTest, systemDialog_002, TestSize.Level1) EXPECT_EQ(MusicAbility->GetAbilityInfo().bundleName, "com.ix.hiMusic"); } +/* + * Feature: AbilityManagerService + * Function: HandleLoadTimeOut + * SubFunction: NA + * FunctionPoints: AbilityManagerService HandleLoadTimeOut + * EnvConditions: NA + * CaseDescription: Verify function HandleLoadTimeOut + * When you start systemui, when HandleLoadTimeOut called, restart systemui + */ +HWTEST_F(AbilityManagerServiceTest, handleloadtimeout_001, TestSize.Level1) +{ + // start SYSTEM_UI_STATUS_BAR when device get up + Want want; + ElementName elementbar("device", AbilityConfig::SYSTEM_UI_BUNDLE_NAME, AbilityConfig::SYSTEM_UI_STATUS_BAR); + want.SetElement(elementbar); + auto result = StartAbility(want); + EXPECT_EQ(OHOS::ERR_OK, result); + + auto stackManager = abilityMs_->systemAppManager_; + auto barAbility = stackManager->GetCurrentTopAbility(); + AbilityRecordInfo barAbilityInfo; + barAbility->GetAbilityRecordInfo(barAbilityInfo); + auto dialogtoken = barAbility->GetToken(); + + OHOS::sptr scheduler = new AbilityScheduler(); + EXPECT_EQ(abilityMs_->AttachAbilityThread(scheduler, dialogtoken), OHOS::ERR_OK); + EXPECT_TRUE(barAbility->GetAbilityInfo().bundleName == AbilityConfig::SYSTEM_UI_BUNDLE_NAME); + + abilityMs_->HandleLoadTimeOut(barAbility->GetEventId()); + + auto newStackManager = abilityMs_->systemAppManager_; + auto newBarAbility = newStackManager->GetCurrentTopAbility(); + + // Remove Ability Record + EXPECT_FALSE(newBarAbility); +} + +/* + * Feature: AbilityManagerService + * Function: HandleLoadTimeOut + * SubFunction: NA + * FunctionPoints: AbilityManagerService HandleLoadTimeOut + * EnvConditions: NA + * CaseDescription: Verify function HandleLoadTimeOut + * When you start systemui, when HandleLoadTimeOut called, restart systemui + */ +HWTEST_F(AbilityManagerServiceTest, handleloadtimeout_002, TestSize.Level1) +{ + // start SYSTEM_UI_NAVIGATION_BAR when device get up + Want want; + ElementName elementdialog("device", AbilityConfig::SYSTEM_UI_BUNDLE_NAME, AbilityConfig::SYSTEM_UI_NAVIGATION_BAR); + want.SetElement(elementdialog); + auto result = StartAbility(want); + WaitUntilTaskFinished(); + EXPECT_EQ(OHOS::ERR_OK, result); + + auto stackManager = abilityMs_->systemAppManager_; + auto navigationAbility = stackManager->GetCurrentTopAbility(); + auto dialogtoken = navigationAbility->GetToken(); + + OHOS::sptr scheduler = new AbilityScheduler(); + EXPECT_EQ(abilityMs_->AttachAbilityThread(scheduler, dialogtoken), OHOS::ERR_OK); + EXPECT_TRUE(navigationAbility->GetAbilityInfo().bundleName == AbilityConfig::SYSTEM_UI_BUNDLE_NAME); + + abilityMs_->HandleLoadTimeOut(navigationAbility->GetEventId()); + WaitUntilTaskFinishedByTimer(); + + auto newStackManager = abilityMs_->systemAppManager_; + auto newNavigationAbility = newStackManager->GetCurrentTopAbility(); + EXPECT_TRUE(newNavigationAbility->GetAbilityInfo().bundleName == AbilityConfig::SYSTEM_UI_BUNDLE_NAME); + EXPECT_NE(navigationAbility, newNavigationAbility); +} + +/* + * Feature: AbilityManagerService + * Function: HandleLoadTimeOut + * SubFunction: NA + * FunctionPoints: AbilityManagerService HandleLoadTimeOut + * EnvConditions: NA + * CaseDescription: Verify function HandleLoadTimeOut + * When you start systemui, when timeout ,the HandleLoadTimeOut called, restart systemui + */ +HWTEST_F(AbilityManagerServiceTest, handleloadtimeout_003, TestSize.Level1) +{ + // start SYSTEM_UI_STATUS_BAR when device get up + Want want; + ElementName elementbar("device", AbilityConfig::SYSTEM_UI_BUNDLE_NAME, AbilityConfig::SYSTEM_UI_STATUS_BAR); + want.SetElement(elementbar); + auto result = StartAbility(want); + EXPECT_EQ(OHOS::ERR_OK, result); + + auto stackManager = abilityMs_->systemAppManager_; + auto barAbility = stackManager->GetCurrentTopAbility(); + AbilityRecordInfo barAbilityInfo; + barAbility->GetAbilityRecordInfo(barAbilityInfo); + EXPECT_TRUE(barAbility->GetAbilityInfo().bundleName == AbilityConfig::SYSTEM_UI_BUNDLE_NAME); + + abilityMs_->HandleLoadTimeOut(barAbility->GetEventId()); + WaitUntilTaskFinishedByTimer(); + + auto newStackManager = abilityMs_->systemAppManager_; + auto newBarAbility = newStackManager->GetCurrentTopAbility(); + AbilityRecordInfo newAbilityInfo; + newBarAbility->GetAbilityRecordInfo(newAbilityInfo); + EXPECT_TRUE(newBarAbility->GetAbilityInfo().bundleName == AbilityConfig::SYSTEM_UI_BUNDLE_NAME); + EXPECT_NE(barAbilityInfo.id, newAbilityInfo.id); +} + +/* + * Feature: AbilityManagerService + * Function: HandleLoadTimeOut + * SubFunction: NA + * FunctionPoints: AbilityManagerService HandleLoadTimeOut + * EnvConditions: NA + * CaseDescription: Verify function HandleLoadTimeOut + * When you start systemui, when timeout ,the HandleLoadTimeOut called, restart systemui + */ +HWTEST_F(AbilityManagerServiceTest, handleloadtimeout_004, TestSize.Level1) +{ + // start SYSTEM_UI_NAVIGATION_BAR when device get up + Want want; + ElementName elementbar("device", AbilityConfig::SYSTEM_UI_BUNDLE_NAME, AbilityConfig::SYSTEM_UI_NAVIGATION_BAR); + want.SetElement(elementbar); + auto result = StartAbility(want); + EXPECT_EQ(OHOS::ERR_OK, result); + + auto stackManager = abilityMs_->systemAppManager_; + auto navigationAbility = stackManager->GetCurrentTopAbility(); + EXPECT_TRUE(navigationAbility->GetAbilityInfo().bundleName == AbilityConfig::SYSTEM_UI_BUNDLE_NAME); + + abilityMs_->HandleLoadTimeOut(navigationAbility->GetEventId()); + WaitUntilTaskFinishedByTimer(); + + auto newStackManager = abilityMs_->systemAppManager_; + auto newNavigationAbility = newStackManager->GetCurrentTopAbility(); + EXPECT_TRUE(newNavigationAbility->GetAbilityInfo().bundleName == AbilityConfig::SYSTEM_UI_BUNDLE_NAME); + EXPECT_NE(navigationAbility, newNavigationAbility); +} + +/* + * Feature: AbilityManagerService + * Function: HandleLoadTimeOut + * SubFunction: NA + * FunctionPoints: AbilityManagerService HandleLoadTimeOut + * EnvConditions: NA + * CaseDescription: Verify function HandleLoadTimeOut + * When you start systemui, when HandleLoadTimeOut called, restart systemui + */ +HWTEST_F(AbilityManagerServiceTest, handleloadtimeout_005, TestSize.Level1) +{ + // start SYSTEM_UI_STATUS_BAR when device get up + Want want; + ElementName elementbar("device", AbilityConfig::SYSTEM_UI_BUNDLE_NAME, AbilityConfig::SYSTEM_UI_STATUS_BAR); + want.SetElement(elementbar); + auto result = StartAbility(want); + EXPECT_EQ(OHOS::ERR_OK, result); + + auto stackManager = abilityMs_->systemAppManager_; + auto barAbility = stackManager->GetCurrentTopAbility(); + auto bartoken = barAbility->GetToken(); + OHOS::sptr scheduler = new AbilityScheduler(); + EXPECT_EQ(abilityMs_->AttachAbilityThread(scheduler, bartoken), OHOS::ERR_OK); + EXPECT_TRUE(barAbility->GetAbilityInfo().bundleName == AbilityConfig::SYSTEM_UI_BUNDLE_NAME); + + auto newStackManager = abilityMs_->systemAppManager_; + auto newBarAbility = newStackManager->GetCurrentTopAbility(); + EXPECT_TRUE(newBarAbility->GetAbilityInfo().bundleName == AbilityConfig::SYSTEM_UI_BUNDLE_NAME); + EXPECT_EQ(barAbility, newBarAbility); +} + +/* + * Feature: AbilityManagerService + * Function: HandleLoadTimeOut + * SubFunction: NA + * FunctionPoints: AbilityManagerService HandleLoadTimeOut + * EnvConditions: NA + * CaseDescription: Verify function HandleLoadTimeOut + * When you start systemui, when HandleLoadTimeOut called, restart systemui + */ +HWTEST_F(AbilityManagerServiceTest, handleloadtimeout_006, TestSize.Level1) +{ + // start SYSTEM_UI_NAVIGATION_BAR when device get up + Want want; + ElementName elementbar("device", AbilityConfig::SYSTEM_UI_BUNDLE_NAME, AbilityConfig::SYSTEM_UI_NAVIGATION_BAR); + want.SetElement(elementbar); + auto result = StartAbility(want); + EXPECT_EQ(OHOS::ERR_OK, result); + + auto stackManager = abilityMs_->systemAppManager_; + auto navigationAbility = stackManager->GetCurrentTopAbility(); + auto navigationtoken = navigationAbility->GetToken(); + OHOS::sptr scheduler = new AbilityScheduler(); + + EXPECT_EQ(abilityMs_->AttachAbilityThread(scheduler, navigationtoken), OHOS::ERR_OK); + EXPECT_TRUE(navigationAbility->GetAbilityInfo().bundleName == AbilityConfig::SYSTEM_UI_BUNDLE_NAME); + + auto newStackManager = abilityMs_->systemAppManager_; + auto newNavigationAbility = newStackManager->GetCurrentTopAbility(); + EXPECT_TRUE(newNavigationAbility->GetAbilityInfo().bundleName == AbilityConfig::SYSTEM_UI_BUNDLE_NAME); + EXPECT_EQ(navigationAbility, newNavigationAbility); +} + /* * Feature: AbilityManagerService * Function: HandleLoadTimeOut diff --git a/services/abilitymgr/test/unittest/phone/ability_manager_stub_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/ability_manager_stub_test/BUILD.gn index f4ecbd64c5e..92fbd890229 100755 --- a/services/abilitymgr/test/unittest/phone/ability_manager_stub_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/ability_manager_stub_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -45,7 +45,6 @@ ohos_unittest("ability_manager_stub_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/ability_record_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/ability_record_test/BUILD.gn index 36e84040fda..0e35f783aa0 100755 --- a/services/abilitymgr/test/unittest/phone/ability_record_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/ability_record_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -43,7 +43,6 @@ ohos_unittest("ability_record_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/ability_scheduler_proxy_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/ability_scheduler_proxy_test/BUILD.gn index b4c07ed6ccd..02d680eff9a 100755 --- a/services/abilitymgr/test/unittest/phone/ability_scheduler_proxy_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/ability_scheduler_proxy_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -44,7 +44,6 @@ ohos_unittest("ability_scheduler_proxy_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/ability_scheduler_stub_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/ability_scheduler_stub_test/BUILD.gn index 74b0042fa29..99516fcda77 100755 --- a/services/abilitymgr/test/unittest/phone/ability_scheduler_stub_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/ability_scheduler_stub_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -43,7 +43,6 @@ ohos_unittest("ability_scheduler_stub_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/ability_service_start_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/ability_service_start_test/BUILD.gn index a6d878c6301..3448571be2f 100755 --- a/services/abilitymgr/test/unittest/phone/ability_service_start_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/ability_service_start_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -44,7 +44,6 @@ ohos_unittest("ability_service_start_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/ability_stack_manager_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/ability_stack_manager_test/BUILD.gn index 2df340911a2..8237b903542 100755 --- a/services/abilitymgr/test/unittest/phone/ability_stack_manager_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/ability_stack_manager_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -45,7 +45,6 @@ ohos_unittest("ability_stack_manager_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", diff --git a/services/abilitymgr/test/unittest/phone/ability_stack_manager_test/ability_stack_manager_test.cpp b/services/abilitymgr/test/unittest/phone/ability_stack_manager_test/ability_stack_manager_test.cpp index cc177c0234a..d4a48a6cb73 100644 --- a/services/abilitymgr/test/unittest/phone/ability_stack_manager_test/ability_stack_manager_test.cpp +++ b/services/abilitymgr/test/unittest/phone/ability_stack_manager_test/ability_stack_manager_test.cpp @@ -102,6 +102,8 @@ void AbilityStackManagerTest::OnStartabilityMs() int userId = abilityMs_->GetUserId(); abilityMs_->SetStackManager(userId, true); + abilityMs_->systemAppManager_ = std::make_shared(userId); + EXPECT_TRUE(abilityMs_->systemAppManager_); abilityMs_->eventLoop_->Run(); diff --git a/services/abilitymgr/test/unittest/phone/ability_token_proxy_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/ability_token_proxy_test/BUILD.gn index cae5d4e5979..d494af6662b 100755 --- a/services/abilitymgr/test/unittest/phone/ability_token_proxy_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/ability_token_proxy_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -43,7 +43,6 @@ ohos_unittest("ability_token_proxy_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/ability_token_stub_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/ability_token_stub_test/BUILD.gn index 39f371c0d49..0938daba97e 100755 --- a/services/abilitymgr/test/unittest/phone/ability_token_stub_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/ability_token_stub_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -43,7 +43,6 @@ ohos_unittest("ability_token_stub_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/ability_with_applications_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/ability_with_applications_test/BUILD.gn index 323939e7dfb..960e6bc85b4 100755 --- a/services/abilitymgr/test/unittest/phone/ability_with_applications_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/ability_with_applications_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -45,7 +45,6 @@ ohos_unittest("ability_with_applications_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", diff --git a/services/abilitymgr/test/unittest/phone/ability_with_applications_test/ability_with_applications_test.cpp b/services/abilitymgr/test/unittest/phone/ability_with_applications_test/ability_with_applications_test.cpp index 3832cc4892c..8f43d105079 100644 --- a/services/abilitymgr/test/unittest/phone/ability_with_applications_test/ability_with_applications_test.cpp +++ b/services/abilitymgr/test/unittest/phone/ability_with_applications_test/ability_with_applications_test.cpp @@ -116,6 +116,8 @@ void AbilityWithApplicationsTest::OnStartabilityAms() int userId = abilityMs_->GetUserId(); abilityMs_->SetStackManager(userId, true); + abilityMs_->systemAppManager_ = std::make_shared(userId); + EXPECT_TRUE(abilityMs_->systemAppManager_); abilityMs_->eventLoop_->Run(); diff --git a/services/abilitymgr/test/unittest/phone/abilityms_appms_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/abilityms_appms_test/BUILD.gn index 0e61c748a6c..404a2f9920b 100755 --- a/services/abilitymgr/test/unittest/phone/abilityms_appms_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/abilityms_appms_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -45,7 +45,6 @@ ohos_unittest("abilityms_appms_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", diff --git a/services/abilitymgr/test/unittest/phone/abilityms_appms_test/abilityms_appms_test.cpp b/services/abilitymgr/test/unittest/phone/abilityms_appms_test/abilityms_appms_test.cpp index 920430901c3..a529e853178 100644 --- a/services/abilitymgr/test/unittest/phone/abilityms_appms_test/abilityms_appms_test.cpp +++ b/services/abilitymgr/test/unittest/phone/abilityms_appms_test/abilityms_appms_test.cpp @@ -122,6 +122,8 @@ void AbilityMsAppmsTest::OnStartabilityAms() int userId = abilityMs_->GetUserId(); abilityMs_->SetStackManager(userId, true); + abilityMs_->systemAppManager_ = std::make_shared(userId); + EXPECT_TRUE(abilityMs_->systemAppManager_); abilityMs_->eventLoop_->Run(); diff --git a/services/abilitymgr/test/unittest/phone/app_scheduler_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/app_scheduler_test/BUILD.gn index 1389f55322e..1c807996239 100755 --- a/services/abilitymgr/test/unittest/phone/app_scheduler_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/app_scheduler_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -45,7 +45,6 @@ ohos_unittest("app_scheduler_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base", diff --git a/services/abilitymgr/test/unittest/phone/configuration_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/configuration_test/BUILD.gn index 3ca2e5d755a..5550f0a415d 100755 --- a/services/abilitymgr/test/unittest/phone/configuration_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/configuration_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -45,7 +45,6 @@ ohos_unittest("configuration_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//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", diff --git a/services/abilitymgr/test/unittest/phone/connection_record_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/connection_record_test/BUILD.gn index 1f24c5e8acc..5d93f1f55a2 100755 --- a/services/abilitymgr/test/unittest/phone/connection_record_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/connection_record_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -43,7 +43,6 @@ ohos_unittest("connection_record_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/data_ability_manager_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/data_ability_manager_test/BUILD.gn index 795322688f7..2d2f88add92 100755 --- a/services/abilitymgr/test/unittest/phone/data_ability_manager_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/data_ability_manager_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -52,7 +52,6 @@ ohos_unittest("data_ability_manager_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", diff --git a/services/abilitymgr/test/unittest/phone/data_ability_record_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/data_ability_record_test/BUILD.gn index 343f99b46dd..e9a738877fb 100755 --- a/services/abilitymgr/test/unittest/phone/data_ability_record_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/data_ability_record_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -49,7 +49,6 @@ ohos_unittest("data_ability_record_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/info_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/info_test/BUILD.gn index 6a0d2bd51d4..41e10660eec 100755 --- a/services/abilitymgr/test/unittest/phone/info_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/info_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -43,7 +43,6 @@ ohos_unittest("info_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/kernal_system_app_manager_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/kernal_system_app_manager_test/BUILD.gn new file mode 100755 index 00000000000..50f8c4b2e43 --- /dev/null +++ b/services/abilitymgr/test/unittest/phone/kernal_system_app_manager_test/BUILD.gn @@ -0,0 +1,72 @@ +# 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. + +import("//build/test.gni") +import("//foundation/aafwk/standard/aafwk.gni") + +module_output_path = "ability_runtime/abilitymgr" + +ohos_unittest("kernal_system_app_mgr_test") { + module_out_path = module_output_path + + include_dirs = [ + "${services_path}/abilitymgr/test/mock/libs/system_ability_mock", + "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include", + "//foundation/distributedschedule/samgr/adapter/interfaces/innerkits/include/", + "//foundation/aafwk/standard/services/abilitymgr/test/mock/libs/ability_scheduler_mock", + "//foundation/aafwk/standard/services/abilitymgr/include/", + "//foundation/aafwk/standard/services/abilitymgr/test/mock/libs/appexecfwk_core/include", + "//foundation/aafwk/standard/services/abilitymgr/test/mock/include", + "//foundation/aafwk/standard/services/abilitymgr/include", + ] + + sources = [ + "//foundation/aafwk/standard/services/abilitymgr/test/mock/libs/appexecfwk_core/src/appmgr/mock_app_scheduler.cpp", + "kernal_system_app_manager_test.cpp", # add mock file + ] + + configs = [ "${services_path}/abilitymgr:abilityms_config" ] + cflags = [] + if (target_cpu == "arm") { + cflags += [ "-DBINDER_IPC_32BIT" ] + } + deps = [ + "${innerkits_path}/want:want", + "${services_path}/abilitymgr/test:abilityms_test_source", + "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", + "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", + "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", + "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", + "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", + "//foundation/aafwk/standard/services/abilitymgr:abilityms", + "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base", + "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler", + "//foundation/distributedschedule/dmsfwk/interfaces/innerkits/uri:zuri", + "//third_party/googletest:gmock_main", + "//third_party/googletest:gtest_main", + "//third_party/libpng:libpng", + "//utils/native/base:utils", + ] + external_deps = [ + "access_token:libaccesstoken_sdk", + "device_manager_base:devicemanagersdk", + "hiviewdfx_hilog_native:libhilog", + "ipc:ipc_core", + ] +} + +group("unittest") { + testonly = true + + deps = [ ":kernal_system_app_mgr_test" ] +} diff --git a/services/abilitymgr/test/unittest/phone/kernal_system_app_manager_test/kernal_system_app_manager_test.cpp b/services/abilitymgr/test/unittest/phone/kernal_system_app_manager_test/kernal_system_app_manager_test.cpp new file mode 100644 index 00000000000..73f7fdbb841 --- /dev/null +++ b/services/abilitymgr/test/unittest/phone/kernal_system_app_manager_test/kernal_system_app_manager_test.cpp @@ -0,0 +1,614 @@ +/* + * 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. + */ +#if 1 +#include + +#define private public +#include "sa_mgr_client.h" +#include "kernal_system_app_manager.h" +#include "app_scheduler.h" +#undef private + +#include "ability_config.h" +#include "ability_manager_service.h" +#include "ability_manager_errors.h" +#include "ability_scheduler_mock.h" +#include "bundlemgr/mock_bundle_manager.h" +#include "mock_app_manager_client.h" + +using namespace testing; +using namespace testing::ext; + +namespace OHOS { +namespace AAFwk { + +static void WaitUntilTaskFinished() +{ + const uint32_t maxRetryCount = 1000; + const uint32_t sleepTime = 1000; + uint32_t count = 0; + auto handler = OHOS::DelayedSingleton::GetInstance()->GetEventHandler(); + std::atomic taskCalled(false); + auto f = [&taskCalled]() { taskCalled.store(true); }; + if (handler->PostTask(f)) { + while (!taskCalled.load()) { + ++count; + if (count >= maxRetryCount) { + break; + } + usleep(sleepTime); + } + } +} + +class KernalSystemAppManagerTest : public testing::Test { +public: + static void SetUpTestCase(); + static void TearDownTestCase(); + void SetUp(); + void TearDown(); + void StartSystemUI(); + +public: + std::shared_ptr kernalSystemMgr_ {nullptr}; + int usrId_ = 10; + Want want_ {}; + AppExecFwk::AbilityInfo abilityInfo_ {}; + AppExecFwk::ApplicationInfo appInfo_ {}; +}; + +void KernalSystemAppManagerTest::SetUpTestCase() +{ + int systemAbilityId = 401; + OHOS::DelayedSingleton::GetInstance()->RegisterSystemAbility( + systemAbilityId, new (std::nothrow) AppExecFwk::BundleMgrService()); + DelayedSingleton::GetInstance()->OnStart(); +} + +void KernalSystemAppManagerTest::TearDownTestCase() +{ + OHOS::DelayedSingleton::GetInstance()->OnStop(); + OHOS::DelayedSingleton::DestroyInstance(); +} + +void KernalSystemAppManagerTest::SetUp() +{ + kernalSystemMgr_ = std::make_shared(usrId_); + kernalSystemMgr_->abilities_.clear(); + std::queue().swap(kernalSystemMgr_->waittingAbilityQueue_); +} + +void KernalSystemAppManagerTest::TearDown() +{ + kernalSystemMgr_.reset(); +} + +void KernalSystemAppManagerTest::StartSystemUI() +{ + Want want; + want.SetElementName(AbilityConfig::SYSTEM_UI_BUNDLE_NAME, AbilityConfig::SYSTEM_UI_STATUS_BAR); + + AbilityRequest request; + request.want = want; + request.requestCode = -1; + request.callerToken = nullptr; + request.abilityInfo.name = AbilityConfig::SYSTEM_UI_STATUS_BAR; + request.abilityInfo.bundleName = AbilityConfig::SYSTEM_UI_BUNDLE_NAME; + request.appInfo.isLauncherApp = true; + request.appInfo.name = AbilityConfig::SYSTEM_UI_STATUS_BAR; + request.appInfo.bundleName = AbilityConfig::SYSTEM_UI_BUNDLE_NAME; + + EXPECT_TRUE(kernalSystemMgr_); + + auto ref = kernalSystemMgr_->StartAbility(request); + WaitUntilTaskFinished(); + EXPECT_EQ(ERR_OK, ref); +} + +/* + * Feature: KernalSystemAppManager + * Function: StartAbility,StartAbilityLocked + * SubFunction: Processing preconditions + * FunctionPoints: KernalSystemAppManager StartAbility + * EnvConditions:Is Kernal System Ability + * CaseDescription: Start a system level aa + */ +HWTEST_F(KernalSystemAppManagerTest, StartAbility_001, TestSize.Level1) +{ + // start a system ui + Want want; + want.SetElementName(AbilityConfig::SYSTEM_UI_BUNDLE_NAME, AbilityConfig::SYSTEM_UI_STATUS_BAR); + + AbilityRequest request; + request.want = want; + request.requestCode = -1; + request.callerToken = nullptr; + request.abilityInfo.name = AbilityConfig::SYSTEM_UI_STATUS_BAR; + request.abilityInfo.bundleName = AbilityConfig::SYSTEM_UI_BUNDLE_NAME; + request.appInfo.isLauncherApp = true; + request.appInfo.name = "syetemUi"; + request.appInfo.bundleName = AbilityConfig::SYSTEM_UI_BUNDLE_NAME; + EXPECT_TRUE(kernalSystemMgr_); + + auto ref = kernalSystemMgr_->StartAbility(request); + WaitUntilTaskFinished(); + EXPECT_EQ(ERR_OK, ref); + EXPECT_EQ(static_cast(kernalSystemMgr_->abilities_.size()), 1); + + auto topAbilityRecord = kernalSystemMgr_->GetCurrentTopAbility(); + EXPECT_TRUE(topAbilityRecord); + EXPECT_TRUE(topAbilityRecord->IsKernalSystemAbility()); + topAbilityRecord->SetAbilityState(AbilityState::INITIAL); + + // start agin + auto refBegin = kernalSystemMgr_->StartAbility(request); + WaitUntilTaskFinished(); + EXPECT_EQ(ERR_OK, refBegin); + // same aa, so size is 1. Just update not push + EXPECT_EQ(static_cast(kernalSystemMgr_->abilities_.size()), 1); + EXPECT_TRUE(topAbilityRecord->IsNewWant()); +} + +/* + * Feature: KernalSystemAppManager + * Function: StartAbility,StartAbilityLocked + * SubFunction: Processing preconditions + * FunctionPoints: KernalSystemAppManager StartAbility + * EnvConditions:Is Kernal System Ability + * CaseDescription: Start a system level aa + */ +HWTEST_F(KernalSystemAppManagerTest, StartAbility_002, TestSize.Level1) +{ + // start a system ui + Want want; + want.SetElementName(AbilityConfig::SYSTEM_UI_BUNDLE_NAME, AbilityConfig::SYSTEM_UI_STATUS_BAR); + AbilityRequest request; + request.want = want; + request.requestCode = -1; + request.callerToken = nullptr; + request.abilityInfo.name = AbilityConfig::SYSTEM_UI_STATUS_BAR; + request.abilityInfo.bundleName = AbilityConfig::SYSTEM_UI_BUNDLE_NAME; + request.appInfo.isLauncherApp = true; + request.appInfo.name = "syetemUi"; + request.appInfo.bundleName = AbilityConfig::SYSTEM_UI_BUNDLE_NAME; + + Want wantBar; + wantBar.SetElementName(AbilityConfig::SYSTEM_UI_BUNDLE_NAME, AbilityConfig::SYSTEM_UI_NAVIGATION_BAR); + AbilityRequest requestBar; + requestBar.want = wantBar; + requestBar.requestCode = -1; + requestBar.callerToken = nullptr; + requestBar.abilityInfo.name = AbilityConfig::SYSTEM_UI_STATUS_BAR; + requestBar.abilityInfo.bundleName = AbilityConfig::SYSTEM_UI_NAVIGATION_BAR; + requestBar.appInfo.isLauncherApp = true; + requestBar.appInfo.name = "syetemUi"; + requestBar.appInfo.bundleName = AbilityConfig::SYSTEM_UI_BUNDLE_NAME; + + // nullptr name and bundlename + Want wantPage; + AbilityRequest requestPage; + requestPage.want = wantPage; + requestPage.requestCode = -1; + requestPage.callerToken = nullptr; + EXPECT_TRUE(kernalSystemMgr_); + + int firstStartRef = kernalSystemMgr_->StartAbility(request); + WaitUntilTaskFinished(); + auto topAbilityRecord = kernalSystemMgr_->GetCurrentTopAbility(); + EXPECT_TRUE(topAbilityRecord); + topAbilityRecord->SetAbilityState(AbilityState::ACTIVATING); + + int secondStartRef = kernalSystemMgr_->StartAbility(requestBar); + int thirdStartRef = kernalSystemMgr_->StartAbility(requestPage); + + EXPECT_EQ(static_cast(kernalSystemMgr_->abilities_.size()), 1); + EXPECT_EQ(static_cast(kernalSystemMgr_->waittingAbilityQueue_.size()), 2); + EXPECT_EQ(ERR_OK, firstStartRef); + EXPECT_EQ(START_ABILITY_WAITING, secondStartRef); + EXPECT_EQ(START_ABILITY_WAITING, thirdStartRef); +} + +/* + * Feature: KernalSystemAppManager + * Function: AttachAbilityThread + * SubFunction: binding app + * FunctionPoints: bingding app and move to forground + * EnvConditions:Is Kernal System Ability + * CaseDescription: have a ability to attach + */ +HWTEST_F(KernalSystemAppManagerTest, AttachAbilityThread_001, TestSize.Level1) +{ + EXPECT_TRUE(kernalSystemMgr_); + sptr scheduler = nullptr; + sptr token = nullptr; + + int ref = kernalSystemMgr_->AttachAbilityThread(scheduler, token); + EXPECT_EQ(ERR_INVALID_VALUE, ref); + + StartSystemUI(); + auto topAbilityRecord = kernalSystemMgr_->GetCurrentTopAbility(); + EXPECT_TRUE(topAbilityRecord); + // scheduler judge null is on the upper level, in ams, so is return ok + ref = kernalSystemMgr_->AttachAbilityThread(scheduler, topAbilityRecord->GetToken()); + EXPECT_EQ(ERR_OK, ref); + + sptr mokecheduler = new AbilitySchedulerMock(); + ref = kernalSystemMgr_->AttachAbilityThread(mokecheduler, topAbilityRecord->GetToken()); + EXPECT_EQ(ERR_OK, ref); +} + +/* + * Feature: KernalSystemAppManager + * Function: AbilityTransitionDone + * SubFunction: Processing preconditions + * FunctionPoints: KernalSystemAppManager StartAbility + * EnvConditions:Is Kernal System Ability + * CaseDescription: Notification status + */ +HWTEST_F(KernalSystemAppManagerTest, AbilityTransitionDone_001, TestSize.Level1) +{ + EXPECT_TRUE(kernalSystemMgr_); + sptr token = nullptr; + + int ref = kernalSystemMgr_->AbilityTransitionDone(token, -1); + EXPECT_EQ(ERR_INVALID_VALUE, ref); + + StartSystemUI(); + auto topAbilityRecord = kernalSystemMgr_->GetCurrentTopAbility(); + EXPECT_TRUE(topAbilityRecord); + ref = kernalSystemMgr_->AbilityTransitionDone(topAbilityRecord->GetToken(), -1); + EXPECT_EQ(ERR_INVALID_VALUE, ref); + + // The right example + topAbilityRecord->SetAbilityState(AbilityState::ACTIVATING); + ref = kernalSystemMgr_->AbilityTransitionDone(topAbilityRecord->GetToken(), AbilityState::ACTIVE); + EXPECT_EQ(ERR_OK, ref); + WaitUntilTaskFinished(); + + ref = kernalSystemMgr_->AbilityTransitionDone(topAbilityRecord->GetToken(), AbilityState::INITIAL); + EXPECT_EQ(ERR_INVALID_VALUE, ref); +} + +/* + * Feature: KernalSystemAppManagerssssssssssssssss + * Function: OnAbilityRequestDone + * SubFunction: Processing preconditions + * FunctionPoints: KernalSystemAppManager OnAbilityRequestDone + * EnvConditions:Is Kernal System Ability + * CaseDescription: Notification status + */ +HWTEST_F(KernalSystemAppManagerTest, OnAbilityRequestDone_001, TestSize.Level1) +{ + EXPECT_TRUE(kernalSystemMgr_); + StartSystemUI(); + auto topAbilityRecord = kernalSystemMgr_->GetCurrentTopAbility(); + EXPECT_TRUE(topAbilityRecord); + kernalSystemMgr_->OnAbilityRequestDone(topAbilityRecord->GetToken(), -1); + EXPECT_NE(topAbilityRecord->GetAbilityState(), AbilityState::ACTIVATING); + + kernalSystemMgr_->OnAbilityRequestDone( + topAbilityRecord->GetToken(), static_cast(AppExecFwk::AbilityState::ABILITY_STATE_FOREGROUND)); + EXPECT_EQ(topAbilityRecord->GetAbilityState(), AbilityState::ACTIVATING); +} + +/* + * Feature: KernalSystemAppManager + * Function: OnAbilityRequestDone + * SubFunction: Processing preconditions + * FunctionPoints: KernalSystemAppManager OnAbilityRequestDone + * EnvConditions:Is Kernal System Ability + * CaseDescription: Notification status + */ +HWTEST_F(KernalSystemAppManagerTest, GetManagerUserId_001, TestSize.Level1) +{ + EXPECT_TRUE(kernalSystemMgr_); + StartSystemUI(); + int testUserID = kernalSystemMgr_->GetManagerUserId(); + EXPECT_EQ(10, testUserID); +} + +/* + * Feature: KernalSystemAppManager + * Function: DumpState + * SubFunction: Processing preconditions + * FunctionPoints: + * EnvConditions:Is Kernal System Ability + * CaseDescription: Notification status + */ +HWTEST_F(KernalSystemAppManagerTest, DumpState_001, TestSize.Level1) +{ + EXPECT_TRUE(kernalSystemMgr_); + StartSystemUI(); + std::vector info; + kernalSystemMgr_->DumpState(info); + + auto isFindAbilityInfo = [](std::string &abilityInfo) { + return std::string::npos != abilityInfo.find(AbilityConfig::SYSTEM_UI_BUNDLE_NAME); + }; + // find the SYSTEM_UI_BUNDLE_NAME + EXPECT_NE(info.end(), std::find_if(info.begin(), info.end(), isFindAbilityInfo)); +} + +/* + * Feature: KernalSystemAppManager + * Function: OnAbilityDied + * SubFunction: Processing preconditions + * FunctionPoints: + * EnvConditions:Is Kernal System Ability + * CaseDescription: Notification ability died + */ +HWTEST_F(KernalSystemAppManagerTest, OnAbilityDied_001, TestSize.Level1) +{ + EXPECT_TRUE(kernalSystemMgr_); + StartSystemUI(); + auto topAbilityRecord = kernalSystemMgr_->GetCurrentTopAbility(); + EXPECT_TRUE(topAbilityRecord); + kernalSystemMgr_->OnAbilityDied(topAbilityRecord); + EXPECT_EQ(topAbilityRecord->GetAbilityState(), AbilityState::INITIAL); +} + +/* + * Feature: KernalSystemAppManager + * Function: OnAbilityDied + * SubFunction: Processing preconditions + * FunctionPoints: + * EnvConditions:Is Kernal System Ability + * CaseDescription: Notification status + */ +HWTEST_F(KernalSystemAppManagerTest, OnAbilityDied_002, TestSize.Level1) +{ + EXPECT_TRUE(kernalSystemMgr_); + StartSystemUI(); + auto topAbilityRecord = kernalSystemMgr_->GetCurrentTopAbility(); + EXPECT_TRUE(topAbilityRecord); + kernalSystemMgr_->OnAbilityDied(topAbilityRecord); + EXPECT_EQ(topAbilityRecord->GetAbilityState(), AbilityState::INITIAL); +} + +/* + * Feature: KernalSystemAppManager + * Function: OnAbilityDied + * SubFunction: Processing preconditions + * FunctionPoints: + * EnvConditions:Is Kernal System Ability + * CaseDescription: Notification status + */ +HWTEST_F(KernalSystemAppManagerTest, OnTimeOut_001, TestSize.Level1) +{ + EXPECT_TRUE(kernalSystemMgr_); + StartSystemUI(); + auto topAbilityRecord = kernalSystemMgr_->GetCurrentTopAbility(); + EXPECT_TRUE(topAbilityRecord); + std::vector info; + kernalSystemMgr_->DumpState(info); + auto isFindAbilityInfo = [](std::string &abilityInfo) { + return std::string::npos != abilityInfo.find(AbilityConfig::SYSTEM_UI_BUNDLE_NAME); + }; + EXPECT_NE(info.end(), std::find_if(info.begin(), info.end(), isFindAbilityInfo)); + + // remove form vector + kernalSystemMgr_->OnTimeOut(AbilityManagerService::LOAD_TIMEOUT_MSG, topAbilityRecord->GetEventId()); + + info.clear(); + kernalSystemMgr_->DumpState(info); + // topAbilityRecord must be delete + EXPECT_EQ(info.end(), std::find_if(info.begin(), info.end(), isFindAbilityInfo)); +} +/* + * Feature: KernalSystemAppManager + * Function: DequeueWaittingAbility + * SubFunction: Processing preconditions + * FunctionPoints: + * EnvConditions:Is Kernal System Ability + * CaseDescription: Notification status + */ +HWTEST_F(KernalSystemAppManagerTest, DequeueWaittingAbility_001, TestSize.Level1) +{ + EXPECT_TRUE(kernalSystemMgr_); + StartSystemUI(); + auto topAbilityRecord = kernalSystemMgr_->GetCurrentTopAbility(); + EXPECT_TRUE(topAbilityRecord); + topAbilityRecord->SetAbilityState(AbilityState::ACTIVATING); + + Want want; + AbilityRequest request; + request.want = want; + request.requestCode = -1; + request.callerToken = nullptr; + request.abilityInfo.name = AbilityConfig::SYSTEM_UI_STATUS_BAR; + request.abilityInfo.bundleName = AbilityConfig::SYSTEM_UI_BUNDLE_NAME; + request.appInfo.isLauncherApp = true; + request.appInfo.name = "syetemUi"; + request.appInfo.bundleName = AbilityConfig::SYSTEM_UI_BUNDLE_NAME; + + // push in waiting queue + kernalSystemMgr_->StartAbility(request); + EXPECT_EQ(static_cast(kernalSystemMgr_->waittingAbilityQueue_.size()), 1); + + topAbilityRecord->SetAbilityState(AbilityState::ACTIVE); + kernalSystemMgr_->DequeueWaittingAbility(); + EXPECT_EQ(static_cast(kernalSystemMgr_->waittingAbilityQueue_.size()), 0); +} + +/* + * Feature: KernalSystemAppManager + * Function: DequeueWaittingAbility + * SubFunction: Processing preconditions + * FunctionPoints: + * EnvConditions:Is Kernal System Ability + * CaseDescription: Notification status + */ +HWTEST_F(KernalSystemAppManagerTest, GetOrCreateAbilityRecord_001, TestSize.Level1) +{ + EXPECT_TRUE(kernalSystemMgr_); + + Want want; + AbilityRequest request; + request.want = want; + request.requestCode = -1; + request.callerToken = nullptr; + request.abilityInfo.name = AbilityConfig::SYSTEM_UI_STATUS_BAR; + request.abilityInfo.bundleName = AbilityConfig::SYSTEM_UI_BUNDLE_NAME; + request.appInfo.isLauncherApp = true; + request.appInfo.name = "syetemUi"; + request.appInfo.bundleName = AbilityConfig::SYSTEM_UI_BUNDLE_NAME; + + std::shared_ptr targetAbility; + EXPECT_FALSE(targetAbility); + kernalSystemMgr_->GetOrCreateAbilityRecord(request, targetAbility); + + EXPECT_EQ(static_cast(kernalSystemMgr_->abilities_.size()), 1); + EXPECT_TRUE(targetAbility); + EXPECT_FALSE(targetAbility->IsNewWant()); + + // again + kernalSystemMgr_->GetOrCreateAbilityRecord(request, targetAbility); + EXPECT_TRUE(targetAbility->IsNewWant()); +} + +/* + * Feature: KernalSystemAppManager + * Function: DequeueWaittingAbility + * SubFunction: Processing preconditions + * FunctionPoints: + * EnvConditions:Is Kernal System Ability + * CaseDescription: Notification status + */ +HWTEST_F(KernalSystemAppManagerTest, GetOrCreateAbilityRecord_002, TestSize.Level1) +{ + EXPECT_TRUE(kernalSystemMgr_); + + Want want; + AbilityRequest request; + request.want = want; + request.requestCode = -1; + request.callerToken = nullptr; + request.abilityInfo.name = AbilityConfig::SYSTEM_UI_STATUS_BAR; + request.abilityInfo.bundleName = AbilityConfig::SYSTEM_UI_BUNDLE_NAME; + request.appInfo.isLauncherApp = true; + request.appInfo.name = "syetemUi"; + request.appInfo.bundleName = AbilityConfig::SYSTEM_UI_BUNDLE_NAME; + + std::shared_ptr targetAbility; + EXPECT_FALSE(targetAbility); + kernalSystemMgr_->GetOrCreateAbilityRecord(request, targetAbility); + + EXPECT_EQ(static_cast(kernalSystemMgr_->abilities_.size()), 1); + EXPECT_TRUE(targetAbility); + EXPECT_FALSE(targetAbility->IsNewWant()); + + // again + kernalSystemMgr_->GetOrCreateAbilityRecord(request, targetAbility); + EXPECT_TRUE(targetAbility->IsNewWant()); + EXPECT_EQ(static_cast(kernalSystemMgr_->abilities_.size()), 1); + + std::string abilityNameInfo = AbilityConfig::SYSTEM_UI_BUNDLE_NAME + ":" + AbilityConfig::SYSTEM_UI_STATUS_BAR; + auto abilityFlag = + kernalSystemMgr_->GetFlagOfAbility(AbilityConfig::SYSTEM_UI_BUNDLE_NAME, AbilityConfig::SYSTEM_UI_STATUS_BAR); + EXPECT_TRUE(abilityNameInfo == abilityFlag); +} + +/* + * Feature: KernalSystemAppManager + * Function: DequeueWaittingAbility + * SubFunction: Processing preconditions + * FunctionPoints: + * EnvConditions:Is Kernal System Ability + * CaseDescription: Notification status + */ +HWTEST_F(KernalSystemAppManagerTest, GetAbilityRecordByToken_001, TestSize.Level1) +{ + EXPECT_TRUE(kernalSystemMgr_); + + StartSystemUI(); + auto topAbilityRecord = kernalSystemMgr_->GetCurrentTopAbility(); + EXPECT_TRUE(topAbilityRecord); + auto testRecord = kernalSystemMgr_->GetAbilityRecordByToken(topAbilityRecord->GetToken()); + EXPECT_TRUE(testRecord == topAbilityRecord); + + sptr token; + auto testRecord1 = kernalSystemMgr_->GetAbilityRecordByToken(token); + EXPECT_TRUE(testRecord1 == nullptr); + + auto testRecord2 = kernalSystemMgr_->GetAbilityRecordByEventId(topAbilityRecord->GetEventId()); + EXPECT_TRUE(testRecord2 == topAbilityRecord); + + auto testRecord3 = kernalSystemMgr_->GetAbilityRecordByEventId(-1); + EXPECT_TRUE(testRecord3 == nullptr); +} + +/* + * Feature: KernalSystemAppManager + * Function: DispatchActive + * SubFunction: Processing preconditions + * FunctionPoints: + * EnvConditions:Is Kernal System Ability + * CaseDescription: Notification status + */ +HWTEST_F(KernalSystemAppManagerTest, DispatchActive_001, TestSize.Level1) +{ + EXPECT_TRUE(kernalSystemMgr_); + + StartSystemUI(); + auto topAbilityRecord = kernalSystemMgr_->GetCurrentTopAbility(); + EXPECT_TRUE(topAbilityRecord); + topAbilityRecord->SetAbilityState(AbilityState::ACTIVATING); + + Want want; + AbilityRequest request; + request.want = want; + request.requestCode = -1; + request.callerToken = nullptr; + request.abilityInfo.name = AbilityConfig::SYSTEM_UI_STATUS_BAR; + request.abilityInfo.bundleName = AbilityConfig::SYSTEM_UI_BUNDLE_NAME; + request.appInfo.isLauncherApp = true; + request.appInfo.name = "syetemUi"; + request.appInfo.bundleName = AbilityConfig::SYSTEM_UI_BUNDLE_NAME; + + kernalSystemMgr_->EnqueueWaittingAbility(request); + EXPECT_EQ(static_cast(kernalSystemMgr_->waittingAbilityQueue_.size()), 1); + + int ref = kernalSystemMgr_->DispatchActive(topAbilityRecord, AbilityState::ACTIVE); + WaitUntilTaskFinished(); + EXPECT_EQ(ERR_OK, ref); +} + +/* + * Feature: KernalSystemAppManager + * Function: RemoveAbilityRecord + * SubFunction: Processing preconditions + * FunctionPoints: + * EnvConditions:Is Kernal System Ability + * CaseDescription: Notification status + */ +HWTEST_F(KernalSystemAppManagerTest, DispatchActive_002, TestSize.Level1) +{ + EXPECT_TRUE(kernalSystemMgr_); + StartSystemUI(); + auto topAbilityRecord = kernalSystemMgr_->GetCurrentTopAbility(); + EXPECT_TRUE(topAbilityRecord); + + EXPECT_EQ(static_cast(kernalSystemMgr_->abilities_.size()), 1); + bool isRemove = kernalSystemMgr_->RemoveAbilityRecord(topAbilityRecord); + EXPECT_TRUE(isRemove); + + isRemove = kernalSystemMgr_->RemoveAbilityRecord(nullptr); + EXPECT_FALSE(isRemove); +} + +} // namespace AAFwk +} // namespace OHOS + +#endif diff --git a/services/abilitymgr/test/unittest/phone/lifecycle_deal_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/lifecycle_deal_test/BUILD.gn index 9b5bbe37abc..cfc5daf2eb8 100755 --- a/services/abilitymgr/test/unittest/phone/lifecycle_deal_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/lifecycle_deal_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -44,7 +44,6 @@ ohos_unittest("lifecycle_deal_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/lifecycle_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/lifecycle_test/BUILD.gn index 34037869d7e..f7d87c2c354 100755 --- a/services/abilitymgr/test/unittest/phone/lifecycle_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/lifecycle_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -44,7 +44,6 @@ ohos_unittest("lifecycle_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/lifecycle_test/lifecycle_test.cpp b/services/abilitymgr/test/unittest/phone/lifecycle_test/lifecycle_test.cpp index 6b5ae0920f0..caba94dd3fd 100644 --- a/services/abilitymgr/test/unittest/phone/lifecycle_test/lifecycle_test.cpp +++ b/services/abilitymgr/test/unittest/phone/lifecycle_test/lifecycle_test.cpp @@ -120,6 +120,8 @@ void LifecycleTest::OnStartabilityAms() abilityMs_->SetStackManager(userId, true); EXPECT_TRUE(abilityMs_->GetStackManager()); abilityMs_->stackManagers_.emplace(0, abilityMs_->GetStackManager()); + abilityMs_->systemAppManager_ = std::make_shared(userId); + EXPECT_TRUE(abilityMs_->systemAppManager_); abilityMs_->eventLoop_->Run(); return; } diff --git a/services/abilitymgr/test/unittest/phone/lock_screen_white_list_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/lock_screen_white_list_test/BUILD.gn index 41196f58b53..2b8b768ba88 100755 --- a/services/abilitymgr/test/unittest/phone/lock_screen_white_list_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/lock_screen_white_list_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -46,7 +46,6 @@ ohos_unittest("lock_screen_white_list_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", diff --git a/services/abilitymgr/test/unittest/phone/mission_list_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/mission_list_test/BUILD.gn index 501e6cb30c8..edcc5c6c6c0 100755 --- a/services/abilitymgr/test/unittest/phone/mission_list_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/mission_list_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -43,7 +43,6 @@ ohos_unittest("mission_list_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/mission_record_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/mission_record_test/BUILD.gn index 83bb54d7996..32fe28154ff 100755 --- a/services/abilitymgr/test/unittest/phone/mission_record_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/mission_record_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -43,7 +43,6 @@ ohos_unittest("mission_record_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/mission_stack_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/mission_stack_test/BUILD.gn index 8ed7ffa2963..e593f79c704 100755 --- a/services/abilitymgr/test/unittest/phone/mission_stack_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/mission_stack_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -43,7 +43,6 @@ ohos_unittest("mission_stack_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/mission_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/mission_test/BUILD.gn index b10cf3ff3fa..1016e3b220b 100755 --- a/services/abilitymgr/test/unittest/phone/mission_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/mission_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -43,7 +43,6 @@ ohos_unittest("mission_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/pending_want_key_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/pending_want_key_test/BUILD.gn index 57f608cbbba..3e0e13e260b 100755 --- a/services/abilitymgr/test/unittest/phone/pending_want_key_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/pending_want_key_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -37,7 +37,6 @@ ohos_unittest("pending_want_key_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/pending_want_manager_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/pending_want_manager_test/BUILD.gn index 553196a5e53..e721a1d5bce 100755 --- a/services/abilitymgr/test/unittest/phone/pending_want_manager_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/pending_want_manager_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -41,7 +41,6 @@ ohos_unittest("pending_want_manager_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/pending_want_record_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/pending_want_record_test/BUILD.gn index d8144184708..3923e207737 100755 --- a/services/abilitymgr/test/unittest/phone/pending_want_record_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/pending_want_record_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -41,7 +41,6 @@ ohos_unittest("pending_want_record_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/resume_mission_container_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/resume_mission_container_test/BUILD.gn index 2a67e2b4f72..c50b7e90963 100755 --- a/services/abilitymgr/test/unittest/phone/resume_mission_container_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/resume_mission_container_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -41,7 +41,6 @@ ohos_unittest("resume_mission_container_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/screenshot_handler_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/screenshot_handler_test/BUILD.gn index 8eb26542183..e0d5bbbf1f9 100755 --- a/services/abilitymgr/test/unittest/phone/screenshot_handler_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/screenshot_handler_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -46,7 +46,6 @@ ohos_unittest("ability_screenshot_handler_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", diff --git a/services/abilitymgr/test/unittest/phone/sender_info_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/sender_info_test/BUILD.gn index a32ff3cced1..e6fda6bebe4 100755 --- a/services/abilitymgr/test/unittest/phone/sender_info_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/sender_info_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -41,7 +41,6 @@ ohos_unittest("sender_info_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/terminate_ability_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/terminate_ability_test/BUILD.gn index 613e21d71d5..b96dcc15759 100755 --- a/services/abilitymgr/test/unittest/phone/terminate_ability_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/terminate_ability_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -46,7 +46,6 @@ ohos_unittest("terminate_ability_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/terminate_ability_test/terminate_ability_test.cpp b/services/abilitymgr/test/unittest/phone/terminate_ability_test/terminate_ability_test.cpp index cb23413e4c7..cbfeec4338f 100644 --- a/services/abilitymgr/test/unittest/phone/terminate_ability_test/terminate_ability_test.cpp +++ b/services/abilitymgr/test/unittest/phone/terminate_ability_test/terminate_ability_test.cpp @@ -160,6 +160,8 @@ void TerminateAbilityTest::OnStartAms() int userId = g_aams->GetUserId(); g_aams->SetStackManager(userId, true); + g_aams->systemAppManager_ = std::make_shared(userId); + EXPECT_TRUE(g_aams->systemAppManager_); g_aams->eventLoop_->Run(); diff --git a/services/abilitymgr/test/unittest/phone/want_receiver_proxy_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/want_receiver_proxy_test/BUILD.gn index 7f086e86c11..ef69a506a6c 100755 --- a/services/abilitymgr/test/unittest/phone/want_receiver_proxy_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/want_receiver_proxy_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -42,7 +42,6 @@ ohos_unittest("want_receiver_proxy_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/want_receiver_stub_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/want_receiver_stub_test/BUILD.gn index 36fbb48a4fb..5a2d38e81a6 100755 --- a/services/abilitymgr/test/unittest/phone/want_receiver_stub_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/want_receiver_stub_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -43,7 +43,6 @@ ohos_unittest("want_receiver_stub_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/want_sender_info_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/want_sender_info_test/BUILD.gn index bde67718101..e55ba85c80d 100755 --- a/services/abilitymgr/test/unittest/phone/want_sender_info_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/want_sender_info_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -41,7 +41,6 @@ ohos_unittest("want_sender_info_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/want_sender_proxy_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/want_sender_proxy_test/BUILD.gn index 2568f4a7e6b..3c9d898325b 100755 --- a/services/abilitymgr/test/unittest/phone/want_sender_proxy_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/want_sender_proxy_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -42,7 +42,6 @@ ohos_unittest("want_sender_proxy_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/want_sender_stub_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/want_sender_stub_test/BUILD.gn index ab2095d8d70..59a0a0489ac 100755 --- a/services/abilitymgr/test/unittest/phone/want_sender_stub_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/want_sender_stub_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -43,7 +43,6 @@ ohos_unittest("want_sender_stub_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/wants_info_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/wants_info_test/BUILD.gn index d69aeb94ad3..28e7e5b1894 100755 --- a/services/abilitymgr/test/unittest/phone/wants_info_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/wants_info_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -42,7 +42,6 @@ ohos_unittest("wants_info_test") { "${services_path}/abilitymgr/test/mock/libs/aakit:aakit_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/abilitymgr/test/unittest/phone/window_info_test/BUILD.gn b/services/abilitymgr/test/unittest/phone/window_info_test/BUILD.gn index f3a17d0b33d..75d7230e7d7 100755 --- a/services/abilitymgr/test/unittest/phone/window_info_test/BUILD.gn +++ b/services/abilitymgr/test/unittest/phone/window_info_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -37,7 +37,6 @@ ohos_unittest("window_info_test") { "${innerkits_path}/want:want", "${services_path}/abilitymgr/test:abilityms_test_source", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/services/abilitymgr:abilityms", diff --git a/services/appmgr/BUILD.gn b/services/appmgr/BUILD.gn index 0ef3e87b239..4647bde21cc 100644 --- a/services/appmgr/BUILD.gn +++ b/services/appmgr/BUILD.gn @@ -17,7 +17,6 @@ import("//foundation/aafwk/standard/aafwk.gni") config("appmgr_config") { include_dirs = [ "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", @@ -116,7 +115,6 @@ ohos_shared_library("libams") { "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core:appexecfwk_core", "${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", diff --git a/services/appmgr/include/ams_mgr_scheduler.h b/services/appmgr/include/ams_mgr_scheduler.h index 990f6c59776..a148acf9c8f 100644 --- a/services/appmgr/include/ams_mgr_scheduler.h +++ b/services/appmgr/include/ams_mgr_scheduler.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -88,6 +88,13 @@ public: */ virtual void RegisterAppStateCallback(const sptr &callback) override; + /** + * Reset,call Reset() through the proxy object, reset DFX of AppMgr. + * + * @return + */ + virtual void Reset() override; + /** * AbilityBehaviorAnalysis, ability behavior analysis assistant process optimization. * diff --git a/services/appmgr/include/app_death_recipient.h b/services/appmgr/include/app_death_recipient.h index 0bd39e48c3a..39179e0b3a0 100644 --- a/services/appmgr/include/app_death_recipient.h +++ b/services/appmgr/include/app_death_recipient.h @@ -42,10 +42,7 @@ public: */ void SetAppMgrServiceInner(const std::shared_ptr &serviceInner); - void SetIsRenderProcess(bool isRenderProcess); - private: - bool isRenderProcess_ = false; std::weak_ptr handler_; std::weak_ptr appMgrServiceInner_; }; diff --git a/services/appmgr/include/app_mgr_service.h b/services/appmgr/include/app_mgr_service.h index 47eaf0b1062..a623851bfad 100644 --- a/services/appmgr/include/app_mgr_service.h +++ b/services/appmgr/include/app_mgr_service.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -113,6 +113,15 @@ public: */ virtual int32_t ClearUpApplicationData(const std::string &bundleName) override; + /** + * IsBackgroundRunningRestricted, call IsBackgroundRunningRestricted() through proxy project, + * Checks whether the process of this application is forbidden to run in the background. + * + * @param bundleName, bundle name in Application record. + * @return ERR_OK, return back success, others fail. + */ + virtual int32_t IsBackgroundRunningRestricted(const std::string &bundleName) override; + /** * GetAllRunningProcesses, call GetAllRunningProcesses() through proxy project. * Obtains information about application processes that are running on the device. @@ -158,6 +167,24 @@ public: */ virtual sptr GetAmsMgr() override; + /** + * SetAppSuspendTimes, Setting the Freezing Time of APP Background. + * + * @param time, The timeout recorded when the application enters the background . + * + * @return Success or Failure . + */ + virtual void SetAppFreezingTime(int time) override; + + /** + * GetAppFreezingTime, Getting the Freezing Time of APP Background. + * + * @param time, The timeout recorded when the application enters the background . + * + * @return Success or Failure . + */ + virtual void GetAppFreezingTime(int &time) override; + /** * Get system memory information. * @param SystemMemoryAttr, memory information. @@ -197,11 +224,6 @@ public: */ int GetAbilityRecordsByProcessID(const int pid, std::vector> &tokens) override; - virtual int StartRenderProcess(const std::string &renderParam, int32_t ipcFd, - int32_t sharedFd, pid_t &renderPid) override; - - virtual void AttachRenderProcess(const sptr &shceduler) override; - private: /** * Init, Initialize application services. diff --git a/services/appmgr/include/app_mgr_service_inner.h b/services/appmgr/include/app_mgr_service_inner.h index d498c3b1a23..646b7562b71 100644 --- a/services/appmgr/include/app_mgr_service_inner.h +++ b/services/appmgr/include/app_mgr_service_inner.h @@ -121,6 +121,13 @@ public: */ virtual void RegisterAppStateCallback(const sptr &callback); + /** + * StopAllProcess, Terminate all processes. + * + * @return + */ + virtual void StopAllProcess(); + /** * AbilityBehaviorAnalysis, ability behavior analysis assistant process optimization. * @@ -235,6 +242,16 @@ public: */ virtual void ClearUpApplicationData(const std::string &bundleName, const int32_t callerUid, const pid_t callerPid); + /** + * IsBackgroundRunningRestricted, Checks whether the process of this application is forbidden + * to run in the background. + * + * @param bundleName, bundle name in Application record. + * + * @return ERR_OK, return back success, others fail. + */ + virtual int32_t IsBackgroundRunningRestricted(const std::string &bundleName); + /** * GetAllRunningProcesses, Obtains information about application processes that are running on the device. * @@ -391,10 +408,9 @@ public: * OnRemoteDied, Equipment death notification. * * @param remote, Death client. - * @param isRenderProcess is render process died. * @return */ - void OnRemoteDied(const wptr &remote, bool isRenderProcess = false); + void OnRemoteDied(const wptr &remote); /** * AddAppDeathRecipient, Add monitoring death application record. @@ -435,6 +451,23 @@ public: virtual void OptimizerAppStateChanged( const std::shared_ptr &appRecord, const ApplicationState state); + /** + * SetAppSuspendTimes, Setting the Freezing Time of APP Background. + * + * @param time, The timeout(second) recorded when the application enters the background . + * + * @return Success or Failure . + */ + void SetAppFreezingTime(int time); + + /** + * GetAppFreezingTime, Getting the Freezing Time of APP Background. + * + * @param time, The timeout(second) recorded when the application enters the background . + * + * @return Success or Failure . + */ + void GetAppFreezingTime(int &time); void HandleTimeOut(const InnerEvent::Pointer &event); void SetEventHandler(const std::shared_ptr &handler); @@ -528,11 +561,6 @@ public: */ int GetAbilityRecordsByProcessID(const int pid, std::vector> &tokens); - virtual int32_t StartRenderProcess(const pid_t hostPid, const std::string &renderParam, - int32_t ipcFd, int32_t sharedFd, pid_t &renderPid); - - virtual void AttachRenderProcess(const pid_t pid, const sptr &scheduler); - private: void StartEmptyResidentProcess(const BundleInfo &info, const std::string &processName, int restartCount); @@ -757,13 +785,6 @@ private: void GetGlobalConfiguration(); - void GetRunningProcesses(const std::shared_ptr &appRecord, std::vector &info); - - int StartRenderProcessImpl(const std::shared_ptr &renderRecord, - const std::shared_ptr appRecord, pid_t &renderPid); - - void OnRenderRemoteDied(const wptr &remote); - private: /** * ClearUpApplicationData, clear the application data. @@ -778,12 +799,6 @@ private: void ClearUpApplicationDataByUserId(const std::string &bundleName, int32_t callerUid, pid_t callerPid, const int userId); - int VerifyProcessPermission(); - - int VerifyAccountPermission(const std::string &permissionName, const int userId); - - int VerifyObserverPermission(); - private: /** * Notify application status. diff --git a/services/appmgr/include/app_running_manager.h b/services/appmgr/include/app_running_manager.h index 480fb095df4..8d38a1c0b23 100644 --- a/services/appmgr/include/app_running_manager.h +++ b/services/appmgr/include/app_running_manager.h @@ -148,8 +148,6 @@ public: void ClipStringContent(const std::regex &re, const std::string &sorce, std::string &afferCutStr); void HandleAddAbilityStageTimeOut(const int64_t eventId); void HandleStartSpecifiedAbilityTimeOut(const int64_t eventId); - std::shared_ptr GetAppRunningRecordByRenderPid(const pid_t pid); - void OnRemoteRenderDied(const wptr &remote); private: std::shared_ptr GetAbilityRunningRecord(const int64_t eventId); diff --git a/services/appmgr/include/app_running_record.h b/services/appmgr/include/app_running_record.h index 759010ff9bf..3eadad2e2da 100644 --- a/services/appmgr/include/app_running_record.h +++ b/services/appmgr/include/app_running_record.h @@ -21,7 +21,6 @@ #include #include #include "iremote_object.h" -#include "irender_scheduler.h" #include "ability_running_record.h" #include "ability_state_data.h" #include "application_info.h" @@ -34,7 +33,6 @@ #include "priority_object.h" #include "app_lifecycle_deal.h" #include "module_running_record.h" -#include "app_spawn_msg_wrapper.h" namespace OHOS { namespace AppExecFwk { @@ -43,45 +41,6 @@ const int RESTART_RESIDENT_PROCESS_MAX_TIMES = 15; } class AbilityRunningRecord; class AppMgrServiceInner; -class AppRunningRecord; - -/** - * @class RenderRecord - * Record webview render process info. - */ -class RenderRecord { -public: - RenderRecord(pid_t hostPid, const std::string& renderParam, - int32_t ipcFd, int32_t sharedFd, const std::shared_ptr &host); - - virtual ~RenderRecord(); - - static std::shared_ptr CreateRenderRecord(pid_t hostPid, const std::string& renderParam, - int32_t ipcFd, int32_t sharedFd, const std::shared_ptr &host); - - void SetPid(pid_t pid); - pid_t GetPid(); - pid_t GetHostPid(); - std::string GetRenderParam(); - int32_t GetIpcFd(); - int32_t GetSharedFd(); - std::shared_ptr GetHostRecord(); - sptr GetScheduler(); - void SetScheduler(const sptr &scheduler); - void SetDeathRecipient(const sptr recipient); - void RegisterDeathRecipient(); - -private: - pid_t pid_ = 0; - pid_t hostPid_ = 0; - std::string renderParam_; - int32_t ipcFd_ = 0; - int32_t sharedFd_ = 0; - std::weak_ptr host_; // webview host - sptr renderScheduler_; - sptr deathRecipient_ = nullptr; -}; - class AppRunningRecord : public std::enable_shared_from_this { public: static int64_t appEventId_; @@ -486,11 +445,6 @@ public: void ScheduleAcceptWantDone(); const AAFwk::Want &GetSpecifiedWant() const; - void SetRenderRecord(const std::shared_ptr &record); - std::shared_ptr GetRenderRecord(); - void SetStartMsg(const AppSpawnStartMsg &msg); - AppSpawnStartMsg GetStartMsg(); - private: /** * SearchTheModuleInfoNeedToUpdated, Get an uninitialized abilitystage data. @@ -569,10 +523,6 @@ private: std::string moduleName_; UserTestRecord userTestRecord_; - - // render record - std::shared_ptr renderRecord_ = nullptr; - AppSpawnStartMsg startMsg_; }; } // namespace AppExecFwk } // namespace OHOS diff --git a/services/appmgr/include/app_spawn_client.h b/services/appmgr/include/app_spawn_client.h index 96c6cbdba27..862e8034557 100644 --- a/services/appmgr/include/app_spawn_client.h +++ b/services/appmgr/include/app_spawn_client.h @@ -29,7 +29,7 @@ public: /** * Constructor. */ - explicit AppSpawnClient(bool isWebViewSpawn = false); + AppSpawnClient(); /** * Destructor diff --git a/services/appmgr/include/app_spawn_msg_wrapper.h b/services/appmgr/include/app_spawn_msg_wrapper.h index acbaeef24d9..5415b6385be 100644 --- a/services/appmgr/include/app_spawn_msg_wrapper.h +++ b/services/appmgr/include/app_spawn_msg_wrapper.h @@ -34,7 +34,6 @@ struct AppSpawnStartMsg { uint32_t accessTokenId; std::string apl; std::string bundleName; - std::string renderParam; // only webview spawn need this param. }; using AppSpawnMsg = AppSpawn::ClientSocket::AppProperty; diff --git a/services/appmgr/include/app_spawn_socket.h b/services/appmgr/include/app_spawn_socket.h index a4c60afa08f..ef133c455ab 100644 --- a/services/appmgr/include/app_spawn_socket.h +++ b/services/appmgr/include/app_spawn_socket.h @@ -29,7 +29,7 @@ public: /** * Constructor. */ - explicit AppSpawnSocket(bool isWebViewSpawn = false); + AppSpawnSocket(); /** * Destructor diff --git a/services/appmgr/include/process_optimizer.h b/services/appmgr/include/process_optimizer.h index 6e336b5b17a..10b4028bcff 100644 --- a/services/appmgr/include/process_optimizer.h +++ b/services/appmgr/include/process_optimizer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -66,6 +66,8 @@ public: virtual void OnAbilityVisibleChanged(const AbilityPtr &ability); virtual void OnAbilityPerceptibleChanged(const AbilityPtr &ability); virtual void OnAbilityRemoved(const AbilityPtr &ability); + virtual void SetAppFreezingTime(int time); + virtual void GetAppFreezingTime(int &time); protected: bool SetAppOomAdj(const AppPtr &app, int oomAdj); diff --git a/services/appmgr/include/process_optimizer_uba.h b/services/appmgr/include/process_optimizer_uba.h index 6d34c93c99f..89c0440afd1 100644 --- a/services/appmgr/include/process_optimizer_uba.h +++ b/services/appmgr/include/process_optimizer_uba.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -55,6 +55,8 @@ public: void OnAbilityVisibleChanged(const AbilityPtr &ability) override; void OnAbilityPerceptibleChanged(const AbilityPtr &ability) override; void OnAbilityRemoved(const AbilityPtr &ability) override; + void SetAppFreezingTime(int time) override; + void GetAppFreezingTime(int &time) override; protected: void OnLowMemoryAlert(const CgroupManager::LowMemoryLevel level) override; diff --git a/services/appmgr/include/remote_client_manager.h b/services/appmgr/include/remote_client_manager.h index 1ab9ff83445..35656ea5563 100644 --- a/services/appmgr/include/remote_client_manager.h +++ b/services/appmgr/include/remote_client_manager.h @@ -57,12 +57,9 @@ public: */ void SetBundleManager(sptr bundleManager); - std::shared_ptr GetWebviewSpawnClient(); - private: std::shared_ptr appSpawnClient_; sptr bundleManager_; - std::shared_ptr webviewSpawnClient_; }; } // namespace AppExecFwk } // namespace OHOS diff --git a/services/appmgr/src/ams_mgr_scheduler.cpp b/services/appmgr/src/ams_mgr_scheduler.cpp index 44a9928623f..5a91e41d370 100644 --- a/services/appmgr/src/ams_mgr_scheduler.cpp +++ b/services/appmgr/src/ams_mgr_scheduler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -110,6 +110,15 @@ void AmsMgrScheduler::RegisterAppStateCallback(const sptr &ca amsHandler_->PostTask(registerAppStateCallbackFunc, TASK_REGISTER_APP_STATE_CALLBACK); } +void AmsMgrScheduler::Reset() +{ + if (!IsReady()) { + return; + } + std::function resetFunc = std::bind(&AppMgrServiceInner::StopAllProcess, amsMgrServiceInner_); + amsHandler_->PostTask(resetFunc, TASK_STOP_ALL_PROCESS); +} + void AmsMgrScheduler::AbilityBehaviorAnalysis(const sptr &token, const sptr &preToken, const int32_t visibility, const int32_t perceptibility, const int32_t connectionState) { diff --git a/services/appmgr/src/app_death_recipient.cpp b/services/appmgr/src/app_death_recipient.cpp index 6ccba58de7f..9c841c0310a 100644 --- a/services/appmgr/src/app_death_recipient.cpp +++ b/services/appmgr/src/app_death_recipient.cpp @@ -42,7 +42,7 @@ void AppDeathRecipient::OnRemoteDied(const wptr &remote) return; } - auto onRemoteDiedFunc = std::bind(&AppMgrServiceInner::OnRemoteDied, serviceInner, remote, isRenderProcess_); + std::function onRemoteDiedFunc = std::bind(&AppMgrServiceInner::OnRemoteDied, serviceInner, remote); handler->PostTask(onRemoteDiedFunc, TASK_ON_REMOTE_DIED); } @@ -55,10 +55,5 @@ void AppDeathRecipient::SetAppMgrServiceInner(const std::shared_ptrIsBackgroundRunningRestricted(bundleName); +} + int32_t AppMgrService::GetAllRunningProcesses(std::vector &info) { if (!IsReady()) { @@ -285,6 +292,24 @@ int32_t AppMgrService::GetProcessRunningInfosByUserId(std::vectorGetProcessRunningInfosByUserId(info, userId); } +void AppMgrService::SetAppFreezingTime(int time) +{ + APP_LOGI("set app freeze time %{public}d", time); + if (!IsReady()) { + return; + } + appMgrServiceInner_->SetAppFreezingTime(time); +} + +void AppMgrService::GetAppFreezingTime(int &time) +{ + if (!IsReady()) { + return; + } + appMgrServiceInner_->GetAppFreezingTime(time); + APP_LOGE("get app freeze time %{public}d ", time); +} + /** * Get system memory information. * @param SystemMemoryAttr, memory information. @@ -382,31 +407,5 @@ int AppMgrService::GetAbilityRecordsByProcessID(const int pid, std::vectorGetAbilityRecordsByProcessID(pid, tokens); } - -int32_t AppMgrService::StartRenderProcess(const std::string &renderParam, int32_t ipcFd, - int32_t sharedFd, pid_t &renderPid) -{ - if (!IsReady()) { - APP_LOGE("StartRenderProcess failed, AppMgrService not ready."); - return ERR_INVALID_OPERATION; - } - - return appMgrServiceInner_->StartRenderProcess(IPCSkeleton::GetCallingPid(), - renderParam, ipcFd, sharedFd, renderPid); -} - -void AppMgrService::AttachRenderProcess(const sptr &scheduler) -{ - APP_LOGD("AttachRenderProcess called."); - if (!IsReady()) { - APP_LOGE("AttachRenderProcess failed, not ready."); - return; - } - - auto pid = IPCSkeleton::GetCallingPid(); - auto fun = std::bind(&AppMgrServiceInner::AttachRenderProcess, - appMgrServiceInner_, pid, iface_cast(scheduler)); - handler_->PostTask(fun, TASK_ATTACH_RENDER_PROCESS); -} } // namespace AppExecFwk } // namespace OHOS diff --git a/services/appmgr/src/app_mgr_service_inner.cpp b/services/appmgr/src/app_mgr_service_inner.cpp index 61b4b47c902..00efa107c10 100644 --- a/services/appmgr/src/app_mgr_service_inner.cpp +++ b/services/appmgr/src/app_mgr_service_inner.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include "app_log_wrapper.h" #include "application_state_observer_stub.h" @@ -36,8 +35,6 @@ #include "ipc_skeleton.h" #include "os_account_manager.h" #include "permission/permission_kit.h" -#include "permission_constants.h" -#include "permission_verification.h" #include "system_ability_definition.h" #include "locale_config.h" #include "uri_permission_manager_client.h" @@ -58,7 +55,6 @@ constexpr int KILL_PROCESS_DELAYTIME_MICRO_SECONDS = 200; const std::string CLASS_NAME = "ohos.app.MainThread"; const std::string FUNC_NAME = "main"; const std::string SO_PATH = "system/lib64/libmapleappkit.z.so"; -const std::string RENDER_PARAM = "invalidparam"; const int32_t SIGNAL_KILL = 9; const std::string REQ_PERMISSION = "ohos.permission.LOCATION_IN_BACKGROUND"; constexpr int32_t SYSTEM_UID = 1000; @@ -67,9 +63,6 @@ constexpr int32_t USER_SCALE = 200000; constexpr int32_t BASE_USER_RANGE = 200000; -constexpr ErrCode APPMGR_ERR_OFFSET = ErrCodeOffset(SUBSYS_APPEXECFWK, 0x01); -constexpr ErrCode ERR_ALREADY_EXIST_RENDER = APPMGR_ERR_OFFSET + 100; // error code for already exist render. - int32_t GetUserIdByUid(int32_t uid) { return uid / BASE_USER_RANGE; @@ -365,11 +358,6 @@ int32_t AppMgrServiceInner::KillApplication(const std::string &bundleName) return ERR_NO_INIT; } - if (VerifyProcessPermission() == ERR_PERMISSION_DENIED) { - APP_LOGE("%{public}s: Permission verification failed", __func__); - return ERR_PERMISSION_DENIED; - } - int result = ERR_OK; int64_t startTime = SystemTimeMillis(); std::list pids; @@ -400,12 +388,6 @@ int32_t AppMgrServiceInner::KillApplicationByUid(const std::string &bundleName, APP_LOGE("appRunningManager_ is nullptr"); return ERR_NO_INIT; } - - if (VerifyProcessPermission() == ERR_PERMISSION_DENIED) { - APP_LOGE("%{public}s: Permission verification failed", __func__); - return ERR_PERMISSION_DENIED; - } - int result = ERR_OK; int64_t startTime = SystemTimeMillis(); std::list pids; @@ -443,13 +425,6 @@ int32_t AppMgrServiceInner::KillApplicationByUserId(const std::string &bundleNam APP_LOGE("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__); - return ERR_PERMISSION_DENIED; - } - int result = ERR_OK; int64_t startTime = SystemTimeMillis(); std::list pids; @@ -493,16 +468,6 @@ int32_t AppMgrServiceInner::KillApplicationByUserId(const std::string &bundleNam void AppMgrServiceInner::ClearUpApplicationData(const std::string &bundleName, int32_t callerUid, pid_t callerPid) { BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); - auto isSaCall = AAFwk::PermissionVerification::GetInstance()->IsSACall(); - if (!isSaCall) { - auto isCallingPerm = AAFwk::PermissionVerification::GetInstance()->VerifyCallingPermission( - AAFwk::PermissionConstants::PERMISSION_CLEAN_APPLICATION_DATA); - if (!isCallingPerm) { - APP_LOGE("%{public}s: Permission verification failed", __func__); - return; - } - } - auto userId = GetUserIdByUid(callerUid); APP_LOGI("userId:%{public}d", userId); ClearUpApplicationDataByUserId(bundleName, callerUid, callerPid, userId); @@ -547,30 +512,41 @@ void AppMgrServiceInner::ClearUpApplicationDataByUserId( NotifyAppStatus(bundleName, EventFwk::CommonEventSupport::COMMON_EVENT_PACKAGE_DATA_CLEARED); } -int32_t AppMgrServiceInner::GetAllRunningProcesses(std::vector &info) +int32_t AppMgrServiceInner::IsBackgroundRunningRestricted(const std::string &bundleName) { - auto isPerm = AAFwk::PermissionVerification::GetInstance()->VerifyRunningInfoPerm(); + auto bundleMgr_ = remoteClientManager_->GetBundleManager(); + if (bundleMgr_ == nullptr) { + APP_LOGE("GetBundleManager fail"); + return ERR_DEAD_OBJECT; + } + return bundleMgr_->CheckPermission(bundleName, REQ_PERMISSION); +} +int32_t AppMgrServiceInner::GetAllRunningProcesses(std::vector &info) +{ + auto bundleMgr_ = remoteClientManager_->GetBundleManager(); + if (bundleMgr_ == nullptr) { + APP_LOGE("GetBundleManager fail"); + return ERR_DEAD_OBJECT; + } // check permission for (const auto &item : appRunningManager_->GetAppRunningRecordMap()) { const auto &appRecord = item.second; + if (USER_SCALE == 0) { + APP_LOGE("USER_SCALE is not zero"); + return ERR_WOULD_BLOCK; + } int32_t userId = static_cast(appRecord->GetUid() / USER_SCALE); bool isExist = false; auto errCode = AccountSA::OsAccountManager::IsOsAccountActived(userId, isExist); if ((errCode == ERR_OK) && isExist) { - if (isPerm) { - GetRunningProcesses(appRecord, info); - } else { - auto applicationInfo = appRecord->GetApplicationInfo(); - if (!applicationInfo) { - continue; - } - auto callingTokenId = IPCSkeleton::GetCallingTokenID(); - auto tokenId = applicationInfo->accessTokenId; - if (callingTokenId == tokenId) { - GetRunningProcesses(appRecord, info); - } - } + RunningProcessInfo runningProcessInfo; + runningProcessInfo.processName_ = appRecord->GetProcessName(); + runningProcessInfo.pid_ = appRecord->GetPriorityObject()->GetPid(); + runningProcessInfo.uid_ = appRecord->GetUid(); + runningProcessInfo.state_ = static_cast(appRecord->GetState()); + appRecord->GetBundleNames(runningProcessInfo.bundleNames); + info.emplace_back(runningProcessInfo); } } return ERR_OK; @@ -578,34 +554,32 @@ int32_t AppMgrServiceInner::GetAllRunningProcesses(std::vector &info, int32_t userId) { - if (VerifyAccountPermission(AAFwk::PermissionConstants::PERMISSION_GET_RUNNING_INFO, userId) == - ERR_PERMISSION_DENIED) { - APP_LOGE("%{public}s: Permission verification failed", __func__); - return ERR_PERMISSION_DENIED; + auto bundleMgr_ = remoteClientManager_->GetBundleManager(); + if (bundleMgr_ == nullptr) { + APP_LOGE("GetBundleManager fail"); + return ERR_DEAD_OBJECT; } for (const auto &item : appRunningManager_->GetAppRunningRecordMap()) { const auto &appRecord = item.second; + if (USER_SCALE == 0) { + APP_LOGE("USER_SCALE is not zero"); + return ERR_WOULD_BLOCK; + } int32_t userIdTemp = static_cast(appRecord->GetUid() / USER_SCALE); if (userIdTemp == userId) { - GetRunningProcesses(appRecord, info); + RunningProcessInfo runningProcessInfo; + runningProcessInfo.processName_ = appRecord->GetProcessName(); + runningProcessInfo.pid_ = appRecord->GetPriorityObject()->GetPid(); + runningProcessInfo.uid_ = appRecord->GetUid(); + runningProcessInfo.state_ = static_cast(appRecord->GetState()); + appRecord->GetBundleNames(runningProcessInfo.bundleNames); + info.emplace_back(runningProcessInfo); } } return ERR_OK; } -void AppMgrServiceInner::GetRunningProcesses(const std::shared_ptr &appRecord, - std::vector &info) -{ - RunningProcessInfo runningProcessInfo; - runningProcessInfo.processName_ = appRecord->GetProcessName(); - runningProcessInfo.pid_ = appRecord->GetPriorityObject()->GetPid(); - runningProcessInfo.uid_ = appRecord->GetUid(); - runningProcessInfo.state_ = static_cast(appRecord->GetState()); - appRecord->GetBundleNames(runningProcessInfo.bundleNames); - info.emplace_back(runningProcessInfo); -} - int32_t AppMgrServiceInner::KillProcessByPid(const pid_t pid) const { int32_t ret = -1; @@ -847,18 +821,19 @@ void AppMgrServiceInner::SetBundleManager(sptr bundleManager) void AppMgrServiceInner::RegisterAppStateCallback(const sptr &callback) { - pid_t callingPid = IPCSkeleton::GetCallingPid(); - pid_t pid = getpid(); - if (callingPid != pid) { - APP_LOGE("%{public}s: Not abilityMgr call.", __func__); - return; - } BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); if (callback != nullptr) { appStateCallbacks_.push_back(callback); } } +void AppMgrServiceInner::StopAllProcess() +{ + BYTRACE_NAME(BYTRACE_TAG_APP, __PRETTY_FUNCTION__); + ClearRecentAppList(); + appRunningManager_->ClearAppRunningRecordMap(); +} + void AppMgrServiceInner::AbilityBehaviorAnalysis(const sptr &token, const sptr &preToken, const int32_t visibility, // 0:false,1:true const int32_t perceptibility, // 0:false,1:true @@ -911,11 +886,6 @@ void AppMgrServiceInner::KillProcessByAbilityToken(const sptr &to return; } - if (VerifyProcessPermission() == ERR_PERMISSION_DENIED) { - APP_LOGE("%{public}s: Permission verification failed", __func__); - return; - } - // befor exec ScheduleProcessSecurityExit return // The resident process won't let him die if (appRecord->IsKeepAliveApp()) { @@ -944,12 +914,6 @@ void AppMgrServiceInner::KillProcessesByUserId(int32_t userId) return; } - if (VerifyAccountPermission(AAFwk::PermissionConstants::PERMISSION_CLEAN_BACKGROUND_PROCESSES, userId) == - ERR_PERMISSION_DENIED) { - APP_LOGE("%{public}s: Permission verification failed", __func__); - return; - } - int64_t startTime = SystemTimeMillis(); std::list pids; if (!appRunningManager_->GetPidsByUserId(userId, pids)) { @@ -1319,7 +1283,6 @@ void AppMgrServiceInner::StartProcess(const std::string &appName, const std::str startMsg.accessTokenId = (*bundleInfoIter).applicationInfo.accessTokenId; startMsg.apl = (*bundleInfoIter).applicationInfo.appPrivilegeLevel; startMsg.bundleName = bundleName; - startMsg.renderParam = RENDER_PARAM; APP_LOGD("StartProcess come, accessTokenId: %{public}d, apl: %{public}s, bundleName: %{public}s", startMsg.accessTokenId, startMsg.apl.c_str(), bundleName.c_str()); @@ -1342,7 +1305,6 @@ void AppMgrServiceInner::StartProcess(const std::string &appName, const std::str APP_LOGI("newPid:%{public}d uid:%{public}d", pid, startMsg.uid); appRecord->GetPriorityObject()->SetPid(pid); appRecord->SetUid(startMsg.uid); - appRecord->SetStartMsg(startMsg); OptimizerAppStateChanged(appRecord, ApplicationState::APP_STATE_CREATE); appRecord->SetAppMgrServiceInner(weak_from_this()); OnAppStateChanged(appRecord, ApplicationState::APP_STATE_CREATE); @@ -1411,14 +1373,9 @@ void AppMgrServiceInner::ClearRecentAppList() appProcessManager_->ClearRecentAppList(); } -void AppMgrServiceInner::OnRemoteDied(const wptr &remote, bool isRenderProcess) +void AppMgrServiceInner::OnRemoteDied(const wptr &remote) { APP_LOGE("On remote died."); - if (isRenderProcess) { - OnRenderRemoteDied(remote); - return; - } - auto appRecord = appRunningManager_->OnRemoteDied(remote); if (appRecord) { // clear uri permission @@ -1437,13 +1394,6 @@ void AppMgrServiceInner::OnRemoteDied(const wptr &remote, bool is OptimizerAppStateChanged(appRecord, ApplicationState::APP_STATE_TERMINATED); RemoveAppFromRecentListById(appRecord->GetRecordId()); OnProcessDied(appRecord); - - // kill render if exist. - auto renderRecord = appRecord->GetRenderRecord(); - if (renderRecord && renderRecord->GetPid() > 0) { - APP_LOGD("Kill render process when webviehost died."); - KillProcessByPid(renderRecord->GetPid()); - } } if (appRecord && appRecord->IsKeepAliveApp()) { @@ -1590,6 +1540,27 @@ void AppMgrServiceInner::OptimizerAppStateChanged( } } +void AppMgrServiceInner::SetAppFreezingTime(int time) +{ + if (!processOptimizerUBA_) { + APP_LOGE("process optimizer is not init"); + return; + } + + std::lock_guard setFreezeTimeLock(serviceLock_); + processOptimizerUBA_->SetAppFreezingTime(time); +} + +void AppMgrServiceInner::GetAppFreezingTime(int &time) +{ + if (!processOptimizerUBA_) { + APP_LOGE("process optimizer is not init"); + return; + } + std::lock_guard getFreezeTimeLock(serviceLock_); + processOptimizerUBA_->GetAppFreezingTime(time); +} + void AppMgrServiceInner::HandleTimeOut(const InnerEvent::Pointer &event) { APP_LOGI("handle time out"); @@ -1753,26 +1724,12 @@ void AppMgrServiceInner::GetRunningProcessInfoByToken( APP_LOGE("appRunningManager_ is nullptr"); return; } - - auto isPerm = AAFwk::PermissionVerification::GetInstance()->VerifyRunningInfoPerm(); - if (!isPerm) { - APP_LOGE("%{public}s: Permission verification failed", __func__); - return; - } - appRunningManager_->GetRunningProcessInfoByToken(token, info); } void AppMgrServiceInner::LoadResidentProcess() { APP_LOGI("%{public}s called", __func__); - pid_t callingPid = IPCSkeleton::GetCallingPid(); - pid_t pid = getpid(); - if (callingPid != pid) { - APP_LOGE("%{public}s: Not SA call.", __func__); - return; - } - if (!CheckRemoteClient()) { APP_LOGE("GetBundleManager fail"); return; @@ -1929,10 +1886,6 @@ void AppMgrServiceInner::NotifyAppStatus(const std::string &bundleName, const st int32_t AppMgrServiceInner::RegisterApplicationStateObserver(const sptr &observer) { APP_LOGI("%{public}s begin", __func__); - if (VerifyObserverPermission() == ERR_PERMISSION_DENIED) { - APP_LOGE("%{public}s: Permission verification failed", __func__); - return ERR_PERMISSION_DENIED; - } std::lock_guard lockRegister(observerLock_); if (observer == nullptr) { APP_LOGE("Observer nullptr"); @@ -1951,10 +1904,6 @@ int32_t AppMgrServiceInner::RegisterApplicationStateObserver(const sptr &observer) { APP_LOGI("%{public}s begin", __func__); - if (VerifyObserverPermission() == ERR_PERMISSION_DENIED) { - APP_LOGE("%{public}s: Permission verification failed", __func__); - return ERR_PERMISSION_DENIED; - } std::lock_guard lockUnregister(observerLock_); if (observer == nullptr) { APP_LOGE("Observer nullptr"); @@ -2049,12 +1998,6 @@ void AppMgrServiceInner::HandleObserverDiedTask(const sptr &obser int32_t AppMgrServiceInner::GetForegroundApplications(std::vector &list) { APP_LOGI("%{public}s, begin.", __func__); - auto isPerm = AAFwk::PermissionVerification::GetInstance()->VerifyRunningInfoPerm(); - if (!isPerm) { - APP_LOGE("%{public}s: Permission verification failed", __func__); - return ERR_PERMISSION_DENIED; - } - appRunningManager_->GetForegroundApplications(list); return ERR_OK; } @@ -2185,13 +2128,6 @@ void AppMgrServiceInner::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__); - return; - } - } - if (!appRunningManager_) { APP_LOGE("appRunningManager_ is null"); return; @@ -2274,181 +2200,8 @@ int AppMgrServiceInner::GetAbilityRecordsByProcessID(const int pid, std::vector< for (auto &item : appRecord->GetAbilities()) { tokens.emplace_back(item.first); } - return ERR_OK; -} - -int AppMgrServiceInner::VerifyProcessPermission() -{ - auto isSaCall = AAFwk::PermissionVerification::GetInstance()->IsSACall(); - if (isSaCall) { - return ERR_OK; - } - auto isCallingPerm = AAFwk::PermissionVerification::GetInstance()->VerifyCallingPermission( - AAFwk::PermissionConstants::PERMISSION_CLEAN_BACKGROUND_PROCESSES); - if (isCallingPerm) { - APP_LOGE("%{public}s: Permission verification succeeded", __func__); - return ERR_OK; - } - APP_LOGE("%{public}s: Permission verification failed", __func__); - return ERR_PERMISSION_DENIED; -} - -int AppMgrServiceInner::VerifyAccountPermission(const std::string &permissionName, const int userId) -{ - auto isSaCall = AAFwk::PermissionVerification::GetInstance()->IsSACall(); - if (isSaCall) { - return ERR_OK; - } - const int currentUserId = getuid() / Constants::BASE_USER_RANGE; - if (userId != currentUserId) { - auto isCallingPermAccount = AAFwk::PermissionVerification::GetInstance()->VerifyCallingPermission( - AAFwk::PermissionConstants::PERMISSION_INTERACT_ACROSS_LOCAL_ACCOUNTS); - if (!isCallingPermAccount) { - APP_LOGE("%{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__); - return ERR_OK; - } - APP_LOGE("%{public}s: Permission verification failed", __func__); - return ERR_PERMISSION_DENIED; -} - -int AppMgrServiceInner::VerifyObserverPermission() -{ - auto isSaCall = AAFwk::PermissionVerification::GetInstance()->IsSACall(); - if (isSaCall) { - return ERR_OK; - } - auto isCallingPerm = AAFwk::PermissionVerification::GetInstance()->VerifyCallingPermission( - AAFwk::PermissionConstants::PERMISSION_RUNNING_STATE_OBSERVER); - if (isCallingPerm) { - APP_LOGE("%{public}s: Permission verification succeeded", __func__); - return ERR_OK; - } - APP_LOGE("%{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, webview 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", - hostPid, renderParam.c_str(), ipcFd, sharedFd); - return ERR_INVALID_VALUE; - } - - if (!appRunningManager_) { - APP_LOGE("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); - 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()); - 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); - return ERR_INVALID_VALUE; - } - - return StartRenderProcessImpl(renderRecord, appRecord, renderPid); -} - -void AppMgrServiceInner::AttachRenderProcess(const pid_t pid, const sptr &scheduler) -{ - APP_LOGD("attach render process start"); - if (pid <= 0) { - APP_LOGE("invalid render process pid:%{public}d", pid); - return; - } - if (!scheduler) { - APP_LOGE("render scheduler is null"); - return; - } - - if (!appRunningManager_) { - APP_LOGE("appRunningManager_ is null"); - return; - } - - APP_LOGI("attach render process pid:%{public}d", pid); - auto appRecord = appRunningManager_->GetAppRunningRecordByRenderPid(pid); - if (!appRecord) { - APP_LOGE("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); - return; - } - - sptr appDeathRecipient = new AppDeathRecipient(); - appDeathRecipient->SetEventHandler(eventHandler_); - appDeathRecipient->SetAppMgrServiceInner(shared_from_this()); - appDeathRecipient->SetIsRenderProcess(true); - renderRecord->SetScheduler(scheduler); - renderRecord->SetDeathRecipient(appDeathRecipient); - renderRecord->RegisterDeathRecipient(); - - // notify fd to render process - scheduler->NotifyBrowserFd(renderRecord->GetIpcFd(), renderRecord->GetSharedFd()); -} - -int AppMgrServiceInner::StartRenderProcessImpl(const std::shared_ptr &renderRecord, - const std::shared_ptr appRecord, pid_t &renderPid) -{ - if (!renderRecord || !appRecord) { - APP_LOGE("renderRecord or appRecord is nullptr."); - return ERR_INVALID_VALUE; - } - - auto webviewSpawnClient = remoteClientManager_->GetWebviewSpawnClient(); - if (!webviewSpawnClient) { - APP_LOGE("webviewSpawnClient is null"); - return ERR_INVALID_VALUE; - } - - AppSpawnStartMsg startMsg = appRecord->GetStartMsg(); - startMsg.renderParam = renderRecord->GetRenderParam(); - pid_t pid = 0; - ErrCode errCode = webviewSpawnClient->StartProcess(startMsg, pid); - if (FAILED(errCode)) { - APP_LOGE("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", - renderRecord->GetHostPid(), pid, startMsg.uid); - return 0; -} - -void AppMgrServiceInner::OnRenderRemoteDied(const wptr &remote) -{ - APP_LOGE("On render remote died."); - if (appRunningManager_) { - appRunningManager_->OnRemoteRenderDied(remote); - } + return ERR_OK; } } // namespace AppExecFwk } // namespace OHOS diff --git a/services/appmgr/src/app_running_manager.cpp b/services/appmgr/src/app_running_manager.cpp index 3b0bc1dd4cc..3b3c210475a 100644 --- a/services/appmgr/src/app_running_manager.cpp +++ b/services/appmgr/src/app_running_manager.cpp @@ -462,48 +462,5 @@ void AppRunningManager::UpdateConfiguration(const Configuration &config) } } } - -std::shared_ptr AppRunningManager::GetAppRunningRecordByRenderPid(const pid_t pid) -{ - std::lock_guard guard(lock_); - auto iter = std::find_if(appRunningRecordMap_.begin(), appRunningRecordMap_.end(), [&pid](const auto &pair) { - auto renderRecord = pair.second->GetRenderRecord(); - return renderRecord && renderRecord->GetPid() == pid; - }); - return ((iter == appRunningRecordMap_.end()) ? nullptr : iter->second); -} - -void AppRunningManager::OnRemoteRenderDied(const wptr &remote) -{ - std::lock_guard guard(lock_); - if (remote == nullptr) { - APP_LOGE("remote is null"); - return; - } - sptr object = remote.promote(); - if (!object) { - APP_LOGE("promote failed."); - return; - } - - const auto &it = - std::find_if(appRunningRecordMap_.begin(), appRunningRecordMap_.end(), [&object](const auto &pair) { - if (!pair.second) { - return false; - } - - auto renderRecord = pair.second->GetRenderRecord(); - if (!renderRecord) { - return false; - } - - auto scheduler = renderRecord->GetScheduler(); - return scheduler && scheduler->AsObject() == object; - }); - if (it != appRunningRecordMap_.end()) { - auto appRecord = it->second; - appRecord->SetRenderRecord(nullptr); - } -} } // namespace AppExecFwk -} // namespace OHOS \ No newline at end of file +} // namespace OHOS diff --git a/services/appmgr/src/app_running_record.cpp b/services/appmgr/src/app_running_record.cpp index fceaaec9b47..827235eb1c8 100644 --- a/services/appmgr/src/app_running_record.cpp +++ b/services/appmgr/src/app_running_record.cpp @@ -21,91 +21,6 @@ namespace OHOS { namespace AppExecFwk { int64_t AppRunningRecord::appEventId_ = 0; - -RenderRecord::RenderRecord(pid_t hostPid, const std::string& renderParam, - int32_t ipcFd, int32_t sharedFd, const std::shared_ptr &host) - : hostPid_(hostPid), renderParam_(renderParam), ipcFd_(ipcFd), sharedFd_(sharedFd), host_(host) -{} - -RenderRecord::~RenderRecord() -{} - -std::shared_ptr RenderRecord::CreateRenderRecord(pid_t hostPid, const std::string& renderParam, - int32_t ipcFd, int32_t sharedFd, const std::shared_ptr &host) -{ - if (hostPid <= 0 || renderParam.empty() || ipcFd <= 0 || sharedFd <= 0 || !host) { - return nullptr; - } - - auto renderRecord = std::make_shared(hostPid, renderParam, ipcFd, sharedFd, host); - if (!renderRecord) { - APP_LOGE("create render record failed, hostPid:%{public}d.", hostPid); - return nullptr; - } - - return renderRecord; -} - -void RenderRecord::SetPid(pid_t pid) -{ - pid_ = pid; -} - -pid_t RenderRecord::GetPid() -{ - return pid_; -} - -pid_t RenderRecord::GetHostPid() -{ - return hostPid_; -} - -std::string RenderRecord::GetRenderParam() -{ - return renderParam_; -} - -int32_t RenderRecord::GetIpcFd() -{ - return ipcFd_; -} - -int32_t RenderRecord::GetSharedFd() -{ - return sharedFd_; -} - -std::shared_ptr RenderRecord::GetHostRecord() -{ - return host_.lock(); -} - -sptr RenderRecord::GetScheduler() -{ - return renderScheduler_; -} - -void RenderRecord::SetScheduler(const sptr &scheduler) -{ - renderScheduler_ = scheduler; -} - -void RenderRecord::SetDeathRecipient(const sptr recipient) -{ - deathRecipient_ = recipient; -} - -void RenderRecord::RegisterDeathRecipient() -{ - if (renderScheduler_ && deathRecipient_) { - auto obj = renderScheduler_->AsObject(); - if (obj) { - obj->AddDeathRecipient(deathRecipient_); - } - } -} - AppRunningRecord::AppRunningRecord( const std::shared_ptr &info, const int32_t recordId, const std::string &processName) : appRecordId_(recordId), processName_(processName) @@ -994,25 +909,5 @@ void AppRunningRecord::UpdateConfiguration(const Configuration &config) } appLifeCycleDeal_->UpdateConfiguration(config); } - -void AppRunningRecord::SetRenderRecord(const std::shared_ptr &record) -{ - renderRecord_ = record; -} - -std::shared_ptr AppRunningRecord::GetRenderRecord() -{ - return renderRecord_; -} - -void AppRunningRecord::SetStartMsg(const AppSpawnStartMsg &msg) -{ - startMsg_ = msg; -} - -AppSpawnStartMsg AppRunningRecord::GetStartMsg() -{ - return startMsg_; -} } // namespace AppExecFwk -} // namespace OHOS \ No newline at end of file +} // namespace OHOS diff --git a/services/appmgr/src/app_spawn_client.cpp b/services/appmgr/src/app_spawn_client.cpp index 521653972ab..2229827afac 100644 --- a/services/appmgr/src/app_spawn_client.cpp +++ b/services/appmgr/src/app_spawn_client.cpp @@ -25,9 +25,9 @@ const int32_t CONNECT_RETRY_DELAY = 200 * 1000; // 200ms const int32_t CONNECT_RETRY_MAX_TIMES = 15; } // namespace -AppSpawnClient::AppSpawnClient(bool isWebViewSpawn) +AppSpawnClient::AppSpawnClient() { - socket_ = std::make_shared(isWebViewSpawn); + socket_ = std::make_shared(); state_ = SpawnConnectionState::STATE_NOT_CONNECT; } diff --git a/services/appmgr/src/app_spawn_socket.cpp b/services/appmgr/src/app_spawn_socket.cpp index 4714dd47d1e..327b5255cee 100644 --- a/services/appmgr/src/app_spawn_socket.cpp +++ b/services/appmgr/src/app_spawn_socket.cpp @@ -19,15 +19,11 @@ namespace OHOS { namespace AppExecFwk { -// arg "AppSpawn" or "WebViewSpawn" cannot be defined as string object since REGISTER_SYSTEM_ABILITY will +// arg "AppSpawn" cannot be defined as string object since REGISTER_SYSTEM_ABILITY will // firstly start without init this string object, which leads to error. -AppSpawnSocket::AppSpawnSocket(bool isWebViewSpawn) -{ - clientSocket_ = isWebViewSpawn ? - std::make_unique("/dev/unix/socket/WebViewSpawn") : - std::make_unique("AppSpawn"); -} +AppSpawnSocket::AppSpawnSocket() : clientSocket_(std::make_unique("AppSpawn")) +{} AppSpawnSocket::~AppSpawnSocket() {} diff --git a/services/appmgr/src/lmks/lmks_utils.cpp b/services/appmgr/src/lmks/lmks_utils.cpp index c3280f09ac8..8a1833a30f7 100644 --- a/services/appmgr/src/lmks/lmks_utils.cpp +++ b/services/appmgr/src/lmks/lmks_utils.cpp @@ -54,8 +54,14 @@ int LmksUtils::RemoveProcess(pid_t pid) } // kill process - HiLog::Info(LABEL, "kill pid %{public}d success, name %{public}s size %{public}d", - pid, procName.c_str(), procSize); + int ret = kill(pid, SIGKILL); + if (ret) { + HiLog::Warn(LABEL, "kill pid %{public}d err %{public}s", pid, strerror(errno)); + return (-errno); + } else { + HiLog::Info( + LABEL, "kill pid %{public}d success, name %{public}s size %{public}d", pid, procName.c_str(), procSize); + } return 0; } diff --git a/services/appmgr/src/process_optimizer.cpp b/services/appmgr/src/process_optimizer.cpp index f03e0a4e149..534f4cd5df5 100644 --- a/services/appmgr/src/process_optimizer.cpp +++ b/services/appmgr/src/process_optimizer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -61,6 +61,8 @@ constexpr int APP_OOM_ADJ_UNKNOWN_VALUE = 64 * 1024; constexpr std::string_view SYSTEM_UI_BUNDLE_NAME = "com.ohos.systemui"; +constexpr int TIME_ADVANCE_RATE = 1000; + // pressure level low constexpr int LMKS_OOM_ADJ_LOW = 800; // pressure level medium @@ -684,5 +686,26 @@ std::string ProcessOptimizer::GetAppSuspendTimerName(const AppPtr &app) return ret; } + +void ProcessOptimizer::SetAppFreezingTime(int time) +{ + APP_LOGE("input second time:[%{public}d]", time); + + if (time > APP_SUSPEND_TIMEOUT_MAX && time < 0) { + APP_LOGE("input time error."); + return; + } + + suspendTimeout_ = time; + // convert seconds to milliseconds + suspendTimeout_ *= TIME_ADVANCE_RATE; +} + +void ProcessOptimizer::GetAppFreezingTime(int &time) +{ + time = suspendTimeout_ / TIME_ADVANCE_RATE; + APP_LOGE("current freez time:[%{public}d]", time); + return; +} } // namespace AppExecFwk } // namespace OHOS diff --git a/services/appmgr/src/process_optimizer_uba.cpp b/services/appmgr/src/process_optimizer_uba.cpp index 1dfe17b118d..679243386a9 100644 --- a/services/appmgr/src/process_optimizer_uba.cpp +++ b/services/appmgr/src/process_optimizer_uba.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -384,5 +384,25 @@ UbaServicePtr ProcessOptimizerUBA::GetUbaService() // try to get uba service here. return nullptr; } + +void ProcessOptimizerUBA::SetAppFreezingTime(int time) +{ + auto ubaService = GetUbaService(); + if (ubaService) { + APP_LOGI("ubaService implement."); + } else { + ProcessOptimizer::SetAppFreezingTime(time); + } +} + +void ProcessOptimizerUBA::GetAppFreezingTime(int &time) +{ + auto ubaService = GetUbaService(); + if (ubaService) { + APP_LOGI("ubaService implement."); + } else { + ProcessOptimizer::GetAppFreezingTime(time); + } +} } // namespace AppExecFwk } // namespace OHOS diff --git a/services/appmgr/src/remote_client_manager.cpp b/services/appmgr/src/remote_client_manager.cpp index 8184aa67b9f..711b395c0d5 100644 --- a/services/appmgr/src/remote_client_manager.cpp +++ b/services/appmgr/src/remote_client_manager.cpp @@ -22,8 +22,7 @@ namespace OHOS { namespace AppExecFwk { -RemoteClientManager::RemoteClientManager() - : appSpawnClient_(std::make_shared()), webviewSpawnClient_(std::make_shared(true)) +RemoteClientManager::RemoteClientManager() : appSpawnClient_(std::make_shared()) {} RemoteClientManager::~RemoteClientManager() @@ -60,10 +59,5 @@ void RemoteClientManager::SetBundleManager(sptr bundleManager) { bundleManager_ = bundleManager; } - -std::shared_ptr RemoteClientManager::GetWebviewSpawnClient() -{ - return webviewSpawnClient_; -} } // namespace AppExecFwk } // namespace OHOS \ No newline at end of file diff --git a/services/appmgr/test/BUILD.gn b/services/appmgr/test/BUILD.gn index 845e14df8fd..372b896a424 100644 --- a/services/appmgr/test/BUILD.gn +++ b/services/appmgr/test/BUILD.gn @@ -49,8 +49,6 @@ ohos_source_set("appmgr_test_source") { "${aafwk_path}/interfaces/innerkits/app_manager/src/appmgr/configuration.cpp", "${aafwk_path}/interfaces/innerkits/app_manager/src/appmgr/process_info.cpp", "${aafwk_path}/interfaces/innerkits/app_manager/src/appmgr/profile.cpp", - "${aafwk_path}/interfaces/innerkits/app_manager/src/appmgr/render_scheduler_host.cpp", - "${aafwk_path}/interfaces/innerkits/app_manager/src/appmgr/render_scheduler_proxy.cpp", "${aafwk_path}/interfaces/innerkits/app_manager/src/appmgr/running_process_info.cpp", "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base/src/ability_info.cpp", "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base/src/application_info.cpp", diff --git a/services/appmgr/test/mock/include/mock_app_mgr_service.h b/services/appmgr/test/mock/include/mock_app_mgr_service.h index dbd56b7565b..7c6908a5041 100644 --- a/services/appmgr/test/mock/include/mock_app_mgr_service.h +++ b/services/appmgr/test/mock/include/mock_app_mgr_service.h @@ -48,8 +48,6 @@ public: MOCK_METHOD2(GetSystemMemoryAttr, void(SystemMemoryAttr &memoryInfo, std::string &strConfig)); MOCK_METHOD0(StartupResidentProcess, void()); MOCK_METHOD1(AddAbilityStageDone, void(const int32_t recordId)); - MOCK_METHOD4(StartRenderProcess, int(const std::string&, int32_t, int32_t, pid_t&)); - MOCK_METHOD1(AttachRenderProcess, void(const sptr &renderScheduler)); MOCK_METHOD1(RegisterApplicationStateObserver, int32_t(const sptr &observer)); MOCK_METHOD1(UnregisterApplicationStateObserver, int32_t(const sptr &observer)); MOCK_METHOD3(ScheduleAcceptWantDone, 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 ea102b63e8e..4a14ec5ee10 100644 --- a/services/appmgr/test/mock/include/mock_app_spawn_socket.h +++ b/services/appmgr/test/mock/include/mock_app_spawn_socket.h @@ -26,7 +26,7 @@ namespace OHOS { namespace AppExecFwk { class MockAppSpawnSocket : public AppSpawnSocket { public: - MockAppSpawnSocket() : AppSpawnSocket(false) {} + MockAppSpawnSocket() = default; virtual ~MockAppSpawnSocket() = default; MOCK_METHOD0(OpenAppSpawnConnection, ErrCode()); diff --git a/services/appmgr/test/unittest/ams_ability_running_record_test/BUILD.gn b/services/appmgr/test/unittest/ams_ability_running_record_test/BUILD.gn index da2dfe6863f..cd40ee74bbb 100644 --- a/services/appmgr/test/unittest/ams_ability_running_record_test/BUILD.gn +++ b/services/appmgr/test/unittest/ams_ability_running_record_test/BUILD.gn @@ -34,7 +34,6 @@ ohos_unittest("AmsAbilityRunningRecordTest") { sources = [ "${services_path}/appmgr/src/ability_running_record.cpp", - "${services_path}/appmgr/src/app_death_recipient.cpp", "${services_path}/appmgr/src/app_mgr_service_inner.cpp", "${services_path}/appmgr/src/app_running_record.cpp", "${services_path}/appmgr/src/app_spawn_client.cpp", @@ -56,7 +55,6 @@ ohos_unittest("AmsAbilityRunningRecordTest") { "${appexecfwk_path}/libs/libeventhandler:libeventhandler_target", "${innerkits_path}/uri_permission:uri_permission_mgr", "${services_path}/appmgr/test:appmgr_test_source", - "${services_path}/common:perm_verification", "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits", "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", "//foundation/aafwk/standard/services/appmgr:libams", diff --git a/services/appmgr/test/unittest/ams_app_death_recipient_test/BUILD.gn b/services/appmgr/test/unittest/ams_app_death_recipient_test/BUILD.gn index dc221c935c3..d405e30a4a4 100644 --- a/services/appmgr/test/unittest/ams_app_death_recipient_test/BUILD.gn +++ b/services/appmgr/test/unittest/ams_app_death_recipient_test/BUILD.gn @@ -59,7 +59,6 @@ ohos_unittest("AppDeathRecipientTest") { "${appexecfwk_path}/libs/libeventhandler:libeventhandler_target", "${innerkits_path}/uri_permission:uri_permission_mgr", "${services_path}/appmgr/test:appmgr_test_source", - "${services_path}/common:perm_verification", "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits", "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", "//foundation/aafwk/standard/interfaces/innerkits/base:base", diff --git a/services/appmgr/test/unittest/ams_app_life_cycle_test/BUILD.gn b/services/appmgr/test/unittest/ams_app_life_cycle_test/BUILD.gn index 1554bc6a973..1d45a37a3d2 100644 --- a/services/appmgr/test/unittest/ams_app_life_cycle_test/BUILD.gn +++ b/services/appmgr/test/unittest/ams_app_life_cycle_test/BUILD.gn @@ -28,7 +28,6 @@ ohos_unittest("AmsAppLifeCycleTest") { sources = [ "${services_path}/appmgr/src/ability_running_record.cpp", - "${services_path}/appmgr/src/app_death_recipient.cpp", "${services_path}/appmgr/src/app_lifecycle_deal.cpp", "${services_path}/appmgr/src/app_mgr_service_event_handler.cpp", "${services_path}/appmgr/src/app_mgr_service_inner.cpp", @@ -59,7 +58,6 @@ ohos_unittest("AmsAppLifeCycleTest") { "${appexecfwk_path}/libs/libeventhandler:libeventhandler_target", "${innerkits_path}/uri_permission:uri_permission_mgr", "${services_path}/appmgr/test:appmgr_test_source", - "${services_path}/common:perm_verification", "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits", "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", "//foundation/aafwk/standard/interfaces/innerkits/base:base", diff --git a/services/appmgr/test/unittest/ams_app_life_cycle_test/ams_app_life_cycle_test.cpp b/services/appmgr/test/unittest/ams_app_life_cycle_test/ams_app_life_cycle_test.cpp index 37a4c51cb24..cafc0b13ea6 100644 --- a/services/appmgr/test/unittest/ams_app_life_cycle_test/ams_app_life_cycle_test.cpp +++ b/services/appmgr/test/unittest/ams_app_life_cycle_test/ams_app_life_cycle_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -1898,6 +1898,21 @@ HWTEST_F(AmsAppLifeCycleTest, ClearUpApplicationData_001, TestSize.Level1) serviceInner_->ClearUpApplicationData(appRecord->GetBundleName(), appRecord->GetUid(), NEW_PID); } +/* + * Feature: AMS + * Function: AppLifeCycle::IsBackgroundRunningRestricted + * SubFunction: bundleMgr CheckPermission + * FunctionPoints: UnsuspendApplication + * CaseDescription: Check if there is background operation permission + */ +HWTEST_F(AmsAppLifeCycleTest, IsBackgroundRunningRestricted_001, TestSize.Level1) +{ + sptr bundleMgr = new BundleMgrService(); + serviceInner_->SetBundleManager(bundleMgr); + EXPECT_CALL(*bundleMgr, CheckPermission(_, _)).Times(1).WillOnce(Return(ERR_OK)); + EXPECT_EQ(ERR_OK, serviceInner_->IsBackgroundRunningRestricted("bundle")); +} + /* * Feature: AMS * Function: AppLifeCycle::CreateAppRunningRecord diff --git a/services/appmgr/test/unittest/ams_app_mgr_client_test/BUILD.gn b/services/appmgr/test/unittest/ams_app_mgr_client_test/BUILD.gn index 370e73e780d..3f49da62496 100644 --- a/services/appmgr/test/unittest/ams_app_mgr_client_test/BUILD.gn +++ b/services/appmgr/test/unittest/ams_app_mgr_client_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -47,7 +47,6 @@ ohos_unittest("AmsAppMgrClientTest") { "${aafwk_path}/interfaces/innerkits/app_manager:app_manager", "${appexecfwk_path}/libs/libeventhandler:libeventhandler_target", "${services_path}/appmgr/test:appmgr_test_source", - "${services_path}/common:perm_verification", "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits", "//foundation/aafwk/standard/interfaces/innerkits/want:want", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core:appexecfwk_core", diff --git a/services/appmgr/test/unittest/ams_app_running_record_test/BUILD.gn b/services/appmgr/test/unittest/ams_app_running_record_test/BUILD.gn index 82442b11ca1..77f587aadce 100644 --- a/services/appmgr/test/unittest/ams_app_running_record_test/BUILD.gn +++ b/services/appmgr/test/unittest/ams_app_running_record_test/BUILD.gn @@ -33,7 +33,6 @@ ohos_unittest("AmsAppRunningRecordTest") { sources = [ "${services_path}/appmgr/src/ability_running_record.cpp", - "${services_path}/appmgr/src/app_death_recipient.cpp", "${services_path}/appmgr/src/app_mgr_service_inner.cpp", "${services_path}/appmgr/src/app_running_record.cpp", "${services_path}/appmgr/src/app_spawn_client.cpp", @@ -54,7 +53,6 @@ ohos_unittest("AmsAppRunningRecordTest") { "${appexecfwk_path}/libs/libeventhandler:libeventhandler_target", "${innerkits_path}/uri_permission:uri_permission_mgr", "${services_path}/appmgr/test:appmgr_test_source", - "${services_path}/common:perm_verification", "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits", "//foundation/aafwk/standard/services/appmgr:libams", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core:appexecfwk_core", diff --git a/services/appmgr/test/unittest/ams_app_workflow_test/BUILD.gn b/services/appmgr/test/unittest/ams_app_workflow_test/BUILD.gn index 254ac523d03..694353fa851 100644 --- a/services/appmgr/test/unittest/ams_app_workflow_test/BUILD.gn +++ b/services/appmgr/test/unittest/ams_app_workflow_test/BUILD.gn @@ -29,7 +29,6 @@ ohos_unittest("AmsWorkFlowTest") { sources = [ "${services_path}/appmgr/src/ability_running_record.cpp", - "${services_path}/appmgr/src/app_death_recipient.cpp", "${services_path}/appmgr/src/app_lifecycle_deal.cpp", "${services_path}/appmgr/src/app_mgr_service_event_handler.cpp", "${services_path}/appmgr/src/app_mgr_service_inner.cpp", @@ -57,7 +56,6 @@ ohos_unittest("AmsWorkFlowTest") { "${appexecfwk_path}/libs/libeventhandler:libeventhandler_target", "${innerkits_path}/uri_permission:uri_permission_mgr", "${services_path}/appmgr/test:appmgr_test_source", - "${services_path}/common:perm_verification", "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits", "//foundation/aafwk/standard/interfaces/innerkits/base:base", "//foundation/aafwk/standard/interfaces/innerkits/want:want", 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 9bfd1a4b3ea..4b7f1e95471 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -213,6 +213,33 @@ HWTEST_F(AmsIpcAppMgrInterfaceTest, ClearUpApplicationData_008, TestSize.Level1) APP_LOGD("ClearUpApplicationData_008 end"); } +/* + * Feature: AMS + * Function: IPC IsBackgroundRunningRestricted + * SubFunction: appmgr interface + * FunctionPoints: Check background operation + * CaseDescription: test IPC can transact data + */ +HWTEST_F(AmsIpcAppMgrInterfaceTest, IsBackgroundRunningRestricted_009, TestSize.Level1) +{ + APP_LOGD("IsBackgroundRunningRestricted_009 start"); + + sptr mockAppMgr(new MockAppMgrService()); + sptr appMgrClient = iface_cast(mockAppMgr); + + EXPECT_CALL(*mockAppMgr, IsBackgroundRunningRestricted(_)).Times(1).WillOnce(Return(OHOS::NO_ERROR)); + + int32_t ret = appMgrClient->IsBackgroundRunningRestricted("PROCESS"); + + EXPECT_EQ(ret, OHOS::NO_ERROR); + // Returns 32 when the bundle name is empty + EXPECT_CALL(*mockAppMgr, IsBackgroundRunningRestricted(_)).Times(1).WillOnce(Return(32)); + ret = appMgrClient->IsBackgroundRunningRestricted(""); + + EXPECT_EQ(ret, 32); + APP_LOGD("IsBackgroundRunningRestricted_009 end"); +} + /* * Feature: AMS * Function: IPC 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 0a99396ef84..85f35cacbda 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -238,6 +238,32 @@ HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_005, TestSize.Level1) APP_LOGD("AmsMgrScheduler_005 end."); } +/* + * Feature: AMS + * Function: AmsMgrScheduler + * SubFunction: Reset + * FunctionPoints: Act normal + * EnvConditions: Mobile that can run ohos test framework. + * CaseDescription: Verify the function Reset can works. + */ +HWTEST_F(AmsMgrSchedulerTest, AmsMgrScheduler_006, TestSize.Level1) +{ + APP_LOGD("AmsMgrScheduler_006 start."); + + auto mockAppMgrServiceInner = GetMockAppMgrServiceInner(); + auto amsEventHandler = GetAmsEventHandler(); + std::unique_ptr amsMgrScheduler = + std::make_unique(mockAppMgrServiceInner, amsEventHandler); + + sptr appStateCallbackHost = new AppStateCallbackHost(); + EXPECT_CALL(*mockAppMgrServiceInner, StopAllProcess()) + .WillOnce(InvokeWithoutArgs(mockAppMgrServiceInner.get(), &MockAppMgrServiceInner::Post)); + amsMgrScheduler->Reset(); + mockAppMgrServiceInner->Wait(); + + APP_LOGD("AmsMgrScheduler_006 end."); +} + /* * Feature: AMS * Function: AmsMgrScheduler diff --git a/services/appmgr/test/unittest/ams_recent_app_list_test/BUILD.gn b/services/appmgr/test/unittest/ams_recent_app_list_test/BUILD.gn index 49ef60e977f..10d50345d28 100644 --- a/services/appmgr/test/unittest/ams_recent_app_list_test/BUILD.gn +++ b/services/appmgr/test/unittest/ams_recent_app_list_test/BUILD.gn @@ -27,7 +27,6 @@ ohos_unittest("AmsRecentAppListTest") { sources = [ "${services_path}/appmgr/src/ability_running_record.cpp", - "${services_path}/appmgr/src/app_death_recipient.cpp", "${services_path}/appmgr/src/app_lifecycle_deal.cpp", "${services_path}/appmgr/src/app_mgr_service_inner.cpp", "${services_path}/appmgr/src/app_process_manager.cpp", @@ -57,7 +56,6 @@ ohos_unittest("AmsRecentAppListTest") { "${appexecfwk_path}/libs/libeventhandler:libeventhandler_target", "${innerkits_path}/uri_permission:uri_permission_mgr", "${services_path}/appmgr/test:appmgr_test_source", - "${services_path}/common:perm_verification", "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits", "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", "//foundation/aafwk/standard/interfaces/innerkits/base:base", diff --git a/services/appmgr/test/unittest/ams_service_app_spawn_client_test/BUILD.gn b/services/appmgr/test/unittest/ams_service_app_spawn_client_test/BUILD.gn index 477e6e2c17c..c09f3a61dce 100644 --- a/services/appmgr/test/unittest/ams_service_app_spawn_client_test/BUILD.gn +++ b/services/appmgr/test/unittest/ams_service_app_spawn_client_test/BUILD.gn @@ -54,7 +54,6 @@ ohos_unittest("AmsServiceAppSpawnClientTest") { "${appexecfwk_path}/libs/libeventhandler:libeventhandler_target", "${innerkits_path}/uri_permission:uri_permission_mgr", "${services_path}/appmgr/test:appmgr_test_source", - "${services_path}/common:perm_verification", "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits", "//foundation/aafwk/standard/interfaces/innerkits/base:base", "//foundation/aafwk/standard/interfaces/innerkits/want:want", diff --git a/services/appmgr/test/unittest/ams_service_event_drive_test/BUILD.gn b/services/appmgr/test/unittest/ams_service_event_drive_test/BUILD.gn index 4c7f3d6470d..48fba9708ff 100644 --- a/services/appmgr/test/unittest/ams_service_event_drive_test/BUILD.gn +++ b/services/appmgr/test/unittest/ams_service_event_drive_test/BUILD.gn @@ -56,7 +56,6 @@ ohos_unittest("AmsServiceEventDriveTest") { "${appexecfwk_path}/libs/libeventhandler:libeventhandler_target", "${innerkits_path}/uri_permission:uri_permission_mgr", "${services_path}/appmgr/test:appmgr_test_source", - "${services_path}/common:perm_verification", "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits", "//foundation/aafwk/standard/interfaces/innerkits/base:base", "//foundation/aafwk/standard/interfaces/innerkits/want:want", 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 576239b3274..f17bbdbe689 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -226,6 +226,30 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_006, TestSize.Level1) APP_LOGI("ams_service_event_drive_test_006 end"); } +/* + * Feature: AppMgrService + * Function: Service + * SubFunction: EventDrive + * FunctionPoints: AppMgrService event drive program model + * EnvConditions: Mobile that can run ohos test framework + * CaseDescription: Verify if post IsBackgroundRunningRestricted task success + */ +HWTEST_F(AmsServiceEventDriveTest, EventDrive_007, TestSize.Level1) +{ + APP_LOGI("ams_service_event_drive_test_007 start"); + + std::shared_ptr innerService = std::make_shared(); + appMgrService_->SetInnerService(innerService); + appMgrService_->OnStart(); + + EXPECT_CALL(*innerService, IsBackgroundRunningRestricted(_)).WillOnce(Return(0)); + + std::string appName = "appName"; + EXPECT_EQ(0, appMgrService_->IsBackgroundRunningRestricted(appName)); + + APP_LOGI("ams_service_event_drive_test_007 end"); +} + /* * Feature: AppMgrService * Function: Service @@ -394,6 +418,28 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_014, TestSize.Level1) APP_LOGI("ams_service_event_drive_test_014 end"); } +/* + * Feature: AppMgrService + * Function: Service + * SubFunction: EventDrive + * FunctionPoints: AppMgrService event drive program model + * EnvConditions: Mobile that can run ohos test framework + * CaseDescription: Verify if IsBackgroundRunningRestricted act normal after AppMgrService stopped + */ +HWTEST_F(AmsServiceEventDriveTest, EventDrive_015, TestSize.Level1) +{ + APP_LOGI("ams_service_event_drive_test_015 start"); + + appMgrService_->OnStop(); + std::shared_ptr innerService = std::make_shared(); + appMgrService_->SetInnerService(innerService); + + std::string appName = "appName"; + EXPECT_EQ(OHOS::ERR_INVALID_OPERATION, appMgrService_->IsBackgroundRunningRestricted(appName)); + + APP_LOGI("ams_service_event_drive_test_015 end"); +} + /* * Feature: AppMgrService * Function: Service @@ -564,6 +610,28 @@ HWTEST_F(AmsServiceEventDriveTest, EventDrive_022, TestSize.Level1) APP_LOGI("ams_service_event_drive_test_022 end"); } +/* + * Feature: AppMgrService + * Function: Service + * SubFunction: EventDrive + * FunctionPoints: AppMgrService event drive program model + * EnvConditions: Mobile that can run ohos test framework + * CaseDescription: Verify if IsBackgroundRunningRestricted act normal after AppMgrService stopped + */ +HWTEST_F(AmsServiceEventDriveTest, EventDrive_023, TestSize.Level1) +{ + APP_LOGI("ams_service_event_drive_test_023 start"); + std::shared_ptr innerService = std::make_shared(); + appMgrService_->SetInnerService(innerService); + appMgrService_->OnStart(); + appMgrService_->OnStop(); + + std::string appName = "appName"; + EXPECT_EQ(OHOS::ERR_INVALID_OPERATION, appMgrService_->IsBackgroundRunningRestricted(appName)); + + APP_LOGI("ams_service_event_drive_test_023 end"); +} + /* * Feature: AppMgrService * Function: Service diff --git a/services/appmgr/test/unittest/ams_service_load_ability_process_test/BUILD.gn b/services/appmgr/test/unittest/ams_service_load_ability_process_test/BUILD.gn index 18c0cf797af..367663fa6a5 100644 --- a/services/appmgr/test/unittest/ams_service_load_ability_process_test/BUILD.gn +++ b/services/appmgr/test/unittest/ams_service_load_ability_process_test/BUILD.gn @@ -27,7 +27,6 @@ ohos_unittest("AmsServiceLoadAbilityProcessTest") { sources = [ "${services_path}/appmgr/src/ability_running_record.cpp", - "${services_path}/appmgr/src/app_death_recipient.cpp", "${services_path}/appmgr/src/app_lifecycle_deal.cpp", "${services_path}/appmgr/src/app_mgr_service_inner.cpp", "${services_path}/appmgr/src/app_process_manager.cpp", @@ -61,7 +60,6 @@ ohos_unittest("AmsServiceLoadAbilityProcessTest") { "${appexecfwk_path}/libs/libeventhandler:libeventhandler_target", "${innerkits_path}/uri_permission:uri_permission_mgr", "${services_path}/appmgr/test:appmgr_test_source", - "${services_path}/common:perm_verification", "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits", "//foundation/aafwk/standard/interfaces/innerkits/base:base", "//foundation/aafwk/standard/interfaces/innerkits/want:want", diff --git a/services/appmgr/test/unittest/ams_service_startup_test/BUILD.gn b/services/appmgr/test/unittest/ams_service_startup_test/BUILD.gn index d34b4169490..fc65f97e04a 100644 --- a/services/appmgr/test/unittest/ams_service_startup_test/BUILD.gn +++ b/services/appmgr/test/unittest/ams_service_startup_test/BUILD.gn @@ -51,7 +51,6 @@ ohos_unittest("AmsServiceStartupTest") { "${appexecfwk_path}/libs/libeventhandler:libeventhandler_target", "${innerkits_path}/uri_permission:uri_permission_mgr", "${services_path}/appmgr/test:appmgr_test_source", - "${services_path}/common:perm_verification", "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits", "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", "//foundation/aafwk/standard/interfaces/innerkits/base:base", diff --git a/services/appmgr/test/unittest/app_mgr_service_event_handler_test/BUILD.gn b/services/appmgr/test/unittest/app_mgr_service_event_handler_test/BUILD.gn index 635e47a975f..914c579d618 100644 --- a/services/appmgr/test/unittest/app_mgr_service_event_handler_test/BUILD.gn +++ b/services/appmgr/test/unittest/app_mgr_service_event_handler_test/BUILD.gn @@ -59,7 +59,6 @@ ohos_unittest("AMSEventHandlerTest") { "${appexecfwk_path}/libs/libeventhandler:libeventhandler_target", "${innerkits_path}/uri_permission:uri_permission_mgr", "${services_path}/appmgr/test:appmgr_test_source", - "${services_path}/common:perm_verification", "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits", "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", "//foundation/aafwk/standard/interfaces/innerkits/base:base", diff --git a/services/common/BUILD.gn b/services/common/BUILD.gn index 60e148c9e31..28587377112 100644 --- a/services/common/BUILD.gn +++ b/services/common/BUILD.gn @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 Huawei Device Co., Ltd. +# 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 @@ -29,29 +29,3 @@ ohos_source_set("abilitymgr_common") { external_deps = [ "hiviewdfx_hilog_native:libhilog" ] } - -config("perm_verification_config") { - visibility = [ ":*" ] - include_dirs = [ "include" ] - cflags = [] - if (target_cpu == "arm") { - cflags += [ "-DBINDER_IPC_32BIT" ] - } -} - -#build so -ohos_shared_library("perm_verification") { - public_configs = [ ":perm_verification_config" ] - - sources = [ "src/permission_verification.cpp" ] - - external_deps = [ - "access_token:libaccesstoken_sdk", - "hiviewdfx_hilog_native:libhilog", - "ipc:ipc_core", - "utils_base:utils", - ] - - subsystem_name = "aafwk" - part_name = "ability_runtime" -} diff --git a/services/common/include/permission_constants.h b/services/common/include/permission_constants.h deleted file mode 100644 index fce13bd70ba..00000000000 --- a/services/common/include/permission_constants.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_AAFWK_PERMISSION_CONSTANTS_H -#define OHOS_AAFWK_PERMISSION_CONSTANTS_H - -namespace OHOS { -namespace AAFwk { -namespace PermissionConstants { -const std::string PERMISSION_CLEAN_BACKGROUND_PROCESSES = "ohos.permission.CLEAN_BACKGROUND_PROCESSES"; -const std::string PERMISSION_INTERACT_ACROSS_LOCAL_ACCOUNTS = "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS"; -const std::string PERMISSION_GET_RUNNING_INFO = "ohos.permission.GET_RUNNING_INFO"; -const std::string PERMISSION_UPDATE_CONFIGURATION = "ohos.permission.UPDATE_CONFIGURATION"; -const std::string PERMISSION_CLEAN_APPLICATION_DATA = "ohos.permission.CLEAN_APPLICATION_DATA"; -const std::string PERMISSION_RUNNING_STATE_OBSERVER = "ohos.permission.RUNNING_STATE_OBSERVER"; -const std::string PERMISSION_MANAGE_MISSION = "ohos.permission.MANAGE_MISSIONS"; -} // namespace PermissionConstants -} // namespace AAFwk -} // namespace OHOS -#endif // OHOS_AAFWK_PERMISSION_CONSTANTS_H \ No newline at end of file diff --git a/services/common/include/permission_verification.h b/services/common/include/permission_verification.h deleted file mode 100644 index 89e6fd773ae..00000000000 --- a/services/common/include/permission_verification.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_AAFWK_PERMISSION_VERIFICATION_H -#define OHOS_AAFWK_PERMISSION_VERIFICATION_H - -#include - -#include "singleton.h" - -namespace OHOS { -namespace AAFwk { -class PermissionVerification : public DelayedSingleton { -public: - PermissionVerification() = default; - ~PermissionVerification() = default; - - bool VerifyCallingPermission(const std::string &permissionName); - - bool IsSACall(); - - bool VerifyRunningInfoPerm(); - -private: - DISALLOW_COPY_AND_MOVE(PermissionVerification); - unsigned int GetCallingTokenID(); -}; -} // namespace AAFwk -} // namespace OHOS -#endif // OHOS_AAFWK_PERMISSION_VERIFICATION_H \ No newline at end of file diff --git a/services/common/src/permission_verification.cpp b/services/common/src/permission_verification.cpp deleted file mode 100644 index 10d186be7c3..00000000000 --- a/services/common/src/permission_verification.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "permission_verification.h" - -#include "accesstoken_kit.h" -#include "hilog_wrapper.h" -#include "ipc_skeleton.h" -#include "permission_constants.h" - -namespace OHOS { -namespace AAFwk { -bool PermissionVerification::VerifyCallingPermission(const std::string &permissionName) -{ - HILOG_DEBUG("VerifyCallingPermission permission %{public}s", permissionName.c_str()); - auto callerToken = GetCallingTokenID(); - int32_t ret = Security::AccessToken::AccessTokenKit::VerifyAccessToken(callerToken, permissionName); - if (ret == Security::AccessToken::PermissionState::PERMISSION_DENIED) { - HILOG_ERROR("permission %{public}s: PERMISSION_DENIED", permissionName.c_str()); - return false; - } - HILOG_DEBUG("verify AccessToken success"); - return true; -} - -bool PermissionVerification::IsSACall() -{ - HILOG_DEBUG("AmsMgrScheduler::IsSACall is called."); - auto callerToken = GetCallingTokenID(); - auto tokenType = Security::AccessToken::AccessTokenKit::GetTokenTypeFlag(callerToken); - if (tokenType == Security::AccessToken::ATokenTypeEnum::TOKEN_NATIVE) { - HILOG_DEBUG("caller tokenType is native, verify success"); - return true; - } - HILOG_DEBUG("Not SA called."); - return false; -} - -bool PermissionVerification::VerifyRunningInfoPerm() -{ - if (IsSACall()) { - HILOG_DEBUG("%{public}s: the interface called by SA.", __func__); - return true; - } - if (VerifyCallingPermission(PermissionConstants::PERMISSION_GET_RUNNING_INFO)) { - HILOG_DEBUG("%{public}s: Permission verification succeeded.", __func__); - return true; - } - HILOG_ERROR("%{public}s: Permission verification failed.", __func__); - return false; -} - -unsigned int PermissionVerification::GetCallingTokenID() -{ - auto callerToken = IPCSkeleton::GetCallingTokenID(); - HILOG_DEBUG("callerToken : %{public}u", callerToken); - return callerToken; -} -} // namespace AAFwk -} // namespace OHOS \ No newline at end of file diff --git a/services/formmgr/BUILD.gn b/services/formmgr/BUILD.gn index 1df7b815b4e..cc0963ffc1e 100644 --- a/services/formmgr/BUILD.gn +++ b/services/formmgr/BUILD.gn @@ -30,7 +30,6 @@ 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", @@ -91,7 +90,6 @@ 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", diff --git a/services/formmgr/include/form_info_mgr.h b/services/formmgr/include/form_info_mgr.h index 74bdb8db553..42bfdb441b6 100644 --- a/services/formmgr/include/form_info_mgr.h +++ b/services/formmgr/include/form_info_mgr.h @@ -79,8 +79,6 @@ public: private: std::shared_ptr GetOrCreateBundleFromInfo(const std::string &bundleName); - bool IsCaller(std::string bundleName); - bool CheckBundlePermission(); mutable std::shared_timed_mutex bundleFormInfoMapMutex_ {}; std::unordered_map> bundleFormInfoMap_ {}; diff --git a/services/formmgr/include/form_mgr_service.h b/services/formmgr/include/form_mgr_service.h index 400a368f640..ffb36aa484b 100644 --- a/services/formmgr/include/form_mgr_service.h +++ b/services/formmgr/include/form_mgr_service.h @@ -233,7 +233,19 @@ private: */ ErrCode Init(); + /** + * @brief Permission check by callingUid. + * @param formId the id of the form. + * @return Returns true on success, false on failure. + */ bool CheckFormPermission(); + + /** + * @brief Permission check. + * @param bundleName bundleName. + * @return Returns true on success, false on failure. + */ + bool CheckFormPermission(const std::string &bundleName) const; private: ServiceRunningState state_; diff --git a/services/formmgr/include/form_timer.h b/services/formmgr/include/form_timer.h index db681db10f6..e52bac2530c 100644 --- a/services/formmgr/include/form_timer.h +++ b/services/formmgr/include/form_timer.h @@ -42,7 +42,7 @@ public: bool isUpdateAt; int64_t refreshTime; bool isEnable = true; - bool isCountTimer; + bool isCountTimer = false; UpdateType type = UpdateType::TYPE_INTERVAL_CHANGE; FormTimer() @@ -54,7 +54,7 @@ public: min = -1; isUpdateAt = false; isCountTimer = false; - refreshTime = LONG_MAX; + refreshTime = 0; type = UpdateType::TYPE_INTERVAL_CHANGE; } @@ -67,7 +67,7 @@ public: min = -1; isUpdateAt = false; isCountTimer = countTimer; - refreshTime = LONG_MAX; + refreshTime = 0; type = UpdateType::TYPE_INTERVAL_CHANGE; } @@ -80,7 +80,7 @@ public: min = -1; isUpdateAt = false; isCountTimer = true; - refreshTime = LONG_MAX; + refreshTime = 0; type = UpdateType::TYPE_INTERVAL_CHANGE; } @@ -93,7 +93,7 @@ public: period = -1; isUpdateAt = true; isCountTimer = false; - refreshTime = LONG_MAX; + refreshTime = 0; type = UpdateType::TYPE_INTERVAL_CHANGE; } ~FormTimer(void){ @@ -105,7 +105,7 @@ public: */ class UpdateAtItem { public: - long updateAtTime = -1; + int updateAtTime = -1; FormTimer refreshTask; }; /** diff --git a/services/formmgr/src/form_info_mgr.cpp b/services/formmgr/src/form_info_mgr.cpp index d4a988f3c38..370e25f7951 100644 --- a/services/formmgr/src/form_info_mgr.cpp +++ b/services/formmgr/src/form_info_mgr.cpp @@ -23,9 +23,7 @@ #include "form_bms_helper.h" #include "form_info_storage_mgr.h" #include "form_util.h" -#include "ipc_skeleton.h" #include "json_serializer.h" -#include "permission_verification.h" namespace OHOS { namespace AppExecFwk { @@ -276,22 +274,10 @@ ErrCode FormInfoMgr::Remove(const std::string &bundleName) ErrCode FormInfoMgr::GetAllFormsInfo(std::vector &formInfos) { - bool hasPermission = CheckBundlePermission(); std::shared_lock guard(bundleFormInfoMapMutex_); - if (hasPermission) { - for (const auto &bundleFormInfo: bundleFormInfoMap_) { - if (bundleFormInfo.second != nullptr) { - bundleFormInfo.second->GetAllFormsInfo(formInfos); - } - } - } else { - for (const auto &bundleFormInfo: bundleFormInfoMap_) { - if (IsCaller(bundleFormInfo.first)) { - if (bundleFormInfo.second != nullptr) { - bundleFormInfo.second->GetAllFormsInfo(formInfos); - } - return ERR_OK; - } + for (const auto &bundleFormInfo: bundleFormInfoMap_) { + if (bundleFormInfo.second != nullptr) { + bundleFormInfo.second->GetAllFormsInfo(formInfos); } } return ERR_OK; @@ -304,10 +290,6 @@ ErrCode FormInfoMgr::GetFormsInfoByBundle(const std::string &bundleName, std::ve return ERR_APPEXECFWK_FORM_INVALID_PARAM; } - if (!CheckBundlePermission() && !IsCaller(bundleName)) { - return ERR_APPEXECFWK_FORM_PERMISSION_DENY; - } - std::shared_lock guard(bundleFormInfoMapMutex_); auto bundleFormInfoIter = bundleFormInfoMap_.find(bundleName); if (bundleFormInfoIter == bundleFormInfoMap_.end()) { @@ -329,10 +311,6 @@ ErrCode FormInfoMgr::GetFormsInfoByModule(const std::string &bundleName, const s return ERR_APPEXECFWK_FORM_INVALID_PARAM; } - if (!CheckBundlePermission() && !IsCaller(bundleName)) { - return ERR_APPEXECFWK_FORM_PERMISSION_DENY; - } - std::shared_lock guard(bundleFormInfoMapMutex_); auto bundleFormInfoIter = bundleFormInfoMap_.find(bundleName); if (bundleFormInfoIter == bundleFormInfoMap_.end()) { @@ -369,39 +347,5 @@ std::shared_ptr FormInfoMgr::GetOrCreateBundleFromInfo(const std bundleFormInfoMap_[bundleName] = bundleFormInfoPtr; return bundleFormInfoPtr; } - -bool FormInfoMgr::IsCaller(std::string bundleName) -{ - auto bms = FormBmsHelper::GetInstance().GetBundleMgr(); - if (!bms) { - return false; - } - AppExecFwk::BundleInfo bundleInfo; - bool ret = bms->GetBundleInfo(bundleName, GET_BUNDLE_DEFAULT, bundleInfo, FormUtil::GetCurrentAccountId()); - if (!ret) { - APP_LOGE("Failed to get bundle info."); - return false; - } - auto callerToken = IPCSkeleton::GetCallingTokenID(); - if (bundleInfo.applicationInfo.accessTokenId == callerToken) { - return true; - } - return false; -} - -bool FormInfoMgr::CheckBundlePermission() -{ - auto isSaCall = AAFwk::PermissionVerification::GetInstance()->IsSACall(); - if (isSaCall) { - return true; - } - auto isCallingPerm = AAFwk::PermissionVerification::GetInstance()->VerifyCallingPermission( - AppExecFwk::Constants::PERMISSION_GET_BUNDLE_INFO_PRIVILEGED); - if (isCallingPerm) { - return true; - } - APP_LOGE("Permission verification failed"); - return false; -} } // namespace AppExecFwk } // namespace OHOS diff --git a/services/formmgr/src/form_mgr_adapter.cpp b/services/formmgr/src/form_mgr_adapter.cpp index df70f1d0768..1534979cd21 100644 --- a/services/formmgr/src/form_mgr_adapter.cpp +++ b/services/formmgr/src/form_mgr_adapter.cpp @@ -14,6 +14,7 @@ */ #include +#include #include "appexecfwk_errors.h" #include "app_log_wrapper.h" @@ -585,12 +586,10 @@ int FormMgrAdapter::CastTempForm(const int64_t formId, const sptr APP_LOGE("%{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); - return ERR_APPEXECFWK_FORM_NOT_EXIST_ID; + if (std::find(formRecord.formUserUids.begin(), formRecord.formUserUids.end(), + callingUid) == formRecord.formUserUids.end()) { + formRecord.formUserUids.emplace_back(callingUid); } - 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); return errorCode; @@ -1211,7 +1210,9 @@ ErrCode FormMgrAdapter::CreateFormItemInfo(const BundleInfo &bundleInfo, if (formInfo.moduleName == item.moduleName) { itemInfo.AddHapSourceDirs(item.moduleSourceDir); } - itemInfo.AddModuleInfo(item.moduleName, item.moduleSourceDir); + auto moduleSourceDir = std::regex_replace(item.moduleSourceDir, std::regex(Constants::ABS_CODE_PATH), + Constants::LOCAL_BUNDLES); + itemInfo.AddModuleInfo(item.moduleName, moduleSourceDir); } return ERR_OK; } diff --git a/services/formmgr/src/form_mgr_service.cpp b/services/formmgr/src/form_mgr_service.cpp index cf1ed09d0d2..e61d0f15ae9 100644 --- a/services/formmgr/src/form_mgr_service.cpp +++ b/services/formmgr/src/form_mgr_service.cpp @@ -37,7 +37,6 @@ #include "iservice_registry.h" #include "permission/permission.h" #include "permission/permission_kit.h" -#include "permission_verification.h" #include "string_ex.h" #include "system_ability_definition.h" @@ -142,6 +141,10 @@ int FormMgrService::ReleaseForm(const int64_t formId, const sptr int FormMgrService::UpdateForm(const int64_t formId, const std::string &bundleName, const FormProviderData &formBindingData) { + if (!CheckFormPermission()) { + APP_LOGE("%{public}s fail, update form permission denied", __func__); + return ERR_APPEXECFWK_FORM_PERMISSION_DENY; + } return FormMgrAdapter::GetInstance().UpdateForm(formId, bundleName, formBindingData); } @@ -391,20 +394,28 @@ ErrCode FormMgrService::Init() APP_LOGI("init success"); return ERR_OK; } - +/** + * @brief Permission check by callingUid. + * @param formId the id of the form. + * @return Returns true on success, false on failure. + */ bool FormMgrService::CheckFormPermission() { - auto isSaCall = AAFwk::PermissionVerification::GetInstance()->IsSACall(); - if (isSaCall) { - return true; + return true; +} + +bool FormMgrService::CheckFormPermission(const std::string &bundleName) const +{ + if (bundleName.empty()) { + APP_LOGE("%{public}s fail, bundleName can not be empty", __func__); + return false; } - auto isCallingPerm = AAFwk::PermissionVerification::GetInstance()->VerifyCallingPermission( - AppExecFwk::Constants::PERMISSION_REQUIRE_FORM); - if (isCallingPerm) { - return true; + int result = PermissionKit::VerifyPermission(bundleName, Constants::PERMISSION_REQUIRE_FORM, 0); + if (result != PermissionState::PERMISSION_GRANTED) { + APP_LOGW("permission = %{public}s, bundleName = %{public}s, result = %{public}d", + Constants::PERMISSION_REQUIRE_FORM.c_str(), bundleName.c_str(), result); } - APP_LOGE("Permission verification failed"); - return false; + return result == PermissionState::PERMISSION_GRANTED; } /** diff --git a/services/formmgr/src/form_provider_mgr.cpp b/services/formmgr/src/form_provider_mgr.cpp index e0e786ff7bf..b58231bc150 100644 --- a/services/formmgr/src/form_provider_mgr.cpp +++ b/services/formmgr/src/form_provider_mgr.cpp @@ -370,7 +370,7 @@ int FormProviderMgr::MessageEvent(const int64_t formId, const FormRecord &record void FormProviderMgr::IncreaseTimerRefreshCount(const int64_t formId) { FormRecord record; - if (!FormDataMgr::GetInstance().GetFormRecord(formId, record)) { + if (FormDataMgr::GetInstance().GetFormRecord(formId, record)) { APP_LOGE("%{public}s failed, not exist such form:%{public}" PRId64 ".", __func__, formId); return; } diff --git a/services/formmgr/src/form_timer_mgr.cpp b/services/formmgr/src/form_timer_mgr.cpp index 509a0528976..036190e9492 100644 --- a/services/formmgr/src/form_timer_mgr.cpp +++ b/services/formmgr/src/form_timer_mgr.cpp @@ -829,7 +829,7 @@ bool FormTimerMgr::UpdateAtTimerAlarm() return true; } - long nextWakeUpTime = findedItem.updateAtTime; + int nextWakeUpTime = findedItem.updateAtTime; tmAtTime.tm_sec = 0; tmAtTime.tm_hour = findedItem.refreshTask.hour; tmAtTime.tm_min = findedItem.refreshTask.min; diff --git a/services/test/moduletest/ability_mgr_service_test/BUILD.gn b/services/test/moduletest/ability_mgr_service_test/BUILD.gn index 62b4ad566d4..7114e02f0f5 100644 --- a/services/test/moduletest/ability_mgr_service_test/BUILD.gn +++ b/services/test/moduletest/ability_mgr_service_test/BUILD.gn @@ -48,6 +48,7 @@ ohos_moduletest("ability_mgr_module_test") { "//foundation/aafwk/standard/services/abilitymgr/src/connection_record.cpp", "//foundation/aafwk/standard/services/abilitymgr/src/data_ability_manager.cpp", "//foundation/aafwk/standard/services/abilitymgr/src/data_ability_record.cpp", + "//foundation/aafwk/standard/services/abilitymgr/src/kernal_system_app_manager.cpp", "//foundation/aafwk/standard/services/abilitymgr/src/launch_param.cpp", "//foundation/aafwk/standard/services/abilitymgr/src/lifecycle_deal.cpp", "//foundation/aafwk/standard/services/abilitymgr/src/lifecycle_state_info.cpp", @@ -88,7 +89,6 @@ ohos_moduletest("ability_mgr_module_test") { "${aafwk_path}/interfaces/innerkits/app_manager:app_manager", "${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", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", diff --git a/services/test/moduletest/ability_mgr_service_test/ability_mgr_module_test.cpp b/services/test/moduletest/ability_mgr_service_test/ability_mgr_module_test.cpp index 12e14d6aecf..c6e97ec5551 100644 --- a/services/test/moduletest/ability_mgr_service_test/ability_mgr_module_test.cpp +++ b/services/test/moduletest/ability_mgr_service_test/ability_mgr_module_test.cpp @@ -195,6 +195,8 @@ static void OnStartAms() AbilityMgrModuleTest::abilityMgrServ_->SetStackManager(userId, true); AbilityMgrModuleTest::abilityMgrServ_->stackManagers_.emplace(0, AbilityMgrModuleTest::abilityMgrServ_->GetStackManager()); + AbilityMgrModuleTest::abilityMgrServ_->systemAppManager_ = std::make_shared(userId); + EXPECT_TRUE(AbilityMgrModuleTest::abilityMgrServ_->systemAppManager_); AbilityMgrModuleTest::abilityMgrServ_->eventLoop_->Run(); diff --git a/services/test/moduletest/ability_record_test/BUILD.gn b/services/test/moduletest/ability_record_test/BUILD.gn index e59b1ed2936..7c35ff46dcb 100644 --- a/services/test/moduletest/ability_record_test/BUILD.gn +++ b/services/test/moduletest/ability_record_test/BUILD.gn @@ -50,6 +50,7 @@ ohos_moduletest("AbilityRecordModuleTest") { "${services_path}/abilitymgr/src/connection_record.cpp", "${services_path}/abilitymgr/src/data_ability_manager.cpp", "${services_path}/abilitymgr/src/data_ability_record.cpp", + "${services_path}/abilitymgr/src/kernal_system_app_manager.cpp", "${services_path}/abilitymgr/src/launch_param.cpp", "${services_path}/abilitymgr/src/lifecycle_deal.cpp", "${services_path}/abilitymgr/src/lifecycle_state_info.cpp", @@ -91,7 +92,6 @@ ohos_moduletest("AbilityRecordModuleTest") { "${innerkits_path}/base:base", "${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", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", diff --git a/services/test/moduletest/ability_stack_test/BUILD.gn b/services/test/moduletest/ability_stack_test/BUILD.gn index d90794db209..59960e6fc51 100644 --- a/services/test/moduletest/ability_stack_test/BUILD.gn +++ b/services/test/moduletest/ability_stack_test/BUILD.gn @@ -48,6 +48,7 @@ ohos_moduletest("ability_stack_module_test") { "//foundation/aafwk/standard/services/abilitymgr/src/connection_record.cpp", "//foundation/aafwk/standard/services/abilitymgr/src/data_ability_manager.cpp", "//foundation/aafwk/standard/services/abilitymgr/src/data_ability_record.cpp", + "//foundation/aafwk/standard/services/abilitymgr/src/kernal_system_app_manager.cpp", "//foundation/aafwk/standard/services/abilitymgr/src/launch_param.cpp", "//foundation/aafwk/standard/services/abilitymgr/src/lifecycle_deal.cpp", "//foundation/aafwk/standard/services/abilitymgr/src/lifecycle_state_info.cpp", @@ -90,7 +91,6 @@ ohos_moduletest("ability_stack_module_test") { "${innerkits_path}/base:base", "${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", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", diff --git a/services/test/moduletest/ability_stack_test/ability_stack_module_test.cpp b/services/test/moduletest/ability_stack_test/ability_stack_module_test.cpp index d6ba767c0a7..666c937d822 100644 --- a/services/test/moduletest/ability_stack_test/ability_stack_module_test.cpp +++ b/services/test/moduletest/ability_stack_test/ability_stack_module_test.cpp @@ -97,6 +97,8 @@ void AbilityStackModuleTest::OnStartabilityMs(std::shared_ptrGetUserId(); abilityMs->SetStackManager(userId, true); abilityMs->stackManagers_.emplace(0, abilityMs->GetStackManager()); + abilityMs->systemAppManager_ = std::make_shared(userId); + EXPECT_TRUE(abilityMs->systemAppManager_); abilityMs->eventLoop_->Run(); return; } diff --git a/services/test/moduletest/common/ams/ability_running_record_test/BUILD.gn b/services/test/moduletest/common/ams/ability_running_record_test/BUILD.gn index d7c077e9022..16ca5ba126c 100755 --- a/services/test/moduletest/common/ams/ability_running_record_test/BUILD.gn +++ b/services/test/moduletest/common/ams/ability_running_record_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -24,10 +24,7 @@ ohos_moduletest("AmsAbilityRunningRecordModuleTest") { ] sources = [ "ams_ability_running_record_module_test.cpp" ] - deps = [ - "${services_path}/common:perm_verification", - "${services_path}/test/moduletest/common/ams:appmgr_mst_source", - ] + deps = [ "${services_path}/test/moduletest/common/ams:appmgr_mst_source" ] external_deps = [ "ipc:ipc_core" ] } diff --git a/services/test/moduletest/common/ams/app_life_cycle_test/BUILD.gn b/services/test/moduletest/common/ams/app_life_cycle_test/BUILD.gn index 690a1c2feda..0a03ebe4df9 100755 --- a/services/test/moduletest/common/ams/app_life_cycle_test/BUILD.gn +++ b/services/test/moduletest/common/ams/app_life_cycle_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -25,10 +25,7 @@ ohos_moduletest("AmsAppLifeCycleModuleTest") { ] sources = [ "ams_app_life_cycle_module_test.cpp" ] - deps = [ - "${services_path}/common:perm_verification", - "${services_path}/test/moduletest/common/ams:appmgr_mst_source", - ] + deps = [ "${services_path}/test/moduletest/common/ams:appmgr_mst_source" ] external_deps = [ "ipc:ipc_core" ] } 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 745b7d82bfe..d6b39eb5764 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 @@ -920,6 +920,14 @@ HWTEST_F(AmsAppLifeCycleModuleTest, StateChange_010, TestSize.Level3) std::vector allRunningProcessInfo; serviceInner_->GetAllRunningProcesses(allRunningProcessInfo); EXPECT_EQ(allRunningProcessInfo.size(), size_t(APPLICATION_NUM)); + + serviceInner_->StopAllProcess(); + + for (int i = 0; i < APPLICATION_NUM; i++) { + serviceInner_->OnRemoteDied(mockAppScheduler[i]); // A faked death recipient. + auto record = serviceInner_->GetAppRunningRecordByAppRecordId(recordId[i]); + EXPECT_EQ(nullptr, record); + } } /* diff --git a/services/test/moduletest/common/ams/app_mgr_service_test/BUILD.gn b/services/test/moduletest/common/ams/app_mgr_service_test/BUILD.gn index 6d701509807..d14fc2bb5af 100755 --- a/services/test/moduletest/common/ams/app_mgr_service_test/BUILD.gn +++ b/services/test/moduletest/common/ams/app_mgr_service_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -28,7 +28,6 @@ ohos_moduletest("AmsAppMgrServiceModuleTest") { ] deps = [ - "${services_path}/common:perm_verification", "${services_path}/test/moduletest/common/ams:appmgr_mst_source", "//base/global/i18n_standard/frameworks/intl:intl_util", ] diff --git a/services/test/moduletest/common/ams/app_mgr_service_test/ams_app_mgr_service_module_test.cpp b/services/test/moduletest/common/ams/app_mgr_service_test/ams_app_mgr_service_module_test.cpp index c590912c289..abb68fa83aa 100644 --- a/services/test/moduletest/common/ams/app_mgr_service_test/ams_app_mgr_service_module_test.cpp +++ b/services/test/moduletest/common/ams/app_mgr_service_test/ams_app_mgr_service_module_test.cpp @@ -327,6 +327,42 @@ HWTEST_F(AppMgrServiceModuleTest, ClearUpApplicationData_001, TestSize.Level1) } } +/* + * Feature: AppMgrService + * Function: IsBackgroundRunningRestricted + * SubFunction: NA + * FunctionPoints: AppMgrService => AppMgrServiceInner: IsBackgroundRunningRestricted + * CaseDescription: Check IsBackgroundRunningRestricted. + */ +HWTEST_F(AppMgrServiceModuleTest, IsBackgroundRunningRestricted_001, TestSize.Level1) +{ + EXPECT_TRUE(appMgrService_); + EXPECT_TRUE(mockAppMgrServiceInner_); + + std::string testAppName("testApp"); + bool testResult = false; + Semaphore sem(0); + + auto mockHandler = [&testResult, testAppName, &sem](const std::string &appName) { + testResult = (appName == testAppName); + sem.Post(); + return ERR_OK; + }; + + for (int i = 0; i < COUNT; ++i) { + testResult = false; + + EXPECT_CALL(*mockAppMgrServiceInner_, IsBackgroundRunningRestricted(_)).Times(1).WillOnce(Invoke(mockHandler)); + + auto result = appMgrService_->IsBackgroundRunningRestricted(testAppName); + + sem.Wait(); + + EXPECT_TRUE(testResult); + EXPECT_EQ(result, ERR_OK); + } +} + /* * Feature: AppMgrService * Function: GetAllRunningProcesses diff --git a/services/test/moduletest/common/ams/app_recent_list_test/BUILD.gn b/services/test/moduletest/common/ams/app_recent_list_test/BUILD.gn index b174fb58595..fc6c4758cf3 100755 --- a/services/test/moduletest/common/ams/app_recent_list_test/BUILD.gn +++ b/services/test/moduletest/common/ams/app_recent_list_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -24,10 +24,7 @@ ohos_moduletest("AmsAppRecentListModuleTest") { ] sources = [ "ams_app_recent_list_module_test.cpp" ] - deps = [ - "${services_path}/common:perm_verification", - "${services_path}/test/moduletest/common/ams:appmgr_mst_source", - ] + deps = [ "${services_path}/test/moduletest/common/ams:appmgr_mst_source" ] external_deps = [ "ipc:ipc_core" ] } diff --git a/services/test/moduletest/common/ams/app_running_record_test/BUILD.gn b/services/test/moduletest/common/ams/app_running_record_test/BUILD.gn index a300e9b5f69..5a949c9b30c 100755 --- a/services/test/moduletest/common/ams/app_running_record_test/BUILD.gn +++ b/services/test/moduletest/common/ams/app_running_record_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -25,10 +25,7 @@ ohos_moduletest("AmsAppRunningRecordModuleTest") { ] sources = [ "ams_app_running_record_module_test.cpp" ] - deps = [ - "${services_path}/common:perm_verification", - "${services_path}/test/moduletest/common/ams:appmgr_mst_source", - ] + deps = [ "${services_path}/test/moduletest/common/ams:appmgr_mst_source" ] external_deps = [ "ipc:ipc_core" ] } diff --git a/services/test/moduletest/common/ams/app_service_flow_test/BUILD.gn b/services/test/moduletest/common/ams/app_service_flow_test/BUILD.gn index c88dc7bf73b..71c4adaef32 100755 --- a/services/test/moduletest/common/ams/app_service_flow_test/BUILD.gn +++ b/services/test/moduletest/common/ams/app_service_flow_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -23,10 +23,7 @@ ohos_moduletest("AmsAppServiceFlowModuleTest") { [ "//base/hiviewdfx/hilog/interfaces/native/innerkits/include/" ] sources = [ "ams_app_service_flow_module_test.cpp" ] - deps = [ - "${services_path}/common:perm_verification", - "${services_path}/test/moduletest/common/ams:appmgr_mst_source", - ] + deps = [ "${services_path}/test/moduletest/common/ams:appmgr_mst_source" ] external_deps = [ "ipc:ipc_core" ] } diff --git a/services/test/moduletest/common/ams/ipc_ams_mgr_test/BUILD.gn b/services/test/moduletest/common/ams/ipc_ams_mgr_test/BUILD.gn index 2f17712cfc4..81dff48201c 100755 --- a/services/test/moduletest/common/ams/ipc_ams_mgr_test/BUILD.gn +++ b/services/test/moduletest/common/ams/ipc_ams_mgr_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -33,7 +33,6 @@ ohos_moduletest("AmsIpcAmsmgrModuleTest") { deps = [ "${appexecfwk_path}/libs/libeventhandler:libeventhandler_target", "${services_path}/appmgr/test:appmgr_test_source", - "${services_path}/common:perm_verification", "${services_path}/test/moduletest/common/ams:appmgr_mst_source", ] diff --git a/services/test/moduletest/common/ams/ipc_app_mgr_test/BUILD.gn b/services/test/moduletest/common/ams/ipc_app_mgr_test/BUILD.gn index d177076a30c..7e8d7036999 100755 --- a/services/test/moduletest/common/ams/ipc_app_mgr_test/BUILD.gn +++ b/services/test/moduletest/common/ams/ipc_app_mgr_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -23,10 +23,7 @@ ohos_moduletest("AmsIpcAppmgrModuleTest") { sources = [ "ams_ipc_app_mgr_module_test.cpp" ] - deps = [ - "${services_path}/common:perm_verification", - "${services_path}/test/moduletest/common/ams:appmgr_mst_source", - ] + deps = [ "${services_path}/test/moduletest/common/ams:appmgr_mst_source" ] external_deps = [ "ipc:ipc_core" ] } diff --git a/services/test/moduletest/common/ams/ipc_app_mgr_test/ams_ipc_app_mgr_module_test.cpp b/services/test/moduletest/common/ams/ipc_app_mgr_test/ams_ipc_app_mgr_module_test.cpp index d161ac57593..caf863ae46c 100644 --- a/services/test/moduletest/common/ams/ipc_app_mgr_test/ams_ipc_app_mgr_module_test.cpp +++ b/services/test/moduletest/common/ams/ipc_app_mgr_test/ams_ipc_app_mgr_module_test.cpp @@ -231,6 +231,37 @@ HWTEST_F(AmsIpcAppmgrModuleTest, ExcuteAppmgrIPCInterface_007, TestSize.Level3) } } +/* + * Feature: ApplicationFramework + * Function: AppManagerService + * SubFunction: AppmgrIPCInterface + * FunctionPoints: test IsBackgroundRunningRestricted API,then check the function whether is good or not + * EnvConditions: system running normally + * CaseDescription: excute IsBackgroundRunningRestricted API 10000 times + */ +HWTEST_F(AmsIpcAppmgrModuleTest, ExcuteAppmgrIPCInterface_008, TestSize.Level3) +{ + for (int i = 0; i < COUNT; i++) { + sptr mockMockAppMgr(new MockMockAppMgrService()); + sptr appMgrClient = iface_cast(mockMockAppMgr); + std::string testBundleName("testApp"); + bool testResult = false; + + auto mockHandler = [&](const std::string &name) { + testResult = (name == testBundleName); + mockMockAppMgr->Post(); + return 0; + }; + + EXPECT_CALL(*mockMockAppMgr, IsBackgroundRunningRestricted(_)).WillOnce(Invoke(mockHandler)); + + appMgrClient->IsBackgroundRunningRestricted(testBundleName); + mockMockAppMgr->Wait(); + + EXPECT_TRUE(testResult); + } +} + /* * Feature: ApplicationFramework * Function: AppManagerService diff --git a/services/test/moduletest/common/ams/ipc_app_scheduler_test/BUILD.gn b/services/test/moduletest/common/ams/ipc_app_scheduler_test/BUILD.gn index f7a3e7f6f67..2f51d57cbe1 100755 --- a/services/test/moduletest/common/ams/ipc_app_scheduler_test/BUILD.gn +++ b/services/test/moduletest/common/ams/ipc_app_scheduler_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -22,10 +22,7 @@ ohos_moduletest("AmsIpcAppSchedulerModuleTest") { include_dirs = [] sources = [ "ams_ipc_app_scheduler_module_test.cpp" ] - deps = [ - "${services_path}/common:perm_verification", - "${services_path}/test/moduletest/common/ams:appmgr_mst_source", - ] + deps = [ "${services_path}/test/moduletest/common/ams:appmgr_mst_source" ] external_deps = [ "ipc:ipc_core" ] } diff --git a/services/test/moduletest/common/ams/process_optimizer_uba_test/BUILD.gn b/services/test/moduletest/common/ams/process_optimizer_uba_test/BUILD.gn index 4274b41385e..8277f2720da 100644 --- a/services/test/moduletest/common/ams/process_optimizer_uba_test/BUILD.gn +++ b/services/test/moduletest/common/ams/process_optimizer_uba_test/BUILD.gn @@ -29,10 +29,7 @@ ohos_moduletest("AmsProcessOptimizerModuleTest") { sources = [ "ams_process_optimizer_uba_module_test.cpp" ] - deps = [ - "${services_path}/common:perm_verification", - "${services_path}/test/moduletest/common/ams:appmgr_mst_source", - ] + deps = [ "${services_path}/test/moduletest/common/ams:appmgr_mst_source" ] external_deps = [ "hiviewdfx_hilog_native:libhilog", diff --git a/services/test/moduletest/common/ams/service_app_spawn_client_test/BUILD.gn b/services/test/moduletest/common/ams/service_app_spawn_client_test/BUILD.gn index 6240f1cf721..b81874150a2 100755 --- a/services/test/moduletest/common/ams/service_app_spawn_client_test/BUILD.gn +++ b/services/test/moduletest/common/ams/service_app_spawn_client_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -29,7 +29,6 @@ ohos_moduletest("AmsServiceAppSpawnClientModuleTest") { ] deps = [ - "${services_path}/common:perm_verification", "${services_path}/test/moduletest/common/ams:appmgr_mst_source", "//base/global/i18n_standard/frameworks/intl:intl_util", ] diff --git a/services/test/moduletest/common/ams/service_event_drive_test/BUILD.gn b/services/test/moduletest/common/ams/service_event_drive_test/BUILD.gn index 46b188d1397..42b2dec3580 100755 --- a/services/test/moduletest/common/ams/service_event_drive_test/BUILD.gn +++ b/services/test/moduletest/common/ams/service_event_drive_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -30,7 +30,6 @@ ohos_moduletest("AmsServiceEventDriveModuleTest") { ] deps = [ - "${services_path}/common:perm_verification", "${services_path}/test/moduletest/common/ams:appmgr_mst_source", "//base/global/i18n_standard/frameworks/intl:intl_util", ] diff --git a/services/test/moduletest/common/ams/service_start_process_test/BUILD.gn b/services/test/moduletest/common/ams/service_start_process_test/BUILD.gn index 8074d13a603..b66d65a9261 100755 --- a/services/test/moduletest/common/ams/service_start_process_test/BUILD.gn +++ b/services/test/moduletest/common/ams/service_start_process_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -27,7 +27,6 @@ ohos_moduletest("AmsServiceStartModuleTest") { ] deps = [ - "${services_path}/common:perm_verification", "${services_path}/test/moduletest/common/ams:appmgr_mst_source", "//base/global/i18n_standard/frameworks/intl:intl_util", ] diff --git a/services/test/moduletest/dump_module_test/BUILD.gn b/services/test/moduletest/dump_module_test/BUILD.gn index 39647a0f3cf..3dda95945a9 100755 --- a/services/test/moduletest/dump_module_test/BUILD.gn +++ b/services/test/moduletest/dump_module_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -48,7 +48,6 @@ ohos_moduletest("dump_module_test") { "${services_path}/abilitymgr/test/mock/appmgr_test_service:appmgr_test_service", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_appmgr_mock", "${services_path}/abilitymgr/test/mock/libs/appexecfwk_core:appexecfwk_bundlemgr_mock", - "${services_path}/common:perm_verification", "//base/global/i18n_standard/frameworks/intl:intl_util", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", diff --git a/services/test/moduletest/dump_module_test/dump_module_test.cpp b/services/test/moduletest/dump_module_test/dump_module_test.cpp index 4f106f4a9f3..85d1448ceed 100644 --- a/services/test/moduletest/dump_module_test/dump_module_test.cpp +++ b/services/test/moduletest/dump_module_test/dump_module_test.cpp @@ -144,6 +144,8 @@ void DumpModuleTest::OnStartAms() int userId = g_abilityMs->GetUserId(); g_abilityMs->SetStackManager(userId, true); g_abilityMs->stackManagers_.emplace(0, g_abilityMs->GetStackManager()); + g_abilityMs->systemAppManager_ = std::make_shared(userId); + EXPECT_TRUE(g_abilityMs->systemAppManager_); g_abilityMs->eventLoop_->Run(); GTEST_LOG_(INFO) << "OnStart success"; return; diff --git a/services/test/moduletest/ipc_ability_connect_test/BUILD.gn b/services/test/moduletest/ipc_ability_connect_test/BUILD.gn index 487dc498f07..639d6687c5d 100644 --- a/services/test/moduletest/ipc_ability_connect_test/BUILD.gn +++ b/services/test/moduletest/ipc_ability_connect_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -31,7 +31,6 @@ ohos_moduletest("IpcAbilityConnectModuleTest") { } deps = [ "${innerkits_path}/want:want", - "${services_path}/common:perm_verification", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", diff --git a/services/test/moduletest/ipc_ability_mgr_test/BUILD.gn b/services/test/moduletest/ipc_ability_mgr_test/BUILD.gn index 9341420fdc0..56cbc739203 100644 --- a/services/test/moduletest/ipc_ability_mgr_test/BUILD.gn +++ b/services/test/moduletest/ipc_ability_mgr_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -33,7 +33,6 @@ ohos_moduletest("IpcAbilityMgrServiceModuleTest") { deps = [ "${aafwk_path}/interfaces/innerkits/app_manager:app_manager", "${innerkits_path}/want:want", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/services/abilitymgr:abilityms", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base", "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core:appexecfwk_core", diff --git a/services/test/moduletest/ipc_ability_scheduler_test/BUILD.gn b/services/test/moduletest/ipc_ability_scheduler_test/BUILD.gn index 9c07fbc05ca..4d0ca27ff79 100644 --- a/services/test/moduletest/ipc_ability_scheduler_test/BUILD.gn +++ b/services/test/moduletest/ipc_ability_scheduler_test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# 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 @@ -46,7 +46,6 @@ ohos_moduletest("IpcAbilitySchedulerModuleTest") { } deps = [ "${innerkits_path}/want:want", - "${services_path}/common:perm_verification", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes", "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager", diff --git a/services/test/moduletest/panding_want_manager_test/BUILD.gn b/services/test/moduletest/panding_want_manager_test/BUILD.gn index 4a483a0f12e..ff50fe35533 100755 --- a/services/test/moduletest/panding_want_manager_test/BUILD.gn +++ b/services/test/moduletest/panding_want_manager_test/BUILD.gn @@ -51,7 +51,6 @@ ohos_moduletest("PandingWantMgrTest") { "${innerkits_path}/base:base", "${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", diff --git a/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/BUILD.gn b/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/BUILD.gn index 1e0fab8598d..4631a17f0de 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/BUILD.gn +++ b/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/BUILD.gn @@ -13,7 +13,7 @@ import("//build/ohos.gni") import("//foundation/aafwk/standard/aafwk.gni") -SUBDEMOSYSTEM_DIR = "//foundation/appexecfwk/standard/test/resource/amssystemtestability/abilitySrc/amsStDataAbility" +SUBDEMOSYSTEM_DIR = "${system_test_app_path}/amsStDataAbility" EVENT_DIR = "//base/notification/ces_standard/cesfwk" config("verify_act_ability_config") { diff --git a/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/include/verify_act_data_ability.h b/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/include/verify_act_data_ability.h index b8967ce1f7b..9f87dcda97c 100644 --- a/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/include/verify_act_data_ability.h +++ b/test/resource/amssystemtestability/abilitySrc/amsStDataAbility/include/verify_act_data_ability.h @@ -41,13 +41,10 @@ public: virtual int BatchInsert(const Uri &uri, const std::vector &values) override; std::vector> sharedList_; -}; -class InsertTestOpenCallback : public NativeRdb::RdbOpenCallback { -public: - int OnCreate(NativeRdb::RdbStore &rdbStore) override; - int OnUpgrade(NativeRdb::RdbStore &rdbStore, int oldVersion, int newVersion) override; - static const std::string CREATE_TABLE_TEST; + virtual std::vector GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) override; + virtual Uri NormalizeUri(const Uri &uri) override; + virtual Uri DenormalizeUri(const Uri &uri) override; }; } // namespace AppExecFwk } // namespace OHOS 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 b5bcbb9676e..f5887fce9d1 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 @@ -4,7 +4,7 @@ * 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 + * http://www.apache.org/licenses/LICENSERETURN_ERROR2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,11 +14,13 @@ */ #include "abs_shared_result_set.h" +#include "ability_loader.h" +#include "app_log_wrapper.h" +#include "data_ability_helper.h" #include "data_ability_predicates.h" +#include "rdb_helper.h" +#include "rdb_open_callback.h" #include "values_bucket.h" - -#include "app_log_wrapper.h" -#include "ability_loader.h" #include "verify_act_data_ability.h" namespace OHOS { @@ -28,8 +30,25 @@ static std::shared_ptr testStore; static const std::string RDB_TEST_PATH = "/data/test/"; static const std::string DATABASE_FILE_NAME = "insert_test.db"; static const std::string DATABASE_NAME = RDB_TEST_PATH + "insert_test.db"; -static const int defaultReturn = 1; -} +static int defaultReturn = 1; +static const double ageI = 24; +static const double salaryI = 2024.20; +static const int returnError = 0; +static const int returnError1 = -1; +static const int returnError2 = -2; +static const int returnError3 = -3; +static const int value1 = 0; +static const int value2 = 1; +static const int value3 = 2; +static const int value4 = 3; +} // namespace + +class InsertTestOpenCallback : public NativeRdb::RdbOpenCallback { +public: + int OnCreate(NativeRdb::RdbStore &rdbStore) override; + int OnUpgrade(NativeRdb::RdbStore &rdbStore, int oldVersion, int newVersion) override; + static const std::string CREATE_TABLE_TEST; +}; const std::string InsertTestOpenCallback::CREATE_TABLE_TEST = std::string("CREATE TABLE IF NOT EXISTS test ") + std::string("(id INTEGER PRIMARY KEY AUTOINCREMENT, " @@ -38,12 +57,14 @@ const std::string InsertTestOpenCallback::CREATE_TABLE_TEST = int InsertTestOpenCallback::OnCreate(NativeRdb::RdbStore &store) { + APP_LOGI("VerifyActDataAbility OnCreate"); return store.ExecuteSql(CREATE_TABLE_TEST); } int InsertTestOpenCallback::OnUpgrade(NativeRdb::RdbStore &store, int oldVersion, int newVersion) { - return 0; + APP_LOGI("VerifyActDataAbility OnUpgrade"); + return returnError; } void VerifyActDataAbility::OnStart(const Want &want) @@ -56,48 +77,149 @@ void VerifyActDataAbility::OnStart(const Want &want) int VerifyActDataAbility::Insert(const Uri &uri, const NativeRdb::ValuesBucket &value) { APP_LOGI("VerifyActDataAbility <<<>>>"); + std::shared_ptr dataUri = std::make_shared("dataability:///com.ix.VerifyActDataAbility"); + auto notify = DataAbilityHelper::Creator(GetContext(), dataUri); + if (notify == nullptr) { + APP_LOGE("VerifyActDataAbility <<<>>>"); + return returnError; + } + notify->NotifyChange(*dataUri); + + APP_LOGI("VerifyActDataAbility Insert uri.ToString = %{public}s", uri.ToString().c_str()); + APP_LOGI("VerifyActDataAbility Insert dataUri.ToString = %{public}s", dataUri->ToString().c_str()); + APP_LOGI("VerifyActDataAbility uri.Equals = %{public}d", uri.Equals(*dataUri)); + if (uri.Equals(*dataUri) != 1) { + return returnError1; + } + + defaultReturn = 1; + std::map valuesMap; + value.GetAll(valuesMap); + int valuesMapSize = valuesMap.size(); + APP_LOGI("VerifyActDataAbility value = %{public}d", valuesMapSize); + if (!valuesMapSize) + return returnError2; + for (auto item = valuesMap.begin(); item != valuesMap.end(); item++) { + auto valueFirst = item->first; + auto valueSecond = item->second; + int iEOK = 0; + APP_LOGI("VerifyActDataAbility valueSecond.GetType[%{public}d]]", valueSecond.GetType()); + if (valueFirst.compare("name") == 0) { + std::string val; + iEOK = valueSecond.GetString(val); + APP_LOGI("VerifyActDataAbility it iEOK[%{public}d]]", iEOK); + APP_LOGI("VerifyActDataAbility it[%{public}s],[%{public}s]", valueFirst.c_str(), val.c_str()); + if (val.compare("ActsDataAbilityHelperTest")) { + return returnError2; + break; + } + } else if (valueFirst.compare("age") == 0) { + double age; + iEOK = valueSecond.GetDouble(age); + APP_LOGI("VerifyActDataAbility it iEOK[%{public}d]", iEOK); + APP_LOGI("VerifyActDataAbility it[%{public}s],[%{public}f]", valueFirst.c_str(), age); + if (age != ageI) { + return returnError2; + break; + } + } else if (valueFirst.compare("salary") == 0) { + double salary; + iEOK = valueSecond.GetDouble(salary); + APP_LOGI("VerifyActDataAbility it iEOK[%{public}d]]", iEOK); + APP_LOGI("VerifyActDataAbility it[%{public}s],[%{public}f]", valueFirst.c_str(), salary); + if (salary != salaryI) { + return returnError2; + break; + } + } else { + APP_LOGI("VerifyActDataAbility it default[%{public}s]", valueFirst.c_str()); + break; + } + } + + int errCode = 0; + std::string dbDir = GetDatabaseDir(); + NativeRdb::RdbStoreConfig config(dbDir + "/" + DATABASE_FILE_NAME); + InsertTestOpenCallback helper; + testStore = NativeRdb::RdbHelper::GetRdbStore(config, 1, helper, errCode); + APP_LOGI("VerifyActDataAbility Insert Patch %{public}s", (dbDir + "/" + DATABASE_FILE_NAME).c_str()); + + if (testStore == nullptr) { + APP_LOGI("VerifyActDataAbility <<<>>> testStore is nullptr, data will be empty"); + return returnError3; + } + + int64_t id; + int insertError; + if ((insertError = testStore->Insert(id, "test", value)) != 0) { + APP_LOGE("VerifyActDataAbility <<<>>> store->Insert Error %{public}d", insertError); + return insertError; + } + return defaultReturn; } std::shared_ptr VerifyActDataAbility::Query( const Uri &uri, const std::vector &columns, const NativeRdb::DataAbilityPredicates &predicates) { + APP_LOGI("VerifyActDataAbility <<<>>>"); + std::shared_ptr dataUri = std::make_shared("dataability:///com.ix.VerifyActDataAbility"); + + APP_LOGI("VerifyActDataAbility Query uri.ToString = %{public}s", uri.ToString().c_str()); + APP_LOGI("VerifyActDataAbility Query dataUri.ToString = %{public}s", dataUri->ToString().c_str()); + APP_LOGI("VerifyActDataAbility uri.Equals = %{public}d", uri.Equals(*dataUri)); + if (uri.Equals(*dataUri) != 1) { + return nullptr; + } + int indexI = 0; + for (const auto &item : columns) { + switch (indexI++) { + case value1: + if (item.compare("value1") != 0) + return nullptr; + break; + case value2: + if (item.compare("value2") != 0) + return nullptr; + break; + case value3: + if (item.compare("value3") != 0) + return nullptr; + break; + case value4: + if (item.compare("value4") != 0) + return nullptr; + break; + default: + APP_LOGI("VerifyActDataAbility indexI = [%{public}d]]", indexI); + } + } + + APP_LOGI("VerifyActDataAbility Query predicates"); + APP_LOGI("VerifyActDataAbility Query predicates.Is = %{public}d", predicates.IsRawSelection()); + APP_LOGI("VerifyActDataAbility Query predicates.Get = %{public}d", predicates.GetJudgeSource()); + int errCode = 0; std::string dbDir = GetDatabaseDir(); 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()); - - int64_t id; - NativeRdb::ValuesBucket values; - int idValue = 1; - int age = 18; - double salary = 100.5; - - values.PutInt("id", idValue); - values.PutString("name", std::string("zhangsan")); - values.PutInt("age", age); - values.PutDouble("salary", salary); - values.PutBlob("blobType", std::vector {1, 2, 3}); + APP_LOGI("VerifyActDataAbility Query Patch %{public}s", (dbDir + "/" + DATABASE_FILE_NAME).c_str()); if (testStore == nullptr) { APP_LOGI("VerifyActDataAbility <<<>>> testStore is nullptr, data will be empty"); return nullptr; } - if (testStore->Replace(id, "test", values) != 0) { - APP_LOGE("VerifyActDataAbility <<<>>> store->Replace Error"); - return nullptr; - } - std::unique_ptr rresultSet = - testStore->QuerySql("SELECT * FROM test WHERE name = ?", std::vector {"zhangsan"}); + testStore->QuerySql("SELECT * FROM test WHERE name = ?" , + std::vector {"ActsDataAbilityHelperTest"}); if (rresultSet == nullptr) { APP_LOGE("VerifyActDataAbility <<<>>> rresultSet is nullptr"); return nullptr; } + APP_LOGE("VerifyActDataAbility <<<>>> ret(rresultSet.release()"); std::shared_ptr ret(rresultSet.release()); sharedList_.push_back(ret); return ret; @@ -107,30 +229,291 @@ int VerifyActDataAbility::Update( const Uri &uri, const NativeRdb::ValuesBucket &value, const NativeRdb::DataAbilityPredicates &predicates) { APP_LOGI("VerifyActDataAbility <<<>>>"); + std::shared_ptr dataUri = std::make_shared("dataability:///com.ix.VerifyActDataAbility"); + auto notify = DataAbilityHelper::Creator(GetContext(), dataUri); + if (notify == nullptr) { + APP_LOGE("VerifyActDataAbility <<<>>>"); + return returnError; + } + notify->NotifyChange(*dataUri); + + APP_LOGI("VerifyActDataAbility Update uri.ToString = %{public}s", uri.ToString().c_str()); + APP_LOGI("VerifyActDataAbility Update dataUri.ToString = %{public}s", dataUri->ToString().c_str()); + APP_LOGI("VerifyActDataAbility uri.Equals = %{public}d", uri.Equals(*dataUri)); + if (uri.Equals(*dataUri) != 1) { + return returnError1; + } + + defaultReturn = 1; + std::map valuesMap; + value.GetAll(valuesMap); + int valuesMapSize = valuesMap.size(); + APP_LOGI("VerifyActDataAbility value = %{public}d", valuesMapSize); + if (!valuesMapSize) + return returnError2; + for (auto item = valuesMap.begin(); item != valuesMap.end(); item++) { + auto valueFirst = item->first; + auto valueSecond = item->second; + APP_LOGI("VerifyActDataAbility valueSecond.GetType[%{public}d]]", valueSecond.GetType()); + if (valueFirst.compare("name") == 0) { + std::string val; + valueSecond.GetString(val); + APP_LOGI("VerifyActDataAbility it[%{public}s],[%{public}s]", valueFirst.c_str(), val.c_str()); + if (val.compare("ActsDataAbilityHelperTest")) { + return returnError2; + break; + } + } else if (valueFirst.compare("age") == 0) { + double age; + valueSecond.GetDouble(age); + APP_LOGI("VerifyActDataAbility it[%{public}s],[%{public}f]", valueFirst.c_str(), age); + if (age != ageI) { + return returnError2; + break; + } + } else if (valueFirst.compare("salary") == 0) { + double salary; + valueSecond.GetDouble(salary); + APP_LOGI("VerifyActDataAbility it[%{public}s],[%{public}f]", valueFirst.c_str(), salary); + if (salary != salaryI) { + return returnError2; + break; + } + } else { + APP_LOGI("VerifyActDataAbility it default[%{public}s]", valueFirst.c_str()); + break; + } + } + APP_LOGI("VerifyActDataAbility Update predicates = %{public}d", predicates.IsRawSelection()); + APP_LOGI("VerifyActDataAbility Update predicates.Get = %{public}d", predicates.GetJudgeSource()); + + int errCode = 0; + std::string dbDir = GetDatabaseDir(); + NativeRdb::RdbStoreConfig config(dbDir + "/" + DATABASE_FILE_NAME); + InsertTestOpenCallback helper; + testStore = NativeRdb::RdbHelper::GetRdbStore(config, 1, helper, errCode); + APP_LOGI("VerifyActDataAbility Update Patch %{public}s", (dbDir + "/" + DATABASE_FILE_NAME).c_str()); + + if (testStore == nullptr) { + APP_LOGI("VerifyActDataAbility <<<>>> testStore is nullptr, data will be empty"); + return returnError3; + } + + int changedRows; + int updatError; + if ((updatError = testStore->Update(changedRows, "test", value)) != 0) { + APP_LOGE("VerifyActDataAbility <<<>>> store->Replace changedRows %{public}d Error %{public}d", + changedRows, + updatError); + return updatError; + } return defaultReturn; } int VerifyActDataAbility::Delete(const Uri &uri, const NativeRdb::DataAbilityPredicates &predicates) { APP_LOGI("VerifyActDataAbility <<<>>>"); + std::shared_ptr dataUri = std::make_shared("dataability:///com.ix.VerifyActDataAbility"); + auto notify = DataAbilityHelper::Creator(GetContext(), dataUri); + if (notify == nullptr) { + APP_LOGE("VerifyActDataAbility <<<>>>"); + return returnError; + } + notify->NotifyChange(*dataUri); + + defaultReturn = 1; + APP_LOGI("VerifyActDataAbility Delete uri.ToString = %{public}s", uri.ToString().c_str()); + APP_LOGI("VerifyActDataAbility Delete dataUri.ToString = %{public}s", dataUri->ToString().c_str()); + APP_LOGI("VerifyActDataAbility uri.Equals is = %{public}d", uri.Equals(*dataUri)); + if (uri.Equals(*dataUri) != 1) { + return returnError; + } + APP_LOGI("VerifyActDataAbility Delete predicates.Is = %{public}d", predicates.IsRawSelection()); + APP_LOGI("VerifyActDataAbility Delete predicates.Get = %{public}d", predicates.GetJudgeSource()); + + int errCode = 0; + std::string dbDir = GetDatabaseDir(); + NativeRdb::RdbStoreConfig config(dbDir + "/" + DATABASE_FILE_NAME); + InsertTestOpenCallback helper; + testStore = NativeRdb::RdbHelper::GetRdbStore(config, 1, helper, errCode); + APP_LOGI("VerifyActDataAbility Delete Patch %{public}s", (dbDir + "/" + DATABASE_FILE_NAME).c_str()); + + if (testStore == nullptr) { + APP_LOGI("VerifyActDataAbility <<<>>> testStore is nullptr, data will be empty"); + return returnError3; + } + + int changedRows; + int deleteError; + if ((deleteError = testStore->Delete(changedRows, "test")) != 0) { + APP_LOGE("VerifyActDataAbility <<<>>> store->Delete changedRows %{public}d Error %{public}d", + changedRows, + deleteError); + return deleteError; + } return defaultReturn; } std::string VerifyActDataAbility::GetType(const Uri &uri) { APP_LOGI("VerifyActDataAbility <<<>>>"); + APP_LOGI("VerifyActDataAbility GetType uri = %{public}s", uri.ToString().c_str()); + std::shared_ptr dataUri = std::make_shared("dataability:///com.ix.VerifyActDataAbility3"); + APP_LOGI("VerifyActDataAbility GetType dataUri.ToString = %{public}s", dataUri->ToString().c_str()); + APP_LOGI("VerifyActDataAbility uri.Equals = %{public}d", uri.Equals(*dataUri)); + if (uri.Equals(*dataUri) == 1) { + return nullptr; + } std::string retval(uri.ToString()); return retval; } int VerifyActDataAbility::OpenFile(const Uri &uri, const std::string &mode) { APP_LOGI("VerifyActDataAbility <<<>>>"); - return 0; + std::shared_ptr dataUri = std::make_shared("dataability:///com.ix.VerifyActDataAbility"); + defaultReturn = 1; + APP_LOGI("VerifyActDataAbility Delete uri.ToString = %{public}s", uri.ToString().c_str()); + APP_LOGI("VerifyActDataAbility Delete dataUri.ToString = %{public}s", dataUri->ToString().c_str()); + APP_LOGI("VerifyActDataAbility uri.Equals = %{public}d", uri.Equals(*dataUri)); + if (uri.Equals(*dataUri) != 1) { + return returnError1; + } + APP_LOGI("VerifyActDataAbility OpenFile mode = %{public}s", mode.c_str()); + if (!(mode.compare("r") == 0 || mode.compare("w") == 0 || mode.compare("wt") == 0 || mode.compare("wa") == 0 || + mode.compare("rw") == 0 || mode.compare("rwt") == 0)) { + if (mode.compare("A1@k#4%$,.<>)(oioiu*((*&(&*giIGT^%&^Ug;sdfk;losd*7873iug8%&^$&%]ERFUy&^%&&R7") == 0) { + defaultReturn = returnError2; + } else + defaultReturn = returnError3; + } + APP_LOGI("VerifyActDataAbility OpenFile defaultReturn = %{public}d", defaultReturn); + return defaultReturn; } int VerifyActDataAbility::BatchInsert(const Uri &uri, const std::vector &values) { APP_LOGI("VerifyActDataAbility <<<>>>"); - return Ability::BatchInsert(uri, values); + std::shared_ptr dataUri = std::make_shared("dataability:///com.ix.VerifyActDataAbility"); + defaultReturn = 1; + APP_LOGI("VerifyActDataAbility BatchInsert uri.ToString = %{public}s", uri.ToString().c_str()); + APP_LOGI("VerifyActDataAbility BatchInsert dataUri.ToString = %{public}s", dataUri->ToString().c_str()); + APP_LOGI("VerifyActDataAbility uri.Equals = %{public}d", uri.Equals(*dataUri)); + if (uri.Equals(*dataUri) != 1) { + return returnError1; + } + + defaultReturn = 1; + std::map valuesMap; + for (auto it = values.begin(); it != values.end(); it++) { + it->GetAll(valuesMap); + int valuesMapSize = values.size(); + APP_LOGI("VerifyActDataAbility value = %{public}d", valuesMapSize); + if (!valuesMapSize) + return returnError2; + for (auto item = valuesMap.begin(); item != valuesMap.end(); item++) { + auto valueFirst = item->first; + auto valueSecond = item->second; + APP_LOGI("VerifyActDataAbility valueSecond.GetType[%{public}d]]", valueSecond.GetType()); + if (valueFirst.compare("name") == 0) { + std::string val; + valueSecond.GetString(val); + APP_LOGI("VerifyActDataAbility it[%{public}s],[%{public}s]", valueFirst.c_str(), val.c_str()); + if (val.compare("ActsDataAbilityHelperTest")) { + return returnError2; + break; + } + } else if (valueFirst.compare("age") == 0) { + double age; + valueSecond.GetDouble(age); + APP_LOGI("VerifyActDataAbility it[%{public}s],[%{public}f]", valueFirst.c_str(), age); + if (age != ageI) { + return returnError2; + break; + } + } else if (valueFirst.compare("salary") == 0) { + double salary; + valueSecond.GetDouble(salary); + APP_LOGI("VerifyActDataAbility it[%{public}s],[%{public}f]", valueFirst.c_str(), salary); + if (salary != salaryI) { + return returnError2; + break; + } + } else { + APP_LOGI("VerifyActDataAbility it default[%{public}s]", valueFirst.c_str()); + break; + } + } + } + + int retAbilityBatchInsert = Ability::BatchInsert(uri, values); + APP_LOGI("VerifyActDataAbility BatchInsert retAbility = %{public}d", retAbilityBatchInsert); + return retAbilityBatchInsert; +} +std::vector VerifyActDataAbility::GetFileTypes(const Uri &uri, const std::string &mimeTypeFilter) +{ + APP_LOGI("VerifyActDataAbility <<<>>>"); + std::shared_ptr dataUri = std::make_shared("dataability:///com.ix.VerifyActDataAbility"); + defaultReturn = 1; + APP_LOGI("VerifyActDataAbility Delete uri.ToString = %{public}s", uri.ToString().c_str()); + APP_LOGI("VerifyActDataAbility Delete dataUri.ToString = %{public}s", dataUri->ToString().c_str()); + APP_LOGI("VerifyActDataAbility uri.Equals = %{public}d", uri.Equals(*dataUri)); + std::vector vectorFileTypes; + if (uri.Equals(*dataUri) != 1) { + APP_LOGE("VerifyActDataAbility uri.Equals(*dataUri) != 1"); + vectorFileTypes.push_back("Uri error"); + return vectorFileTypes; + } + + if (mimeTypeFilter.compare("*/*") == 0) { + vectorFileTypes.push_back("hap"); + vectorFileTypes.push_back("jpg"); + vectorFileTypes.push_back("image/png"); + } else if (mimeTypeFilter.compare("image/*") == 0) { + vectorFileTypes.push_back("image/png"); + } else if (mimeTypeFilter.compare("*/jpg") == 0) { + vectorFileTypes.push_back("jpg"); + } else if (mimeTypeFilter.compare("returnUndefined") == 0) { + return {}; + } + + return vectorFileTypes; } +Uri VerifyActDataAbility::NormalizeUri(const Uri &uri) +{ + APP_LOGI("VerifyActDataAbility <<<>>>"); + APP_LOGI("VerifyActDataAbility NormalizeUri uri = %{public}s", uri.ToString().c_str()); + std::shared_ptr dataUri = std::make_shared("dataability:///com.ix.VerifyActDataAbility"); + std::shared_ptr dataUri3 = std::make_shared("dataability:///com.ix.VerifyActDataAbility3"); + Uri dataUriNull(""); + Uri dataUriError("errorUri"); + APP_LOGI("VerifyActDataAbility NormalizeUri dataUri.ToString = %{public}s", dataUri->ToString().c_str()); + APP_LOGI("VerifyActDataAbility uri.Equals = %{public}d", uri.Equals(*dataUri)); + if (uri.Equals(*dataUri) != 1) { + if (uri.Equals(*dataUri3) == 1) { + return dataUriNull; + } + return dataUriError; + } + return uri; +} + +Uri VerifyActDataAbility::DenormalizeUri(const Uri &uri) +{ + APP_LOGI("VerifyActDataAbility <<<>>>"); + APP_LOGI("VerifyActDataAbility DenormalizeUri uri = %{public}s", uri.ToString().c_str()); + std::shared_ptr dataUri = std::make_shared("dataability:///com.ix.VerifyActDataAbility"); + std::shared_ptr dataUri3 = std::make_shared("dataability:///com.ix.VerifyActDataAbility3"); + Uri dataUriNull(""); + Uri dataUriError("errorUri"); + APP_LOGI("VerifyActDataAbility DenormalizeUri dataUri.ToString = %{public}s", dataUri->ToString().c_str()); + APP_LOGI("VerifyActDataAbility uri.Equals = %{public}d", uri.Equals(*dataUri)); + + if (uri.Equals(*dataUri) != 1) { + if (uri.Equals(*dataUri3) == 1) { + return dataUriNull; + } + return dataUriError; + } + return uri; +} REGISTER_AA(VerifyActDataAbility); } // namespace AppExecFwk } // namespace OHOS diff --git a/zidl/bundle.json b/zidl/bundle.json deleted file mode 100644 index 5127a051270..00000000000 --- a/zidl/bundle.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@ohos/zidl", - "description": "提供自动生成Extension 服务端及客户端接口文件的能力", - "version": "3.1", - "license": "Apache License 2.0", - "publishAs": "code-segment", - "segment": { - "destPath": "foundation/aafwk/standard/zidl" - }, - "dirs": {}, - "scripts": {}, - "component": { - "name": "zidl", - "subsystem": "aafwk", - "syscap": [], - "features": [], - "adapted_system_type": [ - "standard" - ], - "rom": "", - "ram": "", - "deps": { - "components": [ - "hiviewdfx_hilog_native", - "ipc", - "samgr_standard", - "utils_base" - ], - "third_party": [] - }, - "build": { - "sub_component": [], - "inner_kits": [], - "test": [] - } - } -} \ No newline at end of file diff --git a/zidl/test/native/BUILD.gn b/zidl/test/native/BUILD.gn deleted file mode 100644 index 8dc9839a534..00000000000 --- a/zidl/test/native/BUILD.gn +++ /dev/null @@ -1,69 +0,0 @@ -# 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. - -import("//build/ohos.gni") - -IPC_SUBSYSTEM_DIR = "//foundation/communication/ipc" -ZIDL_TEST_DIR = "//foundation/aafwk/standard/zidl/test/native" - -config("ipc_test_config") { - include_dirs = [ - "//utils/native/base/include", - "$ZIDL_TEST_DIR/include", - "$IPC_SUBSYSTEM_DIR/utils/include", - "$IPC_SUBSYSTEM_DIR/ipc/native/src/mock/include", - "//utils/system/safwk/native/include", - ] -} - -ohos_executable("zidl_server_test") { - sources = [ - "./src/main_server.cpp", - "./src/test_service.cpp", - "./src/zidl_test_service_stub.cpp", - ] - - configs = [ ":ipc_test_config" ] - - deps = [ "//utils/native/base:utils" ] - - external_deps = [ - "hiviewdfx_hilog_native:libhilog", - "ipc:ipc_core", - "samgr_standard:samgr_proxy", - ] - - subsystem_name = "aafwk" - part_name = "zidl" -} - -ohos_executable("zidl_client_test") { - sources = [ - "./src/main_client.cpp", - "./src/test_client.cpp", - "./src/zidl_test_service_proxy.cpp", - ] - - configs = [ ":ipc_test_config" ] - - deps = [ "//utils/native/base:utils" ] - - external_deps = [ - "hiviewdfx_hilog_native:libhilog", - "ipc:ipc_core", - "samgr_standard:samgr_proxy", - ] - - subsystem_name = "aafwk" - part_name = "zidl" -} diff --git a/zidl/test/native/include/izidl_test_service.h b/zidl/test/native/include/izidl_test_service.h deleted file mode 100644 index 3f6308363a8..00000000000 --- a/zidl/test/native/include/izidl_test_service.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_IZIDLTESTSERVICE_H -#define OHOS_IZIDLTESTSERVICE_H - -#include -#include - -namespace OHOS { -class IZidlTestService : public IRemoteBroker { -public: - DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.IZidlTestService"); - - virtual ErrCode TestIntTransaction( - /* [in] */ int _data, - /* [out] */ int& result) = 0; - - virtual ErrCode TestStringTransaction( - /* [in] */ const std::string& _data) = 0; -}; -} // namespace OHOS -#endif // OHOS_IZIDLTESTSERVICE_H - diff --git a/zidl/test/native/include/test_client.h b/zidl/test/native/include/test_client.h deleted file mode 100644 index 4d54213003b..00000000000 --- a/zidl/test/native/include/test_client.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_IPC_TEST_SERVICE_CLIENT_H -#define OHOS_IPC_TEST_SERVICE_CLIENT_H - -#include "ipc_debug.h" -#include "log_tags.h" -#include "zidl_test_service_proxy.h" - -namespace OHOS { -class TestClient { -public: - int ConnectService(); - void StartIntTransaction(); - void StartStringTransaction(); -private: - static constexpr HiviewDFX::HiLogLabel LABEL = { LOG_CORE, LOG_ID_IPC, "TestClient" }; - sptr testService_; -}; -} // namespace OHOS -#endif // OHOS_IPC_TEST_SERVICE_CLIENT_H diff --git a/zidl/test/native/include/test_service.h b/zidl/test/native/include/test_service.h deleted file mode 100644 index 2c29658c761..00000000000 --- a/zidl/test/native/include/test_service.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_IPC_TEST_SERVICE_H -#define OHOS_IPC_TEST_SERVICE_H - -#include "hilog/log.h" -#include "log_tags.h" -#include "zidl_test_service_stub.h" - -namespace OHOS { -class TestService : public ZidlTestServiceStub { -public: - TestService(); - ~TestService(); - static int Instantiate(); - ErrCode TestIntTransaction(int data, int &rep) override; - ErrCode TestStringTransaction(const std::string& data) override; -private: - static constexpr HiviewDFX::HiLogLabel LABEL = { LOG_CORE, LOG_ID_IPC, "TestService" }; -}; -} // namespace OHOS -#endif // OHOS_IPC_TEST_SERVICE_H - diff --git a/zidl/test/native/include/zidl_test_service_proxy.h b/zidl/test/native/include/zidl_test_service_proxy.h deleted file mode 100644 index 56a6dcef68c..00000000000 --- a/zidl/test/native/include/zidl_test_service_proxy.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_ZIDLTESTSERVICEPROXY_H -#define OHOS_ZIDLTESTSERVICEPROXY_H - -#include - -#include "izidl_test_service.h" - -namespace OHOS { -class ZidlTestServiceProxy : public IRemoteProxy { -public: - explicit ZidlTestServiceProxy( - /* [in] */ const sptr& remote) - : IRemoteProxy(remote) - {} - - virtual ~ZidlTestServiceProxy() - {} - - ErrCode TestIntTransaction( - /* [in] */ int _data, - /* [out] */ int& result) override; - - ErrCode TestStringTransaction( - /* [in] */ const std::string& _data) override; - -private: - static constexpr int COMMAND_TEST_INT_TRANSACTION = MIN_TRANSACTION_ID + 0; - static constexpr int COMMAND_TEST_STRING_TRANSACTION = MIN_TRANSACTION_ID + 1; - - static inline BrokerDelegator delegator_; -}; -} // namespace OHOS -#endif // OHOS_ZIDLTESTSERVICEPROXY_H - diff --git a/zidl/test/native/include/zidl_test_service_stub.h b/zidl/test/native/include/zidl_test_service_stub.h deleted file mode 100644 index eed5cd8875a..00000000000 --- a/zidl/test/native/include/zidl_test_service_stub.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef OHOS_ZIDLTESTSERVICESTUB_H -#define OHOS_ZIDLTESTSERVICESTUB_H - -#include - -#include "izidl_test_service.h" - -namespace OHOS { -class ZidlTestServiceStub : public IRemoteStub { -public: - int OnRemoteRequest( - /* [in] */ uint32_t code, - /* [in] */ MessageParcel& data, - /* [out] */ MessageParcel& reply, - /* [in] */ MessageOption& option) override; - -private: - static constexpr int COMMAND_TEST_INT_TRANSACTION = MIN_TRANSACTION_ID + 0; - static constexpr int COMMAND_TEST_STRING_TRANSACTION = MIN_TRANSACTION_ID + 1; -}; -} // namespace OHOS -#endif // OHOS_ZIDLTESTSERVICESTUB_H - diff --git a/zidl/test/native/src/main_client.cpp b/zidl/test/native/src/main_client.cpp deleted file mode 100644 index 7238b197b76..00000000000 --- a/zidl/test/native/src/main_client.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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. - */ - -#include -#include - -#include "ipc_debug.h" -#include "ipc_skeleton.h" -#include "log_tags.h" -#include "test_client.h" - -using namespace OHOS; -using namespace OHOS::HiviewDFX; -static constexpr HiLogLabel LABEL = { LOG_CORE, LOG_ID_IPC, "IPCTestClient" }; - -enum TestCommand { - TEST_CMD_NONE = 0, - TEST_CMD_INT_TRANS = 1, - TEST_CMD_STRING_TRANS = 2 -}; - -namespace { -std::vector GetArgvOptions(int argc, char **argv) -{ - std::vector argvOptions; - for (int i = 1; i < argc; i++) { - argvOptions.emplace_back(std::string(argv[i])); - } - return argvOptions; -} -} - -int main(int argc, char *argv[]) -{ - TestCommand commandId = TestCommand::TEST_CMD_INT_TRANS; - if (argc > 1) { - commandId = TestCommand(atoi(argv[1])); - } else { - ZLOGE(LABEL, "unknown command"); - } - std::vector argvOptions; - argvOptions = GetArgvOptions(argc, argv); - std::unique_ptr testClient = std::make_unique(); - if (testClient->ConnectService()) { - return -1; - } - - ZLOGE(LABEL, "commandId= : %{public}d", commandId); - switch (commandId) { - case TestCommand::TEST_CMD_INT_TRANS: - testClient->StartIntTransaction(); - break; - case TestCommand::TEST_CMD_STRING_TRANS: - testClient->StartStringTransaction(); - break; - default: - ZLOGI(LABEL, "main arg error"); - break; - } - - IPCSkeleton::JoinWorkThread(); - return 0; -} diff --git a/zidl/test/native/src/main_server.cpp b/zidl/test/native/src/main_server.cpp deleted file mode 100644 index 0765721662f..00000000000 --- a/zidl/test/native/src/main_server.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ - -#include "ipc_debug.h" -#include "ipc_skeleton.h" -#include "log_tags.h" -#include "test_service.h" - -using namespace OHOS; -using namespace OHOS::HiviewDFX; - -[[maybe_unused]]static constexpr HiLogLabel LABEL = { LOG_CORE, LOG_ID_IPC, "IPCTestServer" }; - -int main(int argc __attribute__((unused)), char **argv __attribute__((unused))) -{ - TestService::Instantiate(); - ZLOGI(LABEL, "call StartThreadPool"); - IPCSkeleton::JoinWorkThread(); -} diff --git a/zidl/test/native/src/test_client.cpp b/zidl/test/native/src/test_client.cpp deleted file mode 100644 index b2e7abd8e58..00000000000 --- a/zidl/test/native/src/test_client.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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. - */ - -#include "test_client.h" - -#include "if_system_ability_manager.h" -#include "ipc_debug.h" -#include "ipc_skeleton.h" -#include "iservice_registry.h" -#include "system_ability_definition.h" - -namespace OHOS { -int TestClient::ConnectService() -{ - auto saMgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); - if (saMgr == nullptr) { - ZLOGE(LABEL, "get registry fail"); - return -1; - } - - sptr object = saMgr->GetSystemAbility(IPC_TEST_SERVICE); - - if (object != nullptr) { - ZLOGE(LABEL, "Got test Service object"); - testService_ = (new (std::nothrow) ZidlTestServiceProxy(object)); - } - - if (testService_ == nullptr) { - ZLOGE(LABEL, "Could not find Test Service!"); - return -1; - } - - return 0; -} - -void TestClient::StartIntTransaction() -{ - if (testService_ != nullptr) { - ZLOGE(LABEL, "StartIntTransaction"); - [[maybe_unused]] int result = 0; - testService_->TestIntTransaction(1234, result); // 1234 : test number - ZLOGE(LABEL, "Rec result from server %{public}d.", result); - } -} - -void TestClient::StartStringTransaction() -{ - if (testService_ != nullptr) { - ZLOGI(LABEL, "StartIntTransaction"); - testService_->TestStringTransaction("ZIDL Test"); - } -} -} // namespace OHOS diff --git a/zidl/test/native/src/test_service.cpp b/zidl/test/native/src/test_service.cpp deleted file mode 100644 index acf2f6346c1..00000000000 --- a/zidl/test/native/src/test_service.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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. - */ - -#include "test_service.h" - -#include - -#include "if_system_ability_manager.h" -#include "ipc_debug.h" -#include "ipc_skeleton.h" -#include "iservice_registry.h" -#include "system_ability_definition.h" - -namespace OHOS { -using namespace OHOS::HiviewDFX; - -int TestService::Instantiate() -{ - ZLOGI(LABEL, "%{public}s call in", __func__); - auto saMgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); - if (saMgr == nullptr) { - ZLOGE(LABEL, "%{public}s:fail to get Registry", __func__); - return -ENODEV; - } - - sptr newInstance = new TestService(); - int result = saMgr->AddSystemAbility(IPC_TEST_SERVICE, newInstance); - ZLOGI(LABEL, "%{public}s: IPC_TEST_SERVICE result = %{public}d", __func__, result); - return result; -} - -TestService::TestService() -{ -} - -TestService::~TestService() -{ -} - -ErrCode TestService::TestIntTransaction(int data, int &rep) -{ - ZLOGE(LABEL, " TestService:read from client data = %{public}d", data); - rep = data + data; - return ERR_NONE; -} - -ErrCode TestService::TestStringTransaction(const std::string &data) -{ - ZLOGE(LABEL, "TestService:read string from client data = %{public}s", data.c_str()); - return data.size(); -} -} // namespace OHOS diff --git a/zidl/test/native/src/zidl_test_service_proxy.cpp b/zidl/test/native/src/zidl_test_service_proxy.cpp deleted file mode 100644 index 314cadb6a24..00000000000 --- a/zidl/test/native/src/zidl_test_service_proxy.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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. - */ - -#include "zidl_test_service_proxy.h" - -namespace OHOS { -ErrCode ZidlTestServiceProxy::TestIntTransaction( - /* [in] */ int _data, - /* [out] */ int& result) -{ - MessageParcel data; - MessageParcel reply; - MessageOption option(MessageOption::TF_SYNC); - - data.WriteInt32(_data); - - int32_t st = Remote()->SendRequest(COMMAND_TEST_INT_TRANSACTION, data, reply, option); - if (st != ERR_NONE) { - return st; - } - - ErrCode ec = reply.ReadInt32(); - if (FAILED(ec)) { - return ec; - } - - result = reply.ReadInt32(); - return ERR_OK; -} - -ErrCode ZidlTestServiceProxy::TestStringTransaction( - /* [in] */ const std::string& _data) -{ - MessageParcel data; - MessageParcel reply; - MessageOption option(MessageOption::TF_SYNC); - - data.WriteString16(Str8ToStr16(_data)); - - int32_t st = Remote()->SendRequest(COMMAND_TEST_STRING_TRANSACTION, data, reply, option); - if (st != ERR_NONE) { - return st; - } - - ErrCode ec = reply.ReadInt32(); - if (FAILED(ec)) { - return ec; - } - - return ERR_OK; -} -} // namespace OHOS diff --git a/zidl/test/native/src/zidl_test_service_stub.cpp b/zidl/test/native/src/zidl_test_service_stub.cpp deleted file mode 100644 index adf63cd1dec..00000000000 --- a/zidl/test/native/src/zidl_test_service_stub.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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. - */ - -#include "zidl_test_service_stub.h" - -namespace OHOS { -int ZidlTestServiceStub::OnRemoteRequest( - /* [in] */ uint32_t code, - /* [in] */ MessageParcel& data, - /* [out] */ MessageParcel& reply, - /* [in] */ MessageOption& option) -{ - switch (code) { - case COMMAND_TEST_INT_TRANSACTION: { - int _data = data.ReadInt32(); - int result; - ErrCode ec = TestIntTransaction(_data, result); - reply.WriteInt32(ec); - if (SUCCEEDED(ec)) { - reply.WriteInt32(result); - } - return ERR_NONE; - } - case COMMAND_TEST_STRING_TRANSACTION: { - std::string _data = Str16ToStr8(data.ReadString16()); - ErrCode ec = TestStringTransaction(_data); - reply.WriteInt32(ec); - return ERR_NONE; - } - default: - return IPCObjectStub::OnRemoteRequest(code, data, reply, option); - } - - return ERR_TRANSACTION_FAILED; -} -} // namespace OHOS diff --git a/zidl/test/zidlgen/IZidlTestService.zidl b/zidl/test/zidlgen/IZidlTestService.zidl deleted file mode 100644 index 8d2fa0b91c5..00000000000 --- a/zidl/test/zidlgen/IZidlTestService.zidl +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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. - */ - -interface OHOS.IZidlTestService { - int TestIntTransaction([in] int data); - void TestStringTransaction([in] String data); -} \ No newline at end of file diff --git a/zidl/test/zidlgen/zidl b/zidl/test/zidlgen/zidl deleted file mode 100644 index c3bde7295221617c5bdc4e7a695702a580ac0c22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 216360 zcmeFa34ByV);?Sb0Ru*D6&;k!cnOOELP$b@u!s#wkU)S)0wRl@Ch3rdPSSRFASh~N zP*G7MqB4pamr+zkqoSfB#u*oMP&2N`fD?Db=)@fz)bFXPQ{DGg_f0@?-uM6g-U}zE z`>AtJovJ!@YPm~akY6}4J}!=_qYE3y_&4JMi8(1Dbz&DK!kjFJ9ge@rtT*chGy&wK zRGnAG%LK&}Nsepd=WU>LohOr=;>tqK`FVCn&l)MIICDrzj&=nZl&;FBcuTW9PjT~k zyo~KbW%=8uTX|zosb6vZyoNj}-w@KcJdHKUY?(TbR|n6p)G6glORc~t6q!lAM)qVw)Zk%-O{lB9f?%dhNooX71v*n`{1=^1KwojXaP;;OBO`n(H9 zWDoU~5Ak`cYwL#8<%}3IB0D`;lb$8?@n+^FIBnWYp@G*LWf4y27*BVe(LME{As@8d z_+}_`#hBqCae~dC(|{inBdr3M5d*)_2EWM$e-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