diff --git a/frameworks/native/interaction/test/unittest/src/interaction_drag_drawing_test.cpp b/frameworks/native/interaction/test/unittest/src/interaction_drag_drawing_test.cpp index cadf1c414..5ce8b81f6 100644 --- a/frameworks/native/interaction/test/unittest/src/interaction_drag_drawing_test.cpp +++ b/frameworks/native/interaction/test/unittest/src/interaction_drag_drawing_test.cpp @@ -122,7 +122,7 @@ public: void OnDragEndMessage(const DragNotifyMsg &msg) override { FI_HILOGI("DisplayX:%{public}d, displayY:%{public}d, targetPid:%{public}d, result:%{public}d", - msg.displayX, msg.displayY, msg.targetPid, static_cast(msg.result)); + msg.displayX, msg.displayY, msg.targetPid, static_cast(msg.result)); if (function_ != nullptr) { function_(msg); } diff --git a/frameworks/native/interaction/test/unittest/src/interaction_manager_test.cpp b/frameworks/native/interaction/test/unittest/src/interaction_manager_test.cpp index 12e0a7840..f1bf3bb68 100644 --- a/frameworks/native/interaction/test/unittest/src/interaction_manager_test.cpp +++ b/frameworks/native/interaction/test/unittest/src/interaction_manager_test.cpp @@ -224,7 +224,7 @@ public: void OnDragEndMessage(const DragNotifyMsg &msg) override { FI_HILOGI("DisplayX:%{public}d, displayY:%{public}d, targetPid:%{public}d, result:%{public}d", - msg.displayX, msg.displayY, msg.targetPid, static_cast(msg.result)); + msg.displayX, msg.displayY, msg.targetPid, static_cast(msg.result)); if (function_ != nullptr) { function_(msg); } @@ -462,11 +462,11 @@ void InteractionManagerTest::PrintDragData(const DragData &dragData) CALL_DEBUG_ENTER; for (const auto &shadowInfo : dragData.shadowInfos) { FI_HILOGD("PixelFormat:%{public}d, PixelAlphaType:%{public}d, PixelAllocatorType:%{public}d," - " PixelWidth:%{public}d, PixelHeight:%{public}d, shadowX:%{public}d, shadowY:%{public}d", - static_cast(shadowInfo.pixelMap->GetPixelFormat()), - static_cast(shadowInfo.pixelMap->GetAlphaType()), - static_cast(shadowInfo.pixelMap->GetAllocatorType()), - shadowInfo.pixelMap->GetWidth(), shadowInfo.pixelMap->GetHeight(), shadowInfo.x, shadowInfo.y); + " PixelWidth:%{public}d, PixelHeight:%{public}d, shadowX:%{public}d, shadowY:%{public}d", + static_cast(shadowInfo.pixelMap->GetPixelFormat()), + static_cast(shadowInfo.pixelMap->GetAlphaType()), + static_cast(shadowInfo.pixelMap->GetAllocatorType()), + shadowInfo.pixelMap->GetWidth(), shadowInfo.pixelMap->GetHeight(), shadowInfo.x, shadowInfo.y); } FI_HILOGD("SourceType:%{public}d, pointerId:%{public}d, displayId:%{public}d, displayX:%{public}d," diff --git a/interfaces/innerkits/interaction/include/interaction_manager.h b/interfaces/innerkits/interaction/include/interaction_manager.h index d07daf255..92d4cab7f 100644 --- a/interfaces/innerkits/interaction/include/interaction_manager.h +++ b/interfaces/innerkits/interaction/include/interaction_manager.h @@ -188,6 +188,7 @@ public: */ int32_t SetDragWindowVisible(bool visible); + // 这个接口的行为在传入的是多个shadowInfo的时候是不是需要改变 /** * @brief Obtains the position of the touch point or mouse pointer relative to * the upper left corner of the shadow thumbnail. @@ -206,6 +207,7 @@ public: * @return Returns 0 if the operation is successful; returns other values if the operation fails. * @since 10 */ + // 这个接口的行为或者接口参数,是不是也需要改变 int32_t UpdateShadowPic(const ShadowInfo &shadowInfo); /** diff --git a/services/interaction/drag/src/drag_manager.cpp b/services/interaction/drag/src/drag_manager.cpp index a40b7db93..dffe00f7b 100644 --- a/services/interaction/drag/src/drag_manager.cpp +++ b/services/interaction/drag/src/drag_manager.cpp @@ -110,11 +110,11 @@ void DragManager::PrintDragData(const DragData &dragData) CALL_INFO_TRACE; for (const auto& shadowInfo : dragData.shadowInfos) { FI_HILOGI("PixelFormat:%{public}d, PixelAlphaType:%{public}d, PixelAllocatorType:%{public}d," - " PixelWidth:%{public}d, PixelHeight:%{public}d, shadowX:%{public}d, shadowY:%{public}d", - static_cast(shadowInfo.pixelMap->GetPixelFormat()), - static_cast(shadowInfo.pixelMap->GetAlphaType()), - static_cast(shadowInfo.pixelMap->GetAllocatorType()), - shadowInfo.pixelMap->GetWidth(), shadowInfo.pixelMap->GetHeight(), shadowInfo.x, shadowInfo.y); + " PixelWidth:%{public}d, PixelHeight:%{public}d, shadowX:%{public}d, shadowY:%{public}d", + static_cast(shadowInfo.pixelMap->GetPixelFormat()), + static_cast(shadowInfo.pixelMap->GetAlphaType()), + static_cast(shadowInfo.pixelMap->GetAllocatorType()), + shadowInfo.pixelMap->GetWidth(), shadowInfo.pixelMap->GetHeight(), shadowInfo.x, shadowInfo.y); } std::string summarys; for (const auto &[udKey, recordSize] : dragData.summarys) { diff --git a/services/native/test/unittest/src/drag_data_manager_test.cpp b/services/native/test/unittest/src/drag_data_manager_test.cpp index 5a05b297a..a8a2d8d82 100644 --- a/services/native/test/unittest/src/drag_data_manager_test.cpp +++ b/services/native/test/unittest/src/drag_data_manager_test.cpp @@ -102,10 +102,9 @@ std::optional DragDataManagerTest::CreateDragData(int32_t sourceType, FI_HILOGE("Create pixelmap failed"); return std::nullopt; } + DragData dragData; - dragData.shadowInfo.x = 0; - dragData.shadowInfo.y = 0; - dragData.shadowInfo.pixelMap = pixelMap; + dragData.shadowInfos.push_back({ pixelMap, 0, 0 }); dragData.buffer = std::vector(MAX_BUFFER_SIZE, 0); dragData.udKey = UD_KEY; dragData.sourceType = sourceType; @@ -206,9 +205,7 @@ HWTEST_F(DragDataManagerTest, DragDataManagerTest005, TestSize.Level0) std::shared_ptr pixelMap = CreatePixelMap(PIXEL_MAP_WIDTH, PIXEL_MAP_HEIGHT); EXPECT_FALSE(pixelMap == nullptr); DragData dragData; - dragData.shadowInfo.pixelMap = pixelMap; - dragData.shadowInfo.x = SHADOWINFO_X; - dragData.shadowInfo.y = SHADOWINFO_Y; + dragData.shadowInfos.push_back({ pixelMap, SHADOWINFO_X, SHADOWINFO_Y }); dragData.displayX = DISPLAY_X; dragData.displayY = DISPLAY_Y; DRAG_DATA_MGR.Init(dragData); @@ -239,9 +236,7 @@ HWTEST_F(DragDataManagerTest, DragDataManagerTest006, TestSize.Level0) { CALL_TEST_DEBUG; DragData dragData; - dragData.shadowInfo.pixelMap = nullptr; - dragData.shadowInfo.x = SHADOWINFO_X; - dragData.shadowInfo.y = SHADOWINFO_Y; + dragData.shadowInfos.push_back({ nullptr, SHADOWINFO_X, SHADOWINFO_Y }); dragData.displayX = DISPLAY_X; dragData.displayY = DISPLAY_Y; DRAG_DATA_MGR.Init(dragData); diff --git a/utils/common/BUILD.gn b/utils/common/BUILD.gn index 8c98539e4..b11ef7393 100755 --- a/utils/common/BUILD.gn +++ b/utils/common/BUILD.gn @@ -31,11 +31,11 @@ config("devicestatus_util_public_config") { ohos_shared_library("devicestatus_util") { version_script = "libdevicestatus_util_map" sources = [ + "src/drag_data_packer.cpp", "src/util.cpp", "src/util_napi.cpp", "src/util_napi_error.cpp", "src/utility.cpp", - "src/drag_data_packer.cpp", ] configs = [ ":devicestatus_util_private_config" ] @@ -45,8 +45,8 @@ ohos_shared_library("devicestatus_util") { external_deps = [ "c_utils:utils", "hilog:libhilog", - "napi:ace_napi", "image_framework:image_native", + "napi:ace_napi", ] innerapi_tags = [ "platformsdk" ]