diff --git a/frameworks/core/components_ng/manager/drag_drop/drag_drop_manager.cpp b/frameworks/core/components_ng/manager/drag_drop/drag_drop_manager.cpp index 31d3798cca76a3b609dce90260ad4e620759fa1e..e5694012ca8882e968f233bb36c98bf7401f6a3c 100644 --- a/frameworks/core/components_ng/manager/drag_drop/drag_drop_manager.cpp +++ b/frameworks/core/components_ng/manager/drag_drop/drag_drop_manager.cpp @@ -52,11 +52,6 @@ RefPtr DragDropManager::CreateAndShowDragWindow( SetIsDragged(true); isDragCancel_ = false; #if !defined(PREVIEW) - if (dragWindow_) { - LOGW("CreateAndShowDragWindow: There is a drag window, create drag window failed."); - return nullptr; - } - CreateDragWindow(info, pixelMap->GetWidth(), pixelMap->GetHeight()); if (!dragWindow_) { return nullptr; @@ -76,7 +71,6 @@ RefPtr DragDropManager::CreateAndShowDragWindow( isDragCancel_ = false; #if !defined(PREVIEW) if (dragWindow_) { - LOGW("CreateAndShowDragWindow: There is a drag window, create drag window failed."); return nullptr; } @@ -104,7 +98,6 @@ RefPtr DragDropManager::CreateTextDragDropProxy() void DragDropManager::CreateDragWindow(const GestureEvent& info, uint32_t width, uint32_t height) { - LOGI("CreateDragWindow"); #if !defined(PREVIEW) auto pipeline = PipelineContext::GetCurrentContext(); CHECK_NULL_VOID(pipeline); @@ -114,8 +107,6 @@ void DragDropManager::CreateDragWindow(const GestureEvent& info, uint32_t width, static_cast(info.GetGlobalPoint().GetY()) + rect.Top(), width, height); if (dragWindow_) { dragWindow_->SetOffset(rect.Left(), rect.Top()); - } else { - LOGE("dragWindow create failed!"); } #endif } @@ -196,7 +187,6 @@ RefPtr DragDropManager::FindTargetInChildNodes( for (auto iter = children.rbegin(); iter != children.rend(); iter++) { auto child = *iter; if (child == nullptr) { - LOGW("when findding target in child nodes, find child is nullptr"); continue; } auto childFindResult = FindTargetInChildNodes(child, hitFrameNodes, findDrop); @@ -215,9 +205,6 @@ RefPtr DragDropManager::FindTargetInChildNodes( if (eventHub->HasOnDrop() || eventHub->HasOnItemDrop() || eventHub->HasCustomerOnDrop()) { return parentFrameNode; } - if (SystemProperties::GetDebugEnabled()) { - LOGW("Iter is in hitFrameNodes, but findDrop not suit with bind function."); - } } } return nullptr; @@ -245,9 +232,6 @@ RefPtr DragDropManager::FindDragFrameNodeByPosition( } if (frameNodes.empty()) { - if (SystemProperties::GetDebugEnabled()) { - LOGW("FrameNodes which have onDragMove or onDrop set is empty, cannot find targetNode."); - } return nullptr; } @@ -271,7 +255,7 @@ RefPtr DragDropManager::FindDragFrameNodeByPosition( if (hitFrameNodes.empty()) { if (SystemProperties::GetDebugEnabled()) { - LOGW("HitFrameNodes vector is empty, cannot find targetNode."); + TAG_LOGI(AceLogTag::ACE_DRAG, "Cannot find targetNodes."); } return nullptr; } @@ -285,9 +269,6 @@ RefPtr DragDropManager::FindDragFrameNodeByPosition( if (result) { return result; } - if (SystemProperties::GetDebugEnabled()) { - LOGW("Don't find targetNode by position in rootNode, return nullptr."); - } return nullptr; } @@ -400,8 +381,9 @@ void DragDropManager::NotifyDragRegisterFrameNode(std::unordered_mapGetPattern(); CHECK_NULL_VOID(pattern); if (SystemProperties::GetDebugEnabled()) { - LOGI("DragDropManager NotifyDragRegisterFrameNode. Dragged frameNode is %{public}s, depth is %{public}d, " - "DragEventType is %{public}d.", + TAG_LOGI(AceLogTag::ACE_DRAG, + "Drag notify is regist. Dragged frameNode is %{public}s, depth is %{public}d, " + "DragEventType is %{public}d.", frameNode->GetTag().c_str(), frameNode->GetDepth(), static_cast(dragEventType)); } pattern->HandleOnDragStatusCallback(dragEventType, notifyEvent); @@ -414,10 +396,6 @@ void DragDropManager::OnDragStart(const Point& point, const RefPtr& f CHECK_NULL_VOID(frameNode); preTargetFrameNode_ = frameNode; draggedFrameNode_ = preTargetFrameNode_; - if (SystemProperties::GetDebugEnabled()) { - LOGI("DragDropManager onDragStart. Dragged frameNode is %{public}s, depth is %{public}d.", - frameNode->GetTag().c_str(), frameNode->GetDepth()); - } RefPtr notifyEvent = AceType::MakeRefPtr(); UpdateNotifyDragEvent(notifyEvent, point, DragEventType::START); NotifyDragRegisterFrameNode(nodesForDragNotify_, DragEventType::START, notifyEvent); @@ -428,17 +406,17 @@ void DragDropManager::PrintDragFrameNode(const Point& point, const RefPtr(point.GetX()), static_cast(point.GetY())); - LOGI("PreTargetFrameNode is %{public}s, depth is %{public}d.", - preTargetFrameNode_->GetTag().c_str(), preTargetFrameNode_->GetDepth()); - LOGI("New find targetNode is %{public}s, depth is %{public}d.", + TAG_LOGI(AceLogTag::ACE_DRAG,"Drag Position is %{public}f and %{public}f, " + "PreTargetFrameNode is %{public}s, depth is %{public}d, " + "New find targetNode is %{public}s, depth is %{public}d.", + static_cast(point.GetX()), static_cast(point.GetY()), + preTargetFrameNode_->GetTag().c_str(), preTargetFrameNode_->GetDepth(), dragFrameNode->GetTag().c_str(), dragFrameNode->GetDepth()); } else { - LOGI("Position is %{public}f and %{public}f.", - static_cast(point.GetX()), static_cast(point.GetY())); - LOGI("PreTargetFrameNode is nullptr."); - LOGI("New find targetNode is %{public}s, depth is %{public}d.", + TAG_LOGI(AceLogTag::ACE_DRAG, "Drag Position is %{public}f and %{public}f, " + "PreTargetFrameNode is nullptr, " + "New find targetNode is %{public}s, depth is %{public}d.", + static_cast(point.GetX()), static_cast(point.GetY()), dragFrameNode->GetTag().c_str(), dragFrameNode->GetDepth()); } } @@ -450,7 +428,6 @@ void DragDropManager::OnDragMove(const Point& point, const std::string& extraInf auto container = Container::Current(); if (container && container->IsScenceBoardWindow()) { if (IsDragged() && IsWindowConsumed()) { - LOGD("The event does not need to be handled"); SetIsWindowConsumed(false); return; } @@ -461,7 +438,6 @@ void DragDropManager::OnDragMove(const Point& point, const std::string& extraInf UpdateDragListener(point); auto dragFrameNode = FindDragFrameNodeByPosition( static_cast(point.GetX()), static_cast(point.GetY()), DragType::COMMON, false); - PrintDragFrameNode(point, dragFrameNode); if (!dragFrameNode) { if (preTargetFrameNode_) { FireOnDragEvent(preTargetFrameNode_, point, DragEventType::LEAVE, extraInfo); @@ -484,9 +460,11 @@ void DragDropManager::OnDragMove(const Point& point, const std::string& extraInf if (preTargetFrameNode_) { auto preRect = preTargetFrameNode_->GetTransformRectRelativeToWindow(); if (!preRect.IsInRegion(PointF(static_cast(point.GetX()), static_cast(point.GetY())))) { + PrintDragFrameNode(point, dragFrameNode); FireOnDragEvent(preTargetFrameNode_, point, DragEventType::LEAVE, extraInfo); } } + PrintDragFrameNode(point, dragFrameNode); FireOnDragEvent(dragFrameNode, point, DragEventType::ENTER, extraInfo); preTargetFrameNode_ = dragFrameNode; } @@ -499,13 +477,13 @@ void DragDropManager::OnDragEnd(const Point& point, const std::string& extraInfo auto container = Container::Current(); if (container && container->IsScenceBoardWindow()) { if (IsDragged() && IsWindowConsumed()) { - LOGD("The event does not need to be handled"); return; } } if (isDragCancel_) { if (SystemProperties::GetDebugEnabled()) { - LOGI("DragDropManager is dragCancel, finish drag. WindowId is %{public}d.", container->GetWindowId()); + TAG_LOGI(AceLogTag::ACE_DRAG, "DragDropManager is dragCancel, finish drag. WindowId is %{public}d.", + container->GetWindowId()); } InteractionInterface::GetInstance()->SetDragWindowVisible(false); DragDropRet dragDropRet { DragRet::DRAG_CANCEL, false, container->GetWindowId() }; @@ -525,18 +503,19 @@ void DragDropManager::OnDragEnd(const Point& point, const std::string& extraInfo static_cast(point.GetX()), static_cast(point.GetY()), DragType::COMMON, true); if (SystemProperties::GetDebugEnabled()) { if (dragFrameNode) { - LOGI("Position is %{public}f and %{public}f. TargetNode is %{public}s.", + TAG_LOGI(AceLogTag::ACE_DRAG, "Position is %{public}f and %{public}f. TargetNode is %{public}s.", static_cast(point.GetX()), static_cast(point.GetY()), dragFrameNode->GetTag().c_str()); } else { - LOGI("Position is %{public}f and %{public}f. TargetNode is nullptr.", + TAG_LOGI(AceLogTag::ACE_DRAG, "Position is %{public}f and %{public}f. TargetNode is nullptr.", static_cast(point.GetX()), static_cast(point.GetY())); } } #ifdef ENABLE_DRAG_FRAMEWORK if (!dragFrameNode) { if (SystemProperties::GetDebugEnabled()) { - LOGW("DragDropManager onDragEnd, not find drop target, stop drag. WindowId is %{public}d.", + TAG_LOGW(AceLogTag::ACE_DRAG, + "DragDropManager onDragEnd, not find drop target, stop drag. WindowId is %{public}d.", container->GetWindowId()); } DragDropRet dragDropRet { DragRet::DRAG_FAIL, isMouseDragged_, container->GetWindowId() }; @@ -562,7 +541,8 @@ void DragDropManager::OnDragEnd(const Point& point, const std::string& extraInfo #ifdef ENABLE_DRAG_FRAMEWORK SetIsDragged(false); if (SystemProperties::GetDebugEnabled()) { - LOGI("DragDropManager finish drop, start do drop animation. UseCustomAnimation is %{public}d." + TAG_LOGI(AceLogTag::ACE_DRAG, + "DragDropManager finish drop, start do drop animation. UseCustomAnimation is %{public}d." " WindowId is %{public}d.", event->IsUseCustomAnimation(), container->GetWindowId()); } auto pipeline = PipelineContext::GetCurrentContext(); @@ -591,13 +571,6 @@ void DragDropManager::RequireSummary() { std::string udKey; InteractionInterface::GetInstance()->GetUdKey(udKey); - if (SystemProperties::GetDebugEnabled()) { - if (udKey.empty()) { - LOGW("Requiry summary get empty udKey."); - } else { - LOGI("Requiry summary get udKey %{public}s", udKey.c_str()); - } - } std::map summary; int32_t ret = UdmfClient::GetInstance()->GetSummary(udKey, summary); if (ret != 0) { @@ -628,8 +601,6 @@ Rect DragDropManager::GetDragWindowRect(const Point& point) int retOffset = InteractionInterface::GetInstance()->GetShadowOffset(shadowOffsetData); if (retOffset == 0) { previewRect_ = Rect(x, y, width, height); - } else if (SystemProperties::GetDebugEnabled()) { - LOGW("InteractionInterface GetShadowOffset is failed:%{public}d", retOffset); } } return previewRect_ + Offset(point.GetX(), point.GetY()); @@ -654,7 +625,6 @@ void DragDropManager::OnTextDragEnd(float globalX, float globalY, const std::str textFieldPattern->InsertValue(extraInfo); } } - LOGI("OnTextDragEnd"); SetIsDragged(false); currentId_ = -1; } @@ -973,10 +943,6 @@ void DragDropManager::GetExtraInfoFromClipboard(std::string& extraInfo) } extraInfo = extraInfo_; - if (SystemProperties::GetDebugEnabled()) { - LOGI("DragDropManager get extra info from clipBoard, extraInfo is %{public}s", - extraInfo_.c_str()); - } } void DragDropManager::RestoreClipboardData() @@ -1023,7 +989,6 @@ void DragDropManager::DestroyDragWindow() if (dragWindowRootNode_) { dragWindowRootNode_ = nullptr; } - LOGI("DestroyDragWindow"); SetIsDragged(false); SetIsDragWindowShow(false); previewRect_ = Rect(-1, -1, -1, -1); @@ -1072,7 +1037,6 @@ void DragDropManager::UpdateDragEvent(RefPtr& event, const std::string udKey; InteractionInterface::GetInstance()->GetUdKey(udKey); if (udKey.empty()) { - LOGW("InteractionInterface GetUdkey is null"); event->SetIsGetDataSuccess(false); } else { event->SetUdKey(udKey); @@ -1080,7 +1044,6 @@ void DragDropManager::UpdateDragEvent(RefPtr& event, const RefPtr udData = UdmfClient::GetInstance()->CreateUnifiedData(); int ret = UdmfClient::GetInstance()->GetData(udData, udKey); if (ret != 0) { - LOGW("UDMF GetData failed: %{public}d", ret); event->SetIsGetDataSuccess(false); } else { event->SetIsGetDataSuccess(true); @@ -1100,7 +1063,6 @@ void DragDropManager::UpdateDragEvent(RefPtr& event, const } else { previewRect_ = Rect(x, y, width, height); event->SetPreviewRect(previewRect_); - LOGW("InteractionInterface GetShadowOffset is failed:%{public}d", retOffset); } #endif // ENABLE_DRAG_FRAMEWORK }