diff --git a/BUILD.gn b/BUILD.gn index facec1bc370ef2fbb9ec64152597e81cd8bf8cab..26eabbc0aeafa7a316a07fe7e6a47e736bfc3906 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -90,6 +90,7 @@ group("multimodalinput_mmi_frameworks") { group("multimodalinput_mmi_service") { deps = [ + "service:libmmi-knuckle", "service:libmmi-server", "tools/inject_event:uinput", "util/screen_capture:libmmi-screen_capture", @@ -196,7 +197,9 @@ group("mmi_tests") { "service:KeyUnicodeTransformationTest", "service:KeymapMgrTest", "service:KnuckleDivergentPointTest", + "service:KnuckleDrawingComponentTest", "service:KnuckleDrawingManagerTest", + "service:KnuckleDrawingTest", "service:KnuckleDynamicDrawingManagerTest", "service:KnuckleGlowPointTest", "service:KnuckleGlowTraceSystemTest", diff --git a/bundle.json b/bundle.json index 3666eb91fc837fa99bec01b4af4b69eb12fff1db..76b631e3aacac78693100e15d3fb3fa97b8c651c 100644 --- a/bundle.json +++ b/bundle.json @@ -103,7 +103,9 @@ "sensor", "idl_tool", "runtime_core", - "drivers_interface_rtos_extra" + "drivers_interface_rtos_extra", + "libinput", + "skia" ], "third_party": [ "libuv", diff --git a/service/BUILD.gn b/service/BUILD.gn index b65980baaf85c901318e3d8532d58447eae1bd22..ac527eceaaf24eaacf36a8c384443d27362d61e8 100644 --- a/service/BUILD.gn +++ b/service/BUILD.gn @@ -300,9 +300,7 @@ ohos_shared_library("libmmi-server") { deps += [ "${mmi_path}/common/anco/comm:mmi_anco_channel_proxy" ] if (input_ext_feature_keyboard_ext_flag) { - include_dirs += [ - "${mmi_ext_path}/keyboard_ext_flag/inc", - ] + include_dirs += [ "${mmi_ext_path}/keyboard_ext_flag/inc" ] deps += [ ":keyboard_ext_flag.json" ] } @@ -383,13 +381,7 @@ ohos_shared_library("libmmi-server") { ] if (input_feature_product != "watch") { - sources += [ - "window_manager/src/knuckle_divergent_point.cpp", - "window_manager/src/knuckle_drawing_manager.cpp", - "window_manager/src/knuckle_dynamic_drawing_manager.cpp", - "window_manager/src/knuckle_glow_point.cpp", - "window_manager/src/knuckle_glow_trace_system.cpp", - ] + sources += [ "window_manager/src/knuckle_drawing_component.cpp" ] deps += [ "${mmi_path}/etc/mouse_icon:input_mouse_icon" ] @@ -440,6 +432,97 @@ ohos_shared_library("libmmi-server") { subsystem_name = "multimodalinput" } +config("libmmi_knuckle_config") { + if (is_ohos && is_clang && (target_cpu == "arm" || target_cpu == "arm64") && + enhanced_opt) { + cflags = [] + if (input_feature_enable_pgo && input_feature_product != "default") { + cflags += [ + "-fprofile-use=" + + rebase_path("${input_feature_pgo_path}/libmmi-server.profdata", + root_build_dir), + "-Wno-error=backend-plugin", + "-Wno-profile-instr-out-of-date", + "-Wno-profile-instr-unprofiled", + "-Oz", + ] + } + if (input_feature_product == "pc" && target_cpu == "arm64") { + cflags += [ + "-moutline-atomics", + "-Oz", + ] + } + } +} + +ohos_shared_library("libmmi-knuckle") { + include_dirs = [ + "${mmi_path}/interfaces/native/innerkits/proxy/include", + "${mmi_service_path}/window_manager/include", + "${mmi_path}/service/touch_event_normalize/include", + "${mmi_path}/service/delegate_task/include", + "${mmi_path}/service/event_handler/include", + "${mmi_path}/service/module_loader/include", + "${mmi_path}/util/common/include", + "${mmi_path}/service/connect_manager/include", + "${mmi_path}/service/key_command/include", + "${mmi_path}/service/timer_manager/include", + ] + + if (input_ext_feature_anco) { + include_dirs += [ "${mmi_path}/common/anco/comm/include" ] + } + + sources = [ + "window_manager/src/knuckle_divergent_point.cpp", + "window_manager/src/knuckle_drawing.cpp", + "window_manager/src/knuckle_drawing_manager.cpp", + "window_manager/src/knuckle_dynamic_drawing_manager.cpp", + "window_manager/src/knuckle_glow_point.cpp", + "window_manager/src/knuckle_glow_trace_system.cpp", + ] + + configs = [ + "${mmi_path}:coverage_flags", + ":libmmi_knuckle_config", + "${mmi_path}/service/filter:mmi_event_filter_config", + "${mmi_path}/service/connect_manager:mmi_connect_manager_config", + "${mmi_path}/common/anco/comm:mmi_anco_channel_config", + ] + + if (defined(use_rosen_drawing) && use_rosen_drawing) { + defines += [ "USE_ROSEN_DRAWING" ] + } + + deps = [ + "${mmi_path}/service:libmmi-server", + "${mmi_path}/util:libmmi-util", + ] + + external_deps = [ + "data_share:datashare_consumer", + "graphic_2d:librender_service_base", + "graphic_2d:librender_service_client", + "libinput:libinput-third-mmi", + "skia:skia_canvaskit", + ] + + if (input_feature_pointer_drawing) { + external_deps += [ "window_manager:libwm_lite" ] + } + + branch_protector_ret = "pac_ret" + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + + part_name = "input" + subsystem_name = "multimodalinput" +} + import("//build/test.gni") module_output_path = "input/input" @@ -881,7 +964,7 @@ ohos_unittest("KnuckleGlowPointTest") { sources = [ "window_manager/test/knuckle_glow_point_test.cpp" ] deps = [ - "${mmi_path}/service:libmmi-server", + "${mmi_path}/service:libmmi-knuckle", "${mmi_path}/test/facility/mock:mmi_mock_sources", "${mmi_path}/util:libmmi-util", ] @@ -932,7 +1015,7 @@ ohos_unittest("KnuckleDivergentPointTest") { sources = [ "window_manager/test/knuckle_divergent_point_test.cpp" ] deps = [ - "${mmi_path}/service:libmmi-server", + "${mmi_path}/service:libmmi-knuckle", "${mmi_path}/test/facility/mock:mmi_mock_sources", "${mmi_path}/util:libmmi-util", ] @@ -982,7 +1065,7 @@ ohos_unittest("KnuckleGlowTraceSystemTest") { sources = [ "window_manager/test/knuckle_glow_trace_system_test.cpp" ] deps = [ - "${mmi_path}/service:libmmi-server", + "${mmi_path}/service:libmmi-knuckle", "${mmi_path}/test/facility/mock:mmi_mock_sources", "${mmi_path}/util:libmmi-util", ] @@ -1060,10 +1143,10 @@ ohos_unittest("PointerDrawingManagerTest") { "init:libbegetutil", "ipc:ipc_core", "libinput:libinput-third-mmi", + "preferences:native_preferences", "window_manager:libdm_lite", "window_manager:libwm", "window_manager:libwsutils", - "preferences:native_preferences", ] } @@ -1117,10 +1200,10 @@ ohos_unittest("PointerDrawingManagerExTest") { "init:libbegetutil", "ipc:ipc_core", "libinput:libinput-third-mmi", + "preferences:native_preferences", "window_manager:libdm_lite", "window_manager:libwm", "window_manager:libwsutils", - "preferences:native_preferences", ] } @@ -1254,7 +1337,7 @@ ohos_unittest("KnuckleDrawingManagerTest") { sources = [ "window_manager/test/knuckle_drawing_manager_test.cpp" ] deps = [ - "${mmi_path}/service:libmmi-server", + "${mmi_path}/service:libmmi-knuckle", "${mmi_path}/util:libmmi-util", ] @@ -1300,7 +1383,7 @@ ohos_unittest("KnuckleDynamicDrawingManagerTest") { sources = [ "window_manager/test/knuckle_dynamic_drawing_manager_test.cpp" ] deps = [ - "${mmi_path}/service:libmmi-server", + "${mmi_path}/service:libmmi-knuckle", "${mmi_path}/util:libmmi-util", ] @@ -3039,8 +3122,8 @@ ohos_unittest("JoystickTest") { "hilog:libhilog_base", "hisysevent:libhisysevent", "init:libbegetutil", - "libinput:libinput-third-mmi", "ipc:ipc_core", + "libinput:libinput-third-mmi", ] } @@ -3098,6 +3181,98 @@ ohos_unittest("KeymapMgrTest") { ] } +ohos_unittest("KnuckleDrawingComponentTest") { + module_out_path = module_output_path + + include_dirs = [ + "${mmi_path}/interfaces/native/innerkits/proxy/include", + "${mmi_path}/interfaces/native/innerkits/event/include", + "${mmi_service_path}/window_manager/include", + "${mmi_path}/service/touch_event_normalize/include", + "${mmi_path}/service/delegate_task/include", + "${mmi_path}/service/event_handler/include", + "${mmi_path}/service/module_loader/include", + "${mmi_path}/util/common/include", + "${mmi_path}/service/connect_manager/include", + "${mmi_path}/service/key_command/include", + "${mmi_path}/service/timer_manager/include", + ] + + configs = [ "${mmi_path}:coverage_flags" ] + + cflags = [ + "-Dprivate=public", + "-Dprotected=public", + ] + + branch_protector_ret = "pac_ret" + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "./ipc_blocklist.txt" + } + + sources = [ "window_manager/test/knuckle_drawing_component_test.cpp" ] + + deps = [ "${mmi_path}/service:libmmi-server" ] + + external_deps = [ + "c_utils:utils", + "googletest:gmock_main", + "googletest:gtest_main", + "graphic_2d:librender_service_client", + "hilog:libhilog", + ] +} + +ohos_unittest("KnuckleDrawingTest") { + module_out_path = module_output_path + + include_dirs = [ + "${mmi_path}/interfaces/native/innerkits/proxy/include", + "${mmi_path}/interfaces/native/innerkits/event/include", + "${mmi_service_path}/window_manager/include", + "${mmi_path}/service/touch_event_normalize/include", + "${mmi_path}/service/delegate_task/include", + "${mmi_path}/service/event_handler/include", + "${mmi_path}/service/module_loader/include", + "${mmi_path}/util/common/include", + "${mmi_path}/service/connect_manager/include", + "${mmi_path}/service/key_command/include", + "${mmi_path}/service/timer_manager/include", + ] + + configs = [ "${mmi_path}:coverage_flags" ] + + cflags = [ + "-Dprivate=public", + "-Dprotected=public", + ] + + branch_protector_ret = "pac_ret" + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + blocklist = "./ipc_blocklist.txt" + } + + sources = [ "window_manager/test/knuckle_drawing_test.cpp" ] + + deps = [ + "${mmi_path}/service:libmmi-knuckle", + "${mmi_path}/service:libmmi-server", + ] + + external_deps = [ + "c_utils:utils", + "googletest:gtest_main", + "graphic_2d:librender_service_client", + "hilog:libhilog", + ] +} + group("mmi-service-tests") { testonly = true deps = [ "libinput_adapter/test" ] diff --git a/service/module_loader/include/mmi_service.h b/service/module_loader/include/mmi_service.h index 05c355fcec2609a4e62cf7c05d62366c8ba19399..3f5512b065feacb58a92efa16d05fd05635fff35 100644 --- a/service/module_loader/include/mmi_service.h +++ b/service/module_loader/include/mmi_service.h @@ -23,7 +23,7 @@ #include "cJSON.h" #include "input_event_handler.h" #ifndef OHOS_BUILD_ENABLE_WATCH -#include "knuckle_drawing_manager.h" +#include "knuckle_drawing_component.h" #endif // OHOS_BUILD_ENABLE_WATCH #include "libinput_adapter.h" #include "multimodal_input_connect_stub.h" @@ -386,9 +386,6 @@ private: #ifdef OHOS_BUILD_ENABLE_VKEYBOARD std::atomic_bool isHPR_ { false }; #endif // OHOS_BUILD_ENABLE_VKEYBOARD -#ifndef OHOS_BUILD_ENABLE_WATCH - std::shared_ptr knuckleDrawMgr_ { nullptr }; -#endif // OHOS_BUILD_ENABLE_WATCH }; } // namespace MMI } // namespace OHOS diff --git a/service/module_loader/src/mmi_service.cpp b/service/module_loader/src/mmi_service.cpp index e096351576dc456776f27d2bfe2842cbd0265835..83f3da68b085e4cdd63df04e1dbcaeabdf7663be 100644 --- a/service/module_loader/src/mmi_service.cpp +++ b/service/module_loader/src/mmi_service.cpp @@ -4941,11 +4941,7 @@ int32_t MMIService::SetMultiWindowScreenIdInner(uint64_t screenId, uint64_t disp TOUCH_DRAWING_MGR->SetMultiWindowScreenId(screenId, displayNodeScreenId); #endif // OHOS_BUILD_ENABLE_TOUCH_DRAWING #ifndef OHOS_BUILD_ENABLE_WATCH - if (knuckleDrawMgr_ == nullptr) { - knuckleDrawMgr_ = std::make_shared(); - } - CHKPR(knuckleDrawMgr_, RET_ERR); - knuckleDrawMgr_->SetMultiWindowScreenId(screenId, displayNodeScreenId); + KnuckleDrawingComponent::GetInstance().SetMultiWindowScreenId(screenId, displayNodeScreenId); #endif // OHOS_BUILD_ENABLE_WATCH return RET_OK; } diff --git a/service/window_manager/include/i_knuckle_drawing.h b/service/window_manager/include/i_knuckle_drawing.h new file mode 100644 index 0000000000000000000000000000000000000000..9913575eb7b09a091c5657555782819a9d581b5b --- /dev/null +++ b/service/window_manager/include/i_knuckle_drawing.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * 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 I_KNUCKLE_DRAWING_H +#define I_KNUCKLE_DRAWING_H + +#include "window_info.h" +#include "pointer_event.h" + +namespace OHOS { +namespace MMI { +class IKnuckleDrawing { +public: + IKnuckleDrawing() = default; + virtual ~IKnuckleDrawing() = default; + + virtual void Draw(const DisplayInfo& displayInfo, const std::shared_ptr &touchEvent) = 0; + virtual void SetMultiWindowScreenId(uint64_t screenId, uint64_t displayNodeScreenId) = 0; +}; +} // namespace MMI +} // namespace OHOS +#endif // I_KNUCKLE_DRAWING_HANDLER_H diff --git a/service/window_manager/include/input_windows_manager.h b/service/window_manager/include/input_windows_manager.h index f73a192407d61634622a14607ae2a78f6eaa7c9c..034839d630d8dca711069304c1e0b99cdb53bd7b 100644 --- a/service/window_manager/include/input_windows_manager.h +++ b/service/window_manager/include/input_windows_manager.h @@ -23,8 +23,7 @@ #include "i_input_windows_manager.h" #include "input_display_bind_helper.h" #ifndef OHOS_BUILD_ENABLE_WATCH -#include "knuckle_drawing_manager.h" -#include "knuckle_dynamic_drawing_manager.h" +#include "knuckle_drawing_component.h" #endif // OHOS_BUILD_ENABLE_WATCH namespace OHOS { @@ -523,17 +522,11 @@ private: bool isOpen { false }; } privacyProtection_; bool isOpenPrivacyProtectionserver_ { false }; -#ifndef OHOS_BUILD_ENABLE_WATCH - std::shared_ptr knuckleDrawMgr_ { nullptr }; -#endif // OHOS_BUILD_ENABLE_WATCH bool mouseFlag_ {false}; std::map> targetTouchWinIds_; std::map> targetMouseWinIds_; int32_t pointerActionFlag_ { -1 }; int32_t currentUserId_ { -1 }; -#ifndef OHOS_BUILD_ENABLE_WATCH - std::shared_ptr knuckleDynamicDrawingManager_ { nullptr }; -#endif // OHOS_BUILD_ENABLE_WATCH std::shared_ptr lastPointerEventforWindowChange_ { nullptr }; std::map> lastPointerEventforWindowChangeMap_; bool cancelTouchStatus_ { false }; diff --git a/service/window_manager/include/knuckle_drawing.h b/service/window_manager/include/knuckle_drawing.h new file mode 100644 index 0000000000000000000000000000000000000000..8953a20c59b8ca608eab196a7d6d30db51b74d25 --- /dev/null +++ b/service/window_manager/include/knuckle_drawing.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * 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 KNUCKLE_DRAWING_H +#define KNUCKLE_DRAWING_H + +#include "i_knuckle_drawing.h" +#include "knuckle_drawing_manager.h" +#include "knuckle_dynamic_drawing_manager.h" + +namespace OHOS { +namespace MMI { +class KnuckleDrawing final : public IKnuckleDrawing { +public: + KnuckleDrawing(); + ~KnuckleDrawing() override = default; + + void Draw(const DisplayInfo& displayInfo, const std::shared_ptr &touchEvent) override; + void SetMultiWindowScreenId(uint64_t screenId, uint64_t displayNodeScreenId) override; + +private: + std::shared_ptr knuckleDrawMgr_ {nullptr}; +#ifndef OHOS_BUILD_ENABLE_NEW_KNUCKLE_DYNAMIC + std::shared_ptr knuckleDynamicDrawMgr_ {nullptr}; +#endif // OHOS_BUILD_ENABLE_NEW_KNUCKLE_DYNAMIC +}; +} // namespace MMI +} // namespace OHOS + +#endif // KNUCKLE_DRAWING_H diff --git a/service/window_manager/include/knuckle_drawing_component.h b/service/window_manager/include/knuckle_drawing_component.h new file mode 100644 index 0000000000000000000000000000000000000000..46fc47881d09218369af97e8772f7537209a858c --- /dev/null +++ b/service/window_manager/include/knuckle_drawing_component.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * 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 KNUCKLE_DRAWING_COMPONENT_H +#define KNUCKLE_DRAWING_COMPONENT_H + +#include + +#include "window_info.h" +#include "knuckle_drawing.h" + +namespace OHOS { +namespace MMI { +class KnuckleDrawingComponent { +public: + static KnuckleDrawingComponent &GetInstance(); + + void Draw(const DisplayInfo& displayInfo, const std::shared_ptr &touchEvent); + void SetMultiWindowScreenId(uint64_t screenId, uint64_t displayNodeScreenId); + +private: + DISALLOW_COPY_AND_MOVE(KnuckleDrawingComponent); + KnuckleDrawingComponent() = default; + ~KnuckleDrawingComponent(); + + IKnuckleDrawing *Load(); + void Unload(); + +private: + using GetKnuckleDrawingFunc = IKnuckleDrawing*(*)(); + using DestroyKnuckleDrawingFunc = void (*)(IKnuckleDrawing*); + + std::mutex implMutex_; + void *handle_ {nullptr}; + IKnuckleDrawing *impl_ {nullptr}; + int32_t timerId_ {-1}; + std::chrono::time_point lastCallTime_ {std::chrono::steady_clock::now()}; +}; +} // namespace MMI +} // namespace OHOS +#endif // KNUCKLE_DRAWING_COMPONENT_H \ No newline at end of file diff --git a/service/window_manager/include/knuckle_drawing_manager.h b/service/window_manager/include/knuckle_drawing_manager.h index 64ca9b06ea706560d458a5f5a62d544bfafd4ccb..1e1884d18404375a8b623f926905a1ca256acf48 100644 --- a/service/window_manager/include/knuckle_drawing_manager.h +++ b/service/window_manager/include/knuckle_drawing_manager.h @@ -39,6 +39,7 @@ class KnuckleDrawingManager { public: void KnuckleDrawHandler(std::shared_ptr touchEvent, int32_t displayId = -1); void UpdateDisplayInfo(const DisplayInfo& displayInfo); + KnuckleDrawingManager(); ~KnuckleDrawingManager() = default; void RotationCanvasNode(std::shared_ptr canvasNode, const DisplayInfo& displayInfo); diff --git a/service/window_manager/src/input_windows_manager.cpp b/service/window_manager/src/input_windows_manager.cpp index a37afd0c597a74ed82fea9426217de372946490c..daad070e6aa70f9b2d3fec0f8f3b07f6907ce637 100644 --- a/service/window_manager/src/input_windows_manager.cpp +++ b/service/window_manager/src/input_windows_manager.cpp @@ -5580,19 +5580,6 @@ void InputWindowsManager::DrawTouchGraphic(std::shared_ptr pointer { CALL_DEBUG_ENTER; CHKPV(pointerEvent); -#ifdef OHOS_BUILD_ENABLE_GESTURESENSE_WRAPPER - if (knuckleDrawMgr_ == nullptr) { - knuckleDrawMgr_ = std::make_shared(); - } -#ifndef OHOS_BUILD_ENABLE_NEW_KNUCKLE_DYNAMIC - if (knuckleDynamicDrawingManager_ == nullptr) { - knuckleDynamicDrawingManager_ = std::make_shared(); - if (knuckleDrawMgr_ != nullptr) { - knuckleDynamicDrawingManager_->SetKnuckleDrawingManager(knuckleDrawMgr_); - } - } -#endif // OHOS_BUILD_ENABLE_NEW_KNUCKLE_DYNAMIC -#endif // OHOS_BUILD_ENABLE_GESTURESENSE_WRAPPER auto displayId = pointerEvent->GetTargetDisplayId(); if (!UpdateDisplayId(displayId)) { MMI_HILOGE("This display is not exist"); @@ -5618,12 +5605,7 @@ void InputWindowsManager::DrawTouchGraphic(std::shared_ptr pointer } } if (!isInMethodWindow) { - knuckleDrawMgr_->UpdateDisplayInfo(*physicDisplayInfo); - knuckleDrawMgr_->KnuckleDrawHandler(pointerEvent, physicDisplayInfo->uniqueId); -#ifndef OHOS_BUILD_ENABLE_NEW_KNUCKLE_DYNAMIC - knuckleDynamicDrawingManager_->UpdateDisplayInfo(*physicDisplayInfo); - knuckleDynamicDrawingManager_->KnuckleDynamicDrawHandler(pointerEvent, physicDisplayInfo->uniqueId); -#endif // OHOS_BUILD_ENABLE_NEW_KNUCKLE_DYNAMIC + KnuckleDrawingComponent::GetInstance().Draw(*physicDisplayInfo, pointerEvent); } #endif // OHOS_BUILD_ENABLE_KEYBOARD && OHOS_BUILD_ENABLE_COMBINATION_KEY && OHOS_BUILD_ENABLE_GESTURESENSE_WRAPPER diff --git a/service/window_manager/src/knuckle_drawing.cpp b/service/window_manager/src/knuckle_drawing.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6af5116f6efef2431a2302a1e882d2415e13b76c --- /dev/null +++ b/service/window_manager/src/knuckle_drawing.cpp @@ -0,0 +1,64 @@ +/* + * 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 "knuckle_drawing.h" +#include "define_multimodal.h" +#include "mmi_log.h" + +#undef MMI_LOG_TAG +#define MMI_LOG_TAG "KnuckleDrawing" + +namespace OHOS { +namespace MMI { +KnuckleDrawing::KnuckleDrawing() +{ + knuckleDrawMgr_ = std::make_shared(); +#ifndef OHOS_BUILD_ENABLE_NEW_KNUCKLE_DYNAMIC + knuckleDynamicDrawMgr_ = std::make_shared(); + knuckleDynamicDrawMgr_->SetKnuckleDrawingManager(knuckleDrawMgr_); +#endif // OHOS_BUILD_ENABLE_NEW_KNUCKLE_DYNAMIC +} + +void KnuckleDrawing::Draw(const DisplayInfo& displayInfo, const std::shared_ptr &touchEvent) +{ + CHKPRV(knuckleDrawMgr_, "knuckleDrawMgr_ not initialized"); + knuckleDrawMgr_->UpdateDisplayInfo(displayInfo); + knuckleDrawMgr_->KnuckleDrawHandler(touchEvent, displayInfo.uniqueId); +#ifndef OHOS_BUILD_ENABLE_NEW_KNUCKLE_DYNAMIC + CHKPRV(knuckleDynamicDrawingManager_, "knuckleDynamicDrawingManager_ not initialized"); + knuckleDynamicDrawingManager_->UpdateDisplayInfo(displayInfo); + knuckleDynamicDrawingManager_->KnuckleDynamicDrawHandler(touchEvent, displayInfo.uniqueId); +#endif // OHOS_BUILD_ENABLE_NEW_KNUCKLE_DYNAMIC +} + +void KnuckleDrawing::SetMultiWindowScreenId(uint64_t screenId, uint64_t displayNodeScreenId) +{ + CHKPRV(knuckleDrawMgr_, "knuckleDrawMgr_ not initialized"); + knuckleDrawMgr_->SetMultiWindowScreenId(screenId, displayNodeScreenId); +} + +extern "C" IKnuckleDrawing *GetKnuckleDrawing() +{ + return new KnuckleDrawing(); +} + +extern "C" void DestroyKnuckleDrawing(IKnuckleDrawing *inst) +{ + if (inst != nullptr) { + delete inst; + } +} +} // namespace MMI +} // namespace OHOS \ No newline at end of file diff --git a/service/window_manager/src/knuckle_drawing_component.cpp b/service/window_manager/src/knuckle_drawing_component.cpp new file mode 100644 index 0000000000000000000000000000000000000000..09e416c44ec06f2bdfdae65f032b3c8c49299eaa --- /dev/null +++ b/service/window_manager/src/knuckle_drawing_component.cpp @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * 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 "knuckle_drawing_component.h" + +#include +#include "dlfcn.h" + +#include "define_multimodal.h" +#include "mmi_log.h" +#include "timer_manager.h" + +#undef MMI_LOG_TAG +#define MMI_LOG_TAG "KnuckleDrawingComponent" + +namespace { +#ifdef __aarch64__ +static const std::string KNUCKLE_DRAWING_LIB_PATH = "/system/lib64/"; +#else +static const std::string KNUCKLE_DRAWING_LIB_PATH = "/system/lib/"; +#endif +static const std::string KNUCKLE_DRAWING_LIB_NAME = "libmmi-knuckle.z.so"; +static const std::string KNUCKLE_DRAWING_LIB_ABSOLUTE_PATH = KNUCKLE_DRAWING_LIB_PATH + KNUCKLE_DRAWING_LIB_NAME; +constexpr int32_t CHECK_TIME_MS = 30 * 1000; // 30S +constexpr int32_t CHECK_COUNT = -1; +} // namespace + +namespace OHOS { +namespace MMI { +KnuckleDrawingComponent &KnuckleDrawingComponent::GetInstance() +{ + static KnuckleDrawingComponent instance; + return instance; +} + +void KnuckleDrawingComponent::Draw(const DisplayInfo& displayInfo, const std::shared_ptr &touchEvent) +{ + lastCallTime_ = std::chrono::steady_clock::now(); + IKnuckleDrawing *knuckleDrawing = Load(); + CHKPRV(knuckleDrawMgr_, "Load knuckleDrawing fail"); + knuckleDrawing->Draw(displayInfo, touchEvent); +} + +void KnuckleDrawingComponent::SetMultiWindowScreenId(uint64_t screenId, uint64_t displayNodeScreenId) +{ + lastCallTime_ = std::chrono::steady_clock::now(); + IKnuckleDrawing *knuckleDrawing = Load(); + CHKPRV(knuckleDrawMgr_, "Load knuckleDrawing fail"); + knuckleDrawing->SetMultiWindowScreenId(screenId, displayNodeScreenId); +} + +KnuckleDrawingComponent::~KnuckleDrawingComponent() +{ + Unload(); +} + +IKnuckleDrawing *KnuckleDrawingComponent::Load() +{ + std::unique_lock lock(implMutex_); + if (impl_ != nullptr) { + return impl_; + } + + if (handle_ == nullptr) { + char realPath[PATH_MAX] = { 0 }; + if (realpath(KNUCKLE_DRAWING_LIB_ABSOLUTE_PATH.c_str(), realPath) == nullptr) { + MMI_HILOGE("Path is error, path is %{public}s", KNUCKLE_DRAWING_LIB_ABSOLUTE_PATH.c_str()); + return nullptr; + } + handle_ = ::dlopen(realPath, RTLD_NOW); + if (handle_ == nullptr) { + MMI_HILOGE("%{public}s dlopen fail", KNUCKLE_DRAWING_LIB_ABSOLUTE_PATH.c_str()); + return nullptr; + } + } + + GetKnuckleDrawingFunc create = reinterpret_cast(::dlsym(handle_, "GetKnuckleDrawing")); + if (create == nullptr) { + MMI_HILOGE("faield to get KnuckleDrawing"); + Unload(); + return nullptr; + } + impl_ = create(); + + timerId_ = TimerMgr->AddTimer(CHECK_TIME_MS, CHECK_COUNT, [this] { + auto idleTime = std::chrono::duration_cast( + std::chrono::steady_clock::now() - lastCallTime_).count(); + if (idleTime >= CHECK_TIME_MS) { + KnuckleDrawingComponent::GetInstance().Unload(); + } + }); + if (timerId_ < 0) { + MMI_HILOGE("Add timer for unloading knuckle library fail"); + Unload(); + return nullptr; + } + MMI_HILOGD("success to get KnuckleDrawing"); + return impl_; +} + +void KnuckleDrawingComponent::Unload() +{ + std::unique_lock lock(implMutex_); + TimerMgr->RemoveTimer(timerId_); + timerId_ = -1; + + if (handle_ != nullptr && impl_ != nullptr) { + DestroyKnuckleDrawingFunc destroy = reinterpret_cast( + ::dlsym(handle_, "DestroyKnuckleDrawing")); + if (destroy != nullptr) { + destroy(impl_); + } + impl_ = nullptr; + } + + if (handle_ != nullptr) { + ::dlclose(handle_); + handle_ = nullptr; + } +} +} // namespace MMI +} // namespace OHOS \ No newline at end of file diff --git a/service/window_manager/src/knuckle_drawing_manager.cpp b/service/window_manager/src/knuckle_drawing_manager.cpp index 5db1b17be1d217c0ef8ab642e1e5982f25f5179d..4927259762958ea7b12d3e2bc0482a1c3c049f74 100644 --- a/service/window_manager/src/knuckle_drawing_manager.cpp +++ b/service/window_manager/src/knuckle_drawing_manager.cpp @@ -57,7 +57,7 @@ constexpr int32_t ROTATION_ANGLE_0 { 0 }; constexpr int32_t ROTATION_ANGLE_90 { 90 }; constexpr int32_t ROTATION_ANGLE_180 { 180 }; constexpr int32_t ROTATION_ANGLE_270 { 270 }; -constexpr uint64_t FOLD_SCREEN_MAIN_ID { 5 }; +[[ maybe_unused ]] constexpr uint64_t FOLD_SCREEN_MAIN_ID { 5 }; constexpr std::string_view SCREEN_READING { "accessibility_screenreader_enabled" }; constexpr std::string_view SCREEN_READ_ENABLE { "1" }; constexpr int32_t POINTER_NUMBER_TO_DRAW { 10 }; diff --git a/service/window_manager/test/input_windows_manager_ex_test.cpp b/service/window_manager/test/input_windows_manager_ex_test.cpp index e2d90dbbb3d1d994d929285524f174641d89abc6..0ac3d631371cc5640d8c557b4a70e2f7f6bfef2b 100644 --- a/service/window_manager/test/input_windows_manager_ex_test.cpp +++ b/service/window_manager/test/input_windows_manager_ex_test.cpp @@ -2470,54 +2470,9 @@ HWTEST_F(InputWindowsManagerTest, DrawTouchGraphic_001, TestSize.Level1) ASSERT_NE(inputWindowsManager, nullptr); std::shared_ptr pointerEvent = PointerEvent::Create(); ASSERT_NE(pointerEvent, nullptr); - - inputWindowsManager->knuckleDrawMgr_ = nullptr; - EXPECT_NO_FATAL_FAILURE(inputWindowsManager->DrawTouchGraphic(pointerEvent)); -} - -/** - * @tc.name: DrawTouchGraphic_002 - * @tc.desc: Test the function DrawTouchGraphic - * @tc.type: FUNC - * @tc.require: - */ -HWTEST_F(InputWindowsManagerTest, DrawTouchGraphic_002, TestSize.Level1) -{ - CALL_TEST_DEBUG; - std::shared_ptr inputWindowsManager = - std::static_pointer_cast(WIN_MGR); - ASSERT_NE(inputWindowsManager, nullptr); - std::shared_ptr pointerEvent = PointerEvent::Create(); - ASSERT_NE(pointerEvent, nullptr); - - inputWindowsManager->knuckleDrawMgr_ = std::make_shared(); - ASSERT_NE(inputWindowsManager->knuckleDrawMgr_, nullptr); - inputWindowsManager->knuckleDynamicDrawingManager_ = nullptr; EXPECT_NO_FATAL_FAILURE(inputWindowsManager->DrawTouchGraphic(pointerEvent)); } -/** - * @tc.name: DrawTouchGraphic_003 - * @tc.desc: Test the function DrawTouchGraphic - * @tc.type: FUNC - * @tc.require: - */ -HWTEST_F(InputWindowsManagerTest, DrawTouchGraphic_003, TestSize.Level1) -{ - CALL_TEST_DEBUG; - std::shared_ptr inputWindowsManager = - std::static_pointer_cast(WIN_MGR); - ASSERT_NE(inputWindowsManager, nullptr); - std::shared_ptr pointerEvent = PointerEvent::Create(); - ASSERT_NE(pointerEvent, nullptr); - - inputWindowsManager->knuckleDrawMgr_ = std::make_shared(); - ASSERT_NE(inputWindowsManager->knuckleDrawMgr_, nullptr); - - inputWindowsManager->knuckleDynamicDrawingManager_ = std::make_shared(); - ASSERT_NE(inputWindowsManager->knuckleDynamicDrawingManager_, nullptr); - EXPECT_NO_FATAL_FAILURE(inputWindowsManager->DrawTouchGraphic(pointerEvent)); -} /** * @tc.name: InputWindowsManagerTest_SendUIExtentionPointerEvent @@ -4165,9 +4120,6 @@ HWTEST_F(InputWindowsManagerTest, DrawTouchGraphic_004, TestSize.Level1) it->second.displaysInfo.push_back(displayInfo); } - inputWindowsManager->knuckleDrawMgr_ = nullptr; - inputWindowsManager->knuckleDynamicDrawingManager_ = nullptr; - EXPECT_NO_FATAL_FAILURE(inputWindowsManager->DrawTouchGraphic(pointerEvent)); } diff --git a/service/window_manager/test/input_windows_manager_test.cpp b/service/window_manager/test/input_windows_manager_test.cpp index 2f4f835c4ed8371b85b78c22718ce5ebc81eda39..be79afc9c3293b4b52cfc0b1fedb819e85a4f562 100644 --- a/service/window_manager/test/input_windows_manager_test.cpp +++ b/service/window_manager/test/input_windows_manager_test.cpp @@ -5927,14 +5927,6 @@ HWTEST_F(InputWindowsManagerTest, InputWindowsManagerTest_DrawTouchGraphic_001, InputWindowsManager inputWindowsMgr; std::shared_ptr pointerEvent = PointerEvent::Create(); ASSERT_NE(pointerEvent, nullptr); - inputWindowsMgr.knuckleDrawMgr_ = nullptr; - EXPECT_NO_FATAL_FAILURE(inputWindowsMgr.DrawTouchGraphic(pointerEvent)); - inputWindowsMgr.knuckleDrawMgr_ = std::make_shared(); - ASSERT_NE(inputWindowsMgr.knuckleDrawMgr_, nullptr); - inputWindowsMgr.knuckleDynamicDrawingManager_ = nullptr; - EXPECT_NO_FATAL_FAILURE(inputWindowsMgr.DrawTouchGraphic(pointerEvent)); - inputWindowsMgr.knuckleDynamicDrawingManager_ = std::make_shared(); - ASSERT_NE(inputWindowsMgr.knuckleDynamicDrawingManager_, nullptr); EXPECT_NO_FATAL_FAILURE(inputWindowsMgr.DrawTouchGraphic(pointerEvent)); } @@ -6281,8 +6273,6 @@ HWTEST_F(InputWindowsManagerTest, InputWindowsManagerTest_DrawTouchGraphic, Test InputWindowsManager inputWindowsMgr; std::shared_ptr pointerEvent = PointerEvent::Create(); ASSERT_NE(pointerEvent, nullptr); - inputWindowsMgr.knuckleDrawMgr_ = std::make_shared(); - inputWindowsMgr.knuckleDynamicDrawingManager_ = std::make_shared(); pointerEvent->SetTargetDisplayId(100); EXPECT_NO_FATAL_FAILURE(inputWindowsMgr.DrawTouchGraphic(pointerEvent)); } diff --git a/service/window_manager/test/knuckle_drawing_component_test.cpp b/service/window_manager/test/knuckle_drawing_component_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1c6a87c077bf6a95579a0fbb083b08a83c01f9e2 --- /dev/null +++ b/service/window_manager/test/knuckle_drawing_component_test.cpp @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * 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 "i_knuckle_drawing.h" +#include "knuckle_drawing_component.h" +#include "mmi_log.h" + +#undef MMI_LOG_TAG +#define MMI_LOG_TAG "KnuckleDrawingComponentTest" + +using namespace testing; +using namespace testing::ext; + +namespace OHOS { +namespace MMI { + +class KnuckleDrawingComponentTest : public testing::Test { +public: + static void SetUpTestCase(void) {}; + static void TearDownTestCase(void) {}; + void SetUp(void) {} +}; + +class MockIKnuckleDrawing : public IKnuckleDrawing { +public: + MockIKnuckleDrawing() = default; + ~MockIKnuckleDrawing() override = default; + + MOCK_METHOD2(Draw, void(const DisplayInfo&, const std::shared_ptr&)); + MOCK_METHOD2(SetMultiWindowScreenId, void(uint64_t, uint64_t)); +}; + +/** + * @tc.name: KnuckleDrawingComponentTest_Draw + * @tc.desc: Test Overrides Draw function branches + * @tc.type: Function + * @tc.require: + */ +HWTEST_F(KnuckleDrawingComponentTest, KnuckleDrawingComponentTest_Draw, TestSize.Level1) +{ + CALL_TEST_DEBUG; + KnuckleDrawingComponent::GetInstance().Unload(); + + MockIKnuckleDrawing *knuckleDrawing = new MockIKnuckleDrawing(); + ASSERT_NE(knuckleDrawing, nullptr); + + bool isCalled = false; + EXPECT_CALL(*knuckleDrawing, Draw(_, _)).WillOnce([&isCalled] { + isCalled = true; + }); + KnuckleDrawingComponent::GetInstance().impl_ = knuckleDrawing; + + DisplayInfo info; + std::shared_ptr touchEvent = std::make_shared(); + auto pointerEvent = PointerEvent::Create(); + ASSERT_NE(pointerEvent, nullptr); + KnuckleDrawingComponent::GetInstance().Draw(info, pointerEvent); + EXPECT_TRUE(isCalled); + + KnuckleDrawingComponent::GetInstance().impl_ = nullptr; + delete knuckleDrawing; + knuckleDrawing = nullptr; +} + +/** + * @tc.name: KnuckleDrawingComponentTest_SetMultiWindowScreenId + * @tc.desc: Test Overrides SetMultiWindowScreenId function branches + * @tc.type: Function + * @tc.require: + */ +HWTEST_F(KnuckleDrawingComponentTest, KnuckleDrawingComponentTest_SetMultiWindowScreenId, TestSize.Level1) +{ + CALL_TEST_DEBUG; + KnuckleDrawingComponent::GetInstance().Unload(); + + MockIKnuckleDrawing *knuckleDrawing = new MockIKnuckleDrawing(); + ASSERT_NE(knuckleDrawing, nullptr); + + bool isCalled = false; + EXPECT_CALL(*knuckleDrawing, SetMultiWindowScreenId(_, _)).WillOnce([&isCalled] { + isCalled = true; + }); + KnuckleDrawingComponent::GetInstance().impl_ = knuckleDrawing; + + uint64_t screenId = 0; + uint64_t displayNodeScreenId = 0; + KnuckleDrawingComponent::GetInstance().SetMultiWindowScreenId(screenId, displayNodeScreenId); + EXPECT_TRUE(isCalled); + + KnuckleDrawingComponent::GetInstance().impl_ = nullptr; + delete knuckleDrawing; + knuckleDrawing = nullptr; +} + +/** + * @tc.name: KnuckleDrawingComponentTest_Load + * @tc.desc: Test Overrides Load function branches + * @tc.type: Function + * @tc.require: + */ +HWTEST_F(KnuckleDrawingComponentTest, KnuckleDrawingComponentTest_Load, TestSize.Level1) +{ + CALL_TEST_DEBUG; + KnuckleDrawingComponent::GetInstance().Unload(); + + MockIKnuckleDrawing *knuckleDrawing = new MockIKnuckleDrawing(); + ASSERT_NE(knuckleDrawing, nullptr); + + KnuckleDrawingComponent::GetInstance().impl_ = knuckleDrawing; + KnuckleDrawingComponent::GetInstance().Load(); + KnuckleDrawingComponent::GetInstance().impl_ = nullptr; + delete knuckleDrawing; + knuckleDrawing = nullptr; + + KnuckleDrawingComponent::GetInstance().Load(); + ASSERT_NE(KnuckleDrawingComponent::GetInstance().impl_, nullptr); + ASSERT_NE(KnuckleDrawingComponent::GetInstance().handle_, nullptr); + ASSERT_GE(KnuckleDrawingComponent::GetInstance().timerId_, 0); + + KnuckleDrawingComponent::GetInstance().Unload(); +} + +/** + * @tc.name: KnuckleDrawingComponentTest_Unload + * @tc.desc: Test Overrides Unload function branches + * @tc.type: Function + * @tc.require: + */ +HWTEST_F(KnuckleDrawingComponentTest, KnuckleDrawingComponentTest_Unload, TestSize.Level1) +{ + CALL_TEST_DEBUG; + KnuckleDrawingComponent::GetInstance().Unload(); + ASSERT_EQ(KnuckleDrawingComponent::GetInstance().impl_, nullptr); + ASSERT_EQ(KnuckleDrawingComponent::GetInstance().handle_, nullptr); + ASSERT_EQ(KnuckleDrawingComponent::GetInstance().timerId_, -1); +} +} // namespace OHOS +} // namespace MMI \ No newline at end of file diff --git a/service/window_manager/test/knuckle_drawing_test.cpp b/service/window_manager/test/knuckle_drawing_test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9e6957a1452be6510edf9d707a661e48d33fd2a1 --- /dev/null +++ b/service/window_manager/test/knuckle_drawing_test.cpp @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * 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 "i_knuckle_drawing.h" +#include "knuckle_drawing.h" + +using namespace testing::ext; +using namesapce OHOS::MMI; + +extern "C" IKnuckleDrawing *GetKnuckleDrawing(); +extern "C" void DestroyKnuckleDrawing(IKnuckleDrawing *inst); + +namespace OHOS { +namespace MMI { + +class KnuckleDrawingTest : public testing::Test { +public: + static void SetUpTestCase(void) {}; + static void TearDownTestCase(void) {}; + void SetUp(void) {} +}; + +/** + * @tc.name: KnuckleDrawingTest_GetKnuckleDrawing + * @tc.desc: Test Overrides GetKnuckleDrawing function branches + * @tc.type: Function + * @tc.require: + */ +HWTEST_F(KnuckleDrawingTest, KnuckleDrawingTest_GetKnuckleDrawing, TestSize.Level1) +{ + IKnuckleDrawing *knuckleDrawing = GetKnuckleDrawing(); + ASSERT_NE(knuckleDrawing, nullptr); + delete knuckleDrawing; +} + +/** + * @tc.name: KnuckleDrawingTest_DestroyKnuckleDrawing + * @tc.desc: Test Overrides DestroyKnuckleDrawing function branches + * @tc.type: Function + * @tc.require: + */ +HWTEST_F(KnuckleDrawingTest, KnuckleDrawingTest_DestroyKnuckleDrawing, TestSize.Level1) +{ + IKnuckleDrawing *knuckleDrawing = GetKnuckleDrawing(); + ASSERT_NE(knuckleDrawing, nullptr); + + DestroyKnuckleDrawing(knuckleDrawing); + knuckleDrawing = nullptr; + + DestroyKnuckleDrawing(knuckleDrawing); +} + +/** + * @tc.name: KnuckleDrawingTest_Draw + * @tc.desc: Test Overrides Draw function branches + * @tc.type: Function + * @tc.require: + */ +HWTEST_F(KnuckleDrawingTest, KnuckleDrawingTest_Draw, TestSize.Level1) +{ + std::shared_ptr knuckleDrawing = std::make_shared(); + DisplayInfo info; + std::shared_ptr touchEvent = std::make_shared(); + EXPECT_NO_FATAL_FAILURE(knuckleDrawing->Draw(info, touchEvent)); +} + +/** + * @tc.name: KnuckleDrawingTest_SetMultiWindowScreenId + * @tc.desc: Test Overrides SetMultiWindowScreenId function branches + * @tc.type: Function + * @tc.require: + */ +HWTEST_F(KnuckleDrawingTest, KnuckleDrawingTest_SetMultiWindowScreenId, TestSize.Level1) +{ + std::shared_ptr knuckleDrawing = std::make_shared(); + uint64_t screenId = 0; + uint64_t displayNodeScreenId = 0; + EXPECT_NO_FATAL_FAILURE(knuckleDrawing->SetMultiWindowScreenId(screenId, displayNodeScreenId)); +} +} // namespace MMI +} // namespace OHOS \ No newline at end of file