diff --git a/dmserver/src/abstract_display_controller.cpp b/dmserver/src/abstract_display_controller.cpp index 1ba4ffe3..7ced2975 100644 --- a/dmserver/src/abstract_display_controller.cpp +++ b/dmserver/src/abstract_display_controller.cpp @@ -366,8 +366,13 @@ void AbstractDisplayController::BindAloneScreenLocked(sptr realA return; } if (dummyDisplay_ == nullptr) { - sptr display = new AbstractDisplay(displayCount_.fetch_add(1), + sptr display = new(std::nothrow) AbstractDisplay(displayCount_.fetch_add(1), realAbsScreen->dmsId_, info->width_, info->height_, info->refreshRate_); + if (display == nullptr) { + WLOGFE("create display failed"); + return; + } + abstractDisplayMap_.insert((std::make_pair(display->GetId(), display))); WLOGI("create display for new screen. screen:%{public}" PRIu64", display:%{public}" PRIu64"", realAbsScreen->dmsId_, display->GetId()); @@ -447,14 +452,14 @@ void AbstractDisplayController::SetFreeze(std::vector displayIds, boo std::lock_guard lock(mutex_); auto iter = abstractDisplayMap_.find(displayId); if (iter == abstractDisplayMap_.end()) { - WLOGI("setfreeze fail, cannot get display %{public}" PRIu64"", displayId); + WLOGE("setfreeze fail, cannot get display %{public}" PRIu64"", displayId); continue; } abstractDisplay = iter->second; FreezeFlag curFlag = abstractDisplay->GetFreezeFlag(); if ((toFreeze && (curFlag == FreezeFlag::FREEZING)) || (!toFreeze && (curFlag == FreezeFlag::UNFREEZING))) { - WLOGI("setfreeze fail, display %{public}" PRIu64" freezeflag is %{public}u", + WLOGE("setfreeze fail, display %{public}" PRIu64" freezeflag is %{public}u", displayId, curFlag); continue; } diff --git a/dmserver/src/abstract_screen_controller.cpp b/dmserver/src/abstract_screen_controller.cpp index 29442ef8..312c6798 100644 --- a/dmserver/src/abstract_screen_controller.cpp +++ b/dmserver/src/abstract_screen_controller.cpp @@ -341,7 +341,11 @@ bool AbstractScreenController::FillAbstractScreen(sptr& absScree return false; } for (const RSScreenModeInfo& rsScreenModeInfo : allModes) { - sptr info = new SupportedScreenModes(); + sptr info = new(std::nothrow) SupportedScreenModes(); + if (info == nullptr) { + WLOGFE("create SupportedScreenModes failed"); + return false; + } info->width_ = static_cast(rsScreenModeInfo.GetScreenWidth()); info->height_ = static_cast(rsScreenModeInfo.GetScreenHeight()); info->refreshRate_ = rsScreenModeInfo.GetScreenRefreshRate(); diff --git a/utils/src/surface_reader.cpp b/utils/src/surface_reader.cpp index c06e36bb..0d9c1952 100644 --- a/utils/src/surface_reader.cpp +++ b/utils/src/surface_reader.cpp @@ -131,11 +131,17 @@ bool SurfaceReader::ProcessBuffer(const sptr &buf) errno_t ret = memcpy_s(data + width * i * BPP, width * BPP, addr + stride * i, width * BPP); if (ret != EOK) { WLOGFE("memcpy failed"); + free(data); return false; } } - sptr pixelMap = new PixelMap(); + sptr pixelMap = new(std::nothrow) PixelMap(); + if (pixelMap == nullptr) { + WLOGFE("create pixelMap failed"); + return false; + } + ImageInfo info; info.size.width = static_cast(width); info.size.height = static_cast(height); diff --git a/wm/src/window_impl.cpp b/wm/src/window_impl.cpp index 02a38cce..2c3108c9 100644 --- a/wm/src/window_impl.cpp +++ b/wm/src/window_impl.cpp @@ -365,7 +365,7 @@ WMError WindowImpl::SetUIContent(const std::string& contentInfo, WLOGFI("SetUIContent contentInfo: %{public}s", contentInfo.c_str()); uiContent_ = Ace::UIContent::Create(context_.get(), engine); if (uiContent_ == nullptr) { - WLOGFE("fail to SetUIContent id: %{public}d", property_->GetWindowId()); + WLOGFE("fail to SetUIContent id: %{public}u", property_->GetWindowId()); return WMError::WM_ERROR_NULLPTR; } if (isdistributed) { @@ -401,7 +401,7 @@ std::string WindowImpl::GetContentInfo() { WLOGFI("GetContentInfo"); if (uiContent_ == nullptr) { - WLOGFE("fail to GetContentInfo id: %{public}d", property_->GetWindowId()); + WLOGFE("fail to GetContentInfo id: %{public}u", property_->GetWindowId()); return ""; } return uiContent_->GetContentInfo(); @@ -454,7 +454,7 @@ void WindowImpl::DumpInfo(const std::vector& params, std::vectorGetWindowId(), static_cast(type), property.enable_, property.backgroundColor_, property.contentColor_); @@ -470,7 +470,7 @@ WMError WindowImpl::SetSystemBarProperty(WindowType type, const SystemBarPropert } WMError ret = UpdateProperty(PropertyChangeAction::ACTION_UPDATE_OTHER_PROPS); if (ret != WMError::WM_OK) { - WLOGFE("SetSystemBarProperty errCode:%{public}d winId:%{public}d", + WLOGFE("SetSystemBarProperty errCode:%{public}d winId:%{public}u", static_cast(ret), property_->GetWindowId()); } return ret; @@ -478,27 +478,27 @@ WMError WindowImpl::SetSystemBarProperty(WindowType type, const SystemBarPropert WMError WindowImpl::SetLayoutFullScreen(bool status) { - WLOGFI("[Client] Window %{public}d SetLayoutFullScreen: %{public}d", property_->GetWindowId(), status); + WLOGFI("[Client] Window %{public}u SetLayoutFullScreen: %{public}d", property_->GetWindowId(), status); if (!IsWindowValid()) { return WMError::WM_ERROR_INVALID_WINDOW; } WMError ret = SetWindowMode(WindowMode::WINDOW_MODE_FULLSCREEN); if (ret != WMError::WM_OK) { - WLOGFE("SetWindowMode errCode:%{public}d winId:%{public}d", + WLOGFE("SetWindowMode errCode:%{public}d winId:%{public}u", static_cast(ret), property_->GetWindowId()); return ret; } if (status) { ret = RemoveWindowFlag(WindowFlag::WINDOW_FLAG_NEED_AVOID); if (ret != WMError::WM_OK) { - WLOGFE("RemoveWindowFlag errCode:%{public}d winId:%{public}d", + WLOGFE("RemoveWindowFlag errCode:%{public}d winId:%{public}u", static_cast(ret), property_->GetWindowId()); return ret; } } else { ret = AddWindowFlag(WindowFlag::WINDOW_FLAG_NEED_AVOID); if (ret != WMError::WM_OK) { - WLOGFE("AddWindowFlag errCode:%{public}d winId:%{public}d", + WLOGFE("AddWindowFlag errCode:%{public}d winId:%{public}u", static_cast(ret), property_->GetWindowId()); return ret; } @@ -508,7 +508,7 @@ WMError WindowImpl::SetLayoutFullScreen(bool status) WMError WindowImpl::SetFullScreen(bool status) { - WLOGFI("[Client] Window %{public}d SetFullScreen: %{public}d", property_->GetWindowId(), status); + WLOGFI("[Client] Window %{public}d SetFullScreen: %{public}u", property_->GetWindowId(), status); SystemBarProperty statusProperty = GetSystemBarPropertyByType( WindowType::WINDOW_TYPE_STATUS_BAR); SystemBarProperty naviProperty = GetSystemBarPropertyByType( @@ -522,17 +522,17 @@ WMError WindowImpl::SetFullScreen(bool status) } WMError ret = SetSystemBarProperty(WindowType::WINDOW_TYPE_STATUS_BAR, statusProperty); if (ret != WMError::WM_OK) { - WLOGFE("SetSystemBarProperty errCode:%{public}d winId:%{public}d", + WLOGFE("SetSystemBarProperty errCode:%{public}d winId:%{public}u", static_cast(ret), property_->GetWindowId()); } ret = SetSystemBarProperty(WindowType::WINDOW_TYPE_NAVIGATION_BAR, naviProperty); if (ret != WMError::WM_OK) { - WLOGFE("SetSystemBarProperty errCode:%{public}d winId:%{public}d", + WLOGFE("SetSystemBarProperty errCode:%{public}d winId:%{public}u", static_cast(ret), property_->GetWindowId()); } ret = SetLayoutFullScreen(status); if (ret != WMError::WM_OK) { - WLOGFE("SetLayoutFullScreen errCode:%{public}d winId:%{public}d", + WLOGFE("SetLayoutFullScreen errCode:%{public}d winId:%{public}u", static_cast(ret), property_->GetWindowId()); } return ret; @@ -549,7 +549,7 @@ void WindowImpl::MapFloatingWindowToAppIfNeeded() if (win->GetType() == WindowType::WINDOW_TYPE_APP_MAIN_WINDOW && context_.get() == win->GetContext().get()) { appFloatingWindowMap_[win->GetWindowId()].push_back(this); - WLOGFI("Map FloatingWindow %{public}d to AppMainWindow %{public}d", GetWindowId(), win->GetWindowId()); + WLOGFI("Map FloatingWindow %{public}u to AppMainWindow %{public}u", GetWindowId(), win->GetWindowId()); return; } } @@ -693,7 +693,7 @@ WMError WindowImpl::Destroy(bool needNotifyServer) return WMError::WM_OK; } - WLOGFI("[Client] Window %{public}d Destroy", property_->GetWindowId()); + WLOGFI("[Client] Window %{public}u Destroy", property_->GetWindowId()); InputTransferStation::GetInstance().RemoveInputWindow(this); WMError ret = WMError::WM_OK; if (needNotifyServer) { @@ -738,10 +738,10 @@ WMError WindowImpl::Show(uint32_t reason) } if (state_ == WindowState::STATE_SHOWN) { if (property_->GetWindowType() == WindowType::WINDOW_TYPE_DESKTOP) { - WLOGFI("desktop window [id:%{public}d] is shown, minimize all app windows", property_->GetWindowId()); + WLOGFI("desktop window [id:%{public}u] is shown, minimize all app windows", property_->GetWindowId()); SingletonContainer::Get().MinimizeAllAppWindows(property_->GetDisplayId()); } else { - WLOGFI("window is already shown id: %{public}d, raise to top", property_->GetWindowId()); + WLOGFI("window is already shown id: %{public}u, raise to top", property_->GetWindowId()); SingletonContainer::Get().ProcessPointDown(property_->GetWindowId()); } for (auto& listener : lifecycleListeners_) { @@ -759,14 +759,14 @@ WMError WindowImpl::Show(uint32_t reason) HandleKeepScreenOn(keepScreenOn_); HandleTurnScreenOn(); } else { - WLOGFE("show errCode:%{public}d for winId:%{public}d", static_cast(ret), property_->GetWindowId()); + WLOGFE("show errCode:%{public}d for winId:%{public}u", static_cast(ret), property_->GetWindowId()); } return ret; } WMError WindowImpl::Hide(uint32_t reason) { - WLOGFI("[Client] Window [name:%{public}s, id:%{public}d] Hide", name_.c_str(), property_->GetWindowId()); + WLOGFI("[Client] Window [name:%{public}s, id:%{public}u] Hide", name_.c_str(), property_->GetWindowId()); if (!IsWindowValid()) { return WMError::WM_ERROR_INVALID_WINDOW; } @@ -777,12 +777,12 @@ WMError WindowImpl::Hide(uint32_t reason) return WMError::WM_OK; } if (state_ == WindowState::STATE_HIDDEN || state_ == WindowState::STATE_CREATED) { - WLOGFI("window is already hidden id: %{public}d", property_->GetWindowId()); + WLOGFI("window is already hidden id: %{public}u", property_->GetWindowId()); return WMError::WM_OK; } WMError ret = SingletonContainer::Get().RemoveWindow(property_->GetWindowId()); if (ret != WMError::WM_OK) { - WLOGFE("hide errCode:%{public}d for winId:%{public}d", static_cast(ret), property_->GetWindowId()); + WLOGFE("hide errCode:%{public}d for winId:%{public}u", static_cast(ret), property_->GetWindowId()); return ret; } state_ = WindowState::STATE_HIDDEN; @@ -800,7 +800,7 @@ WMError WindowImpl::MoveTo(int32_t x, int32_t y) Rect rect = GetRect(); Rect moveRect = { x, y, rect.width_, rect.height_ }; if (state_ == WindowState::STATE_HIDDEN || state_ == WindowState::STATE_CREATED) { - WLOGFI("window is hidden or created! id: %{public}d, oriPos: [%{public}d, %{public}d, " + WLOGFI("window is hidden or created! id: %{public}u, oriPos: [%{public}d, %{public}d, " "movePos: [%{public}d, %{public}d]", property_->GetWindowId(), rect.posX_, rect.posY_, x, y); property_->SetWindowRect(moveRect); return WMError::WM_OK; @@ -819,7 +819,7 @@ WMError WindowImpl::Resize(uint32_t width, uint32_t height) Rect rect = GetRect(); Rect resizeRect = { rect.posX_, rect.posY_, width, height }; if (state_ == WindowState::STATE_HIDDEN || state_ == WindowState::STATE_CREATED) { - WLOGFI("window is hidden or created! id: %{public}d, oriRect: [%{public}u, %{public}u], " + WLOGFI("window is hidden or created! id: %{public}u, oriRect: [%{public}u, %{public}u], " "resizeRect: [%{public}u, %{public}u]", property_->GetWindowId(), rect.width_, rect.height_, width, height); property_->SetWindowRect(resizeRect); @@ -906,7 +906,7 @@ bool WindowImpl::IsDecorEnable() const WMError WindowImpl::Maximize() { - WLOGFI("[Client] Window %{public}d Maximize", property_->GetWindowId()); + WLOGFI("[Client] Window %{public}u Maximize", property_->GetWindowId()); if (!IsWindowValid()) { return WMError::WM_ERROR_INVALID_WINDOW; } @@ -920,7 +920,7 @@ WMError WindowImpl::Maximize() WMError WindowImpl::Minimize() { - WLOGFI("[Client] Window %{public}d Minimize", property_->GetWindowId()); + WLOGFI("[Client] Window %{public}u Minimize", property_->GetWindowId()); if (!IsWindowValid()) { return WMError::WM_ERROR_INVALID_WINDOW; } @@ -936,7 +936,7 @@ WMError WindowImpl::Minimize() WMError WindowImpl::Recover() { - WLOGFI("[Client] Window %{public}d Normalize", property_->GetWindowId()); + WLOGFI("[Client] Window %{public}u Normalize", property_->GetWindowId()); if (!IsWindowValid()) { return WMError::WM_ERROR_INVALID_WINDOW; } @@ -948,7 +948,7 @@ WMError WindowImpl::Recover() WMError WindowImpl::Close() { - WLOGFI("[Client] Window %{public}d Close", property_->GetWindowId()); + WLOGFI("[Client] Window %{public}u Close", property_->GetWindowId()); if (!IsWindowValid()) { return WMError::WM_ERROR_INVALID_WINDOW; } @@ -1471,7 +1471,7 @@ void WindowImpl::UpdateFocusStatus(bool focused) void WindowImpl::UpdateConfiguration(const std::shared_ptr& configuration) { if (uiContent_ != nullptr) { - WLOGFD("notify ace winId:%{public}d", GetWindowId()); + WLOGFD("notify ace winId:%{public}u", GetWindowId()); uiContent_->UpdateConfiguration(configuration); } if (subWindowMap_.count(GetWindowId()) == 0) { @@ -1484,7 +1484,7 @@ void WindowImpl::UpdateConfiguration(const std::shared_ptr& avoidArea) { - WLOGFI("Window Update AvoidArea, id: %{public}d", property_->GetWindowId()); + WLOGFI("Window Update AvoidArea, id: %{public}u", property_->GetWindowId()); for (auto& listener : avoidAreaChangeListeners_) { if (listener != nullptr) { listener->OnAvoidAreaChanged(avoidArea); @@ -1502,7 +1502,7 @@ void WindowImpl::UpdateWindowState(WindowState state) switch (state) { case WindowState::STATE_FROZEN: { if (abilityContext != nullptr && windowTag_ == WindowTag::MAIN_WINDOW) { - WLOGFD("DoAbilityBackground KEYGUARD, id: %{public}d", GetWindowId()); + WLOGFD("DoAbilityBackground KEYGUARD, id: %{public}u", GetWindowId()); AAFwk::AbilityManagerClient::GetInstance()->DoAbilityBackground(abilityContext->GetToken(), static_cast(WindowStateChangeReason::KEYGUARD)); } else { @@ -1514,7 +1514,7 @@ void WindowImpl::UpdateWindowState(WindowState state) } case WindowState::STATE_UNFROZEN: { if (abilityContext != nullptr && windowTag_ == WindowTag::MAIN_WINDOW) { - WLOGFD("DoAbilityForeground KEYGUARD, id: %{public}d", GetWindowId()); + WLOGFD("DoAbilityForeground KEYGUARD, id: %{public}u", GetWindowId()); AAFwk::AbilityManagerClient::GetInstance()->DoAbilityForeground(abilityContext->GetToken(), static_cast(WindowStateChangeReason::KEYGUARD)); } else { @@ -1545,7 +1545,7 @@ void WindowImpl::UpdateDragEvent(const PointInfo& point, DragEvent event) void WindowImpl::UpdateDisplayId(DisplayId from, DisplayId to) { - WLOGFD("update displayId. win %{public}d", GetWindowId()); + WLOGFD("update displayId. win %{public}u", GetWindowId()); for (auto& listener : displayMoveListeners_) { if (listener != nullptr) { listener->OnDisplayMove(from, to); @@ -1556,7 +1556,7 @@ void WindowImpl::UpdateDisplayId(DisplayId from, DisplayId to) void WindowImpl::UpdateOccupiedAreaChangeInfo(const sptr& info) { - WLOGFI("Window Update OccupiedArea, id: %{public}d", property_->GetWindowId()); + WLOGFI("Window Update OccupiedArea, id: %{public}u", property_->GetWindowId()); for (auto& listener : occupiedAreaChangeListeners_) { if (listener != nullptr) { listener->OnSizeChange(info); diff --git a/wm/src/window_input_channel.cpp b/wm/src/window_input_channel.cpp index faa1ad5b..c24aa856 100644 --- a/wm/src/window_input_channel.cpp +++ b/wm/src/window_input_channel.cpp @@ -33,7 +33,7 @@ void WindowInputChannel::HandleKeyEvent(std::shared_ptr& keyEvent WLOGFE("keyEvent is nullptr"); return; } - WLOGFI("Receive key event, windowId: %{public}d, keyCode: %{public}d", + WLOGFI("Receive key event, windowId: %{public}u, keyCode: %{public}d", window_->GetWindowId(), keyEvent->GetKeyCode()); bool isKeyboardEvent = IsKeyboardEvent(keyEvent); bool inputMethodHasProcessed = false; @@ -80,13 +80,13 @@ void WindowInputChannel::HandlePointerEvent(std::shared_ptr& pointerEvent->MarkProcessed(); } } - WLOGFI("Receive move event, windowId: %{public}d, action: %{public}d", + WLOGFI("Receive move event, windowId: %{public}u, action: %{public}d", window_->GetWindowId(), pointerEvent->GetPointerAction()); if (pointerEventTemp != nullptr) { pointerEventTemp->MarkProcessed(); } } else { - WLOGFI("Dispatch non-move event, windowId: %{public}d, action: %{public}d", + WLOGFI("Dispatch non-move event, windowId: %{public}u, action: %{public}d", window_->GetWindowId(), pointerEvent->GetPointerAction()); window_->ConsumePointerEvent(pointerEvent); pointerEvent->MarkProcessed(); @@ -105,7 +105,7 @@ void WindowInputChannel::OnVsync(int64_t timeStamp) WLOGFE("moveEvent_ is nullptr"); return; } - WLOGFI("Dispatch move event, windowId: %{public}d, action: %{public}d", + WLOGFI("Dispatch move event, windowId: %{public}u, action: %{public}d", window_->GetWindowId(), pointerEvent->GetPointerAction()); window_->ConsumePointerEvent(pointerEvent); pointerEvent->MarkProcessed(); @@ -119,7 +119,7 @@ void WindowInputChannel::SetInputListener(const std::shared_ptr lock(mtx_); - WLOGFI("Destroy WindowInputChannel, windowId:%{public}d", window_->GetWindowId()); + WLOGFI("Destroy WindowInputChannel, windowId:%{public}u", window_->GetWindowId()); isAvailable_ = false; VsyncStation::GetInstance().RemoveCallback(VsyncStation::CallbackType::CALLBACK_INPUT, callback_); if (moveEvent_ != nullptr) { diff --git a/wm/src/window_scene.cpp b/wm/src/window_scene.cpp index 11c4f411..79be643a 100644 --- a/wm/src/window_scene.cpp +++ b/wm/src/window_scene.cpp @@ -154,7 +154,7 @@ void WindowScene::UpdateConfiguration(const std::shared_ptrGetWindowId()); + WLOGFI("notify mainWindow winId:%{public}u", mainWindow_->GetWindowId()); mainWindow_->UpdateConfiguration(configuration); } diff --git a/wmserver/src/freeze_controller.cpp b/wmserver/src/freeze_controller.cpp index 13974824..0517b7fb 100644 --- a/wmserver/src/freeze_controller.cpp +++ b/wmserver/src/freeze_controller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2022 Huawei Device Co., Ltd. + * 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 diff --git a/wmserver/src/input_window_monitor.cpp b/wmserver/src/input_window_monitor.cpp index c976767c..79811d9b 100644 --- a/wmserver/src/input_window_monitor.cpp +++ b/wmserver/src/input_window_monitor.cpp @@ -138,7 +138,7 @@ void InputWindowMonitor::TraverseWindowNodes(const std::vector> iter->windowsInfo.clear(); for (auto& windowNode: windowNodes) { if (windowTypeSkipped_.find(windowNode->GetWindowProperty()->GetWindowType()) != windowTypeSkipped_.end()) { - WLOGFI("window has been skipped. [id: %{public}d, type: %{public}d]", windowNode->GetWindowId(), + WLOGFI("window has been skipped. [id: %{public}u, type: %{public}d]", windowNode->GetWindowId(), windowNode->GetWindowProperty()->GetWindowType()); continue; } diff --git a/wmserver/src/window_layout_policy_cascade.cpp b/wmserver/src/window_layout_policy_cascade.cpp index 144b0366..e6c3ee0e 100644 --- a/wmserver/src/window_layout_policy_cascade.cpp +++ b/wmserver/src/window_layout_policy_cascade.cpp @@ -62,7 +62,7 @@ void WindowLayoutPolicyCascade::LayoutWindowNode(sptr& node) } if (node->parent_ != nullptr) { // isn't root node if (!node->currentVisibility_) { - WLOGFI("window[%{public}d] currently not visible, no need layout", node->GetWindowId()); + WLOGFI("window[%{public}u] currently not visible, no need layout", node->GetWindowId()); return; } UpdateLayoutRect(node); @@ -369,7 +369,7 @@ void WindowLayoutPolicyCascade::Reorder() node->SetWindowMode(WindowMode::WINDOW_MODE_FLOATING); node->GetWindowToken()->UpdateWindowMode(WindowMode::WINDOW_MODE_FLOATING); } - WLOGFI("Cascade reorder Id: %{public}d, rect:[%{public}d, %{public}d, %{public}d, %{public}d]", + WLOGFI("Cascade reorder Id: %{public}u, rect:[%{public}d, %{public}d, %{public}d, %{public}d]", node->GetWindowId(), rect.posX_, rect.posY_, rect.width_, rect.height_); } } @@ -381,7 +381,7 @@ Rect WindowLayoutPolicyCascade::GetCurCascadeRect(const sptr& node) { Rect cascadeRect = {0, 0, 0, 0}; for (auto iter = appWindowNode_->children_.rbegin(); iter != appWindowNode_->children_.rend(); iter++) { - WLOGFI("GetCurCascadeRect id: %{public}d,", (*iter)->GetWindowId()); + WLOGFI("GetCurCascadeRect id: %{public}u,", (*iter)->GetWindowId()); if ((*iter)->GetWindowType() != WindowType::WINDOW_TYPE_DOCK_SLICE && (*iter)->GetWindowId() != node->GetWindowId()) { auto property = (*iter)->GetWindowProperty(); diff --git a/wmserver/src/window_layout_policy_tile.cpp b/wmserver/src/window_layout_policy_tile.cpp index 92a5f36e..669e00b7 100644 --- a/wmserver/src/window_layout_policy_tile.cpp +++ b/wmserver/src/window_layout_policy_tile.cpp @@ -123,7 +123,7 @@ void WindowLayoutPolicyTile::UpdateWindowNode(sptr& node, bool isAdd void WindowLayoutPolicyTile::RemoveWindowNode(sptr& node) { WM_FUNCTION_TRACE(); - WLOGFI("RemoveWindowNode %{public}d in tile", node->GetWindowId()); + WLOGFI("RemoveWindowNode %{public}u in tile", node->GetWindowId()); auto type = node->GetWindowType(); // affect other windows, trigger off global layout if (avoidTypes_.find(type) != avoidTypes_.end()) { @@ -169,13 +169,13 @@ void WindowLayoutPolicyTile::ForegroundNodeQueuePushBack(sptr& node) if (node == nullptr) { return; } - WLOGFI("add win in tile for win id: %{public}d", node->GetWindowId()); + WLOGFI("add win in tile for win id: %{public}u", node->GetWindowId()); while (foregroundNodes_.size() >= maxTileWinNum_) { auto removeNode = foregroundNodes_.front(); foregroundNodes_.pop_front(); - WLOGFI("pop win in queue head id: %{public}d, for add new win", removeNode->GetWindowId()); + WLOGFI("pop win in queue head id: %{public}u, for add new win", removeNode->GetWindowId()); if (removeNode->abilityToken_ != nullptr) { - WLOGFI("minimize win %{public}d in tile", removeNode->GetWindowId()); + WLOGFI("minimize win %{public}u in tile", removeNode->GetWindowId()); AAFwk::AbilityManagerClient::GetInstance()->MinimizeAbility(removeNode->abilityToken_); } } @@ -189,7 +189,7 @@ void WindowLayoutPolicyTile::ForegroundNodeQueueRemove(sptr& node) } auto iter = std::find(foregroundNodes_.begin(), foregroundNodes_.end(), node); if (iter != foregroundNodes_.end()) { - WLOGFI("remove win in tile for win id: %{public}d", node->GetWindowId()); + WLOGFI("remove win in tile for win id: %{public}u", node->GetWindowId()); foregroundNodes_.erase(iter); } } @@ -214,7 +214,7 @@ void WindowLayoutPolicyTile::AssignNodePropertyForTileWindows() node->GetWindowToken()->UpdateWindowMode(WindowMode::WINDOW_MODE_FLOATING); node->SetWindowRect(rect); node->hasDecorated_ = true; - WLOGFI("set rect for qwin id: %{public}d [%{public}d %{public}d %{public}d %{public}d]", + WLOGFI("set rect for qwin id: %{public}u [%{public}d %{public}d %{public}d %{public}d]", node->GetWindowId(), rect.posX_, rect.posY_, rect.width_, rect.height_); rectIt++; } @@ -236,7 +236,7 @@ void WindowLayoutPolicyTile::UpdateLayoutRect(sptr& node) Rect limitRect = displayRect; Rect winRect = node->GetWindowProperty()->GetWindowRect(); - WLOGFI("Id:%{public}d, avoid:%{public}d parLimit:%{public}d floating:%{public}d, sub:%{public}d, " \ + WLOGFI("Id:%{public}u, avoid:%{public}d parLimit:%{public}d floating:%{public}d, sub:%{public}d, " \ "deco:%{public}d, type:%{public}d, requestRect:[%{public}d, %{public}d, %{public}d, %{public}d]", node->GetWindowId(), needAvoid, parentLimit, floatingWindow, subWindow, decorEnbale, static_cast(type), winRect.posX_, winRect.posY_, winRect.width_, winRect.height_); diff --git a/wmserver/src/window_manager_service.cpp b/wmserver/src/window_manager_service.cpp index 8eb40faa..357c5ba8 100644 --- a/wmserver/src/window_manager_service.cpp +++ b/wmserver/src/window_manager_service.cpp @@ -133,7 +133,7 @@ WMError WindowManagerService::AddWindow(sptr& property) "%{public}4d %{public}4d]", windowId, property->GetWindowType(), property->GetWindowMode(), property->GetWindowFlags(), rect.posX_, rect.posY_, rect.width_, rect.height_); - WM_SCOPED_TRACE("wms:AddWindow(%d)", windowId); + WM_SCOPED_TRACE("wms:AddWindow(%u)", windowId); std::lock_guard lock(mutex_); WMError res = windowController_->AddWindowNode(property); if (property->GetWindowType() == WindowType::WINDOW_TYPE_DRAGGING_EFFECT) { diff --git a/wmserver/src/window_node_container.cpp b/wmserver/src/window_node_container.cpp index 5be26e6f..65136c05 100644 --- a/wmserver/src/window_node_container.cpp +++ b/wmserver/src/window_node_container.cpp @@ -140,7 +140,7 @@ WMError WindowNodeContainer::AddWindowNode(sptr& node, sptrGetWindowId()); + WLOGFI("AddWindowNode windowId: %{public}u end", node->GetWindowId()); return WMError::WM_OK; } @@ -161,7 +161,7 @@ WMError WindowNodeContainer::UpdateWindowNode(sptr& node, WindowUpda NotifyIfSystemBarTintChanged(); } DumpScreenWindowTree(); - WLOGFI("UpdateWindowNode windowId: %{public}d end", node->GetWindowId()); + WLOGFI("UpdateWindowNode windowId: %{public}u end", node->GetWindowId()); return WMError::WM_OK; } @@ -173,14 +173,14 @@ void WindowNodeContainer::UpdateSizeChangeReason(sptr& node, WindowS childNode->GetWindowToken()->UpdateWindowRect(childNode->GetLayoutRect(), reason); childNode->ResetWindowSizeChangeReason(); WLOGFI("Notify split window that the drag action is start or end, windowId: %{public}d, " - "reason: %{public}d", childNode->GetWindowId(), reason); + "reason: %{public}u", childNode->GetWindowId(), reason); } } } else { node->GetWindowToken()->UpdateWindowRect(node->GetLayoutRect(), reason); node->ResetWindowSizeChangeReason(); WLOGFI("Notify window that the drag action is start or end, windowId: %{public}d, " - "reason: %{public}d", node->GetWindowId(), reason); + "reason: %{public}u", node->GetWindowId(), reason); } } @@ -312,7 +312,7 @@ WMError WindowNodeContainer::RemoveWindowNode(sptr& node) UpdateWindowVisibilityInfos(infos); DumpScreenWindowTree(); NotifyAccessibilityWindowInfo(node, WindowUpdateType::WINDOW_UPDATE_REMOVED); - WLOGFI("RemoveWindowNode windowId: %{public}d end", node->GetWindowId()); + WLOGFI("RemoveWindowNode windowId: %{public}u end", node->GetWindowId()); return WMError::WM_OK; } @@ -618,7 +618,7 @@ void WindowNodeContainer::RaiseOrderedWindowToTop(std::vector orderedI sptr node = *iter; iter = windowNodes.erase(iter); UpdateWindowTree(node); - WLOGFI("raise group window to top %{public}d", node->GetWindowId()); + WLOGFI("raise group window to top %{public}u", node->GetWindowId()); } else { iter++; } @@ -637,7 +637,7 @@ void WindowNodeContainer::RaiseWindowToTop(uint32_t windowId, std::vector node = *iter; windowNodes.erase(iter); UpdateWindowTree(node); - WLOGFI("raise window to top %{public}d", node->GetWindowId()); + WLOGFI("raise window to top %{public}u", node->GetWindowId()); } } @@ -873,7 +873,7 @@ WMError WindowNodeContainer::RaiseZOrderForAppWindow(sptr& node, spt return WMError::WM_ERROR_NULLPTR; } if (IsTopAppWindow(node->GetWindowId())) { - WLOGFI("it is already top app window, id: %{public}d", node->GetWindowId()); + WLOGFI("it is already top app window, id: %{public}u", node->GetWindowId()); return WMError::WM_ERROR_INVALID_TYPE; } if (WindowHelper::IsSubWindow(node->GetWindowType())) { @@ -1048,11 +1048,11 @@ WMError WindowNodeContainer::MinimizeAppNodeExceptOptions(bool fromUser, const s WMError WindowNodeContainer::EnterSplitWindowMode(sptr& node) { WM_FUNCTION_TRACE(); - WLOGFI("Enter split window mode: %{public}d", node->GetWindowId()); + WLOGFI("Enter split window mode: %{public}u", node->GetWindowId()); SwitchLayoutPolicy(WindowLayoutMode::CASCADE); // window split mode is belong to cascade auto pairNode = FindSplitPairNode(node); if (pairNode != nullptr) { - WLOGFI("Window %{public}d find pair %{public}d", node->GetWindowId(), pairNode->GetWindowId()); + WLOGFI("Window %{public}d find pair %{public}u", node->GetWindowId(), pairNode->GetWindowId()); WMError ret = UpdateWindowPairInfo(node, pairNode); if (ret != WMError::WM_OK) { return ret; @@ -1081,7 +1081,7 @@ void WindowNodeContainer::ResetLayoutPolicy() WMError WindowNodeContainer::ExitSplitWindowMode(sptr& node) { WM_FUNCTION_TRACE(); - WLOGFI("exit split window mode %{public}d", node->GetWindowId()); + WLOGFI("exit split window mode %{public}u", node->GetWindowId()); node->GetWindowProperty()->ResumeLastWindowMode(); node->GetWindowToken()->UpdateWindowMode(node->GetWindowMode()); if (pairedWindowMap_.count(node->GetWindowId()) != 0) { @@ -1090,11 +1090,11 @@ WMError WindowNodeContainer::ExitSplitWindowMode(sptr& node) pairNode->GetWindowToken()->UpdateWindowMode(pairNode->GetWindowMode()); pairedWindowMap_.erase(pairNode->GetWindowId()); pairedWindowMap_.erase(node->GetWindowId()); - WLOGFI("resume pair node mode, Id[%{public}d, %{public}d], Mode[%{public}d, %{public}d]", node->GetWindowId(), + WLOGFI("resume pair node mode, Id[%{public}u, %{public}u], Mode[%{public}d, %{public}d]", node->GetWindowId(), pairNode->GetWindowId(), node->GetWindowMode(), pairNode->GetWindowMode()); } if (pairedWindowMap_.empty()) { - WLOGFI("send destroy msg to divider, Id: %{public}d", node->GetWindowId()); + WLOGFI("send destroy msg to divider, Id: %{public}u", node->GetWindowId()); SingletonContainer::Get().SendMessage(INNER_WM_DESTROY_DIVIDER, displayId_); } ResetLayoutPolicy(); @@ -1116,7 +1116,7 @@ WMError WindowNodeContainer::UpdateWindowPairInfo(sptr& triggerNode, WLOGFE("Update window pair info failed"); return ret; } - WLOGFI("Pair FullScreen [%{public}d, %{public}d], Mode[%{public}d, %{public}d], splitRatio = %{public}f", + WLOGFI("Pair FullScreen [%{public}u, %{public}u], Mode[%{public}d, %{public}d], splitRatio = %{public}f", triggerNode->GetWindowId(), pairNode->GetWindowId(), triggerMode, pairDstMode, splitRatio); } else { if (pairedWindowMap_.count(pairNode->GetWindowId()) != 0) { @@ -1199,17 +1199,17 @@ void WindowNodeContainer::MoveWindowNode(sptr& container) WLOGFI("disconnect expand display: %{public}" PRId64 ", move window node to display: " "%{public}" PRId64 "", from, displayId_); for (auto& node : container->aboveAppWindowNode_->children_) { - WLOGFI("aboveAppWindowNode_: move windowNode: %{public}d", node->GetWindowId()); + WLOGFI("aboveAppWindowNode_: move windowNode: %{public}u", node->GetWindowId()); aboveAppWindowNode_->children_.push_back(node); layoutPolicy_->AddWindowNode(node); } for (auto& node : container->appWindowNode_->children_) { - WLOGFI("appWindowNode_: move windowNode: %{public}d", node->GetWindowId()); + WLOGFI("appWindowNode_: move windowNode: %{public}u", node->GetWindowId()); appWindowNode_->children_.push_back(node); layoutPolicy_->AddWindowNode(node); } for (auto& node : container->belowAppWindowNode_->children_) { - WLOGFI("belowAppWindowNode_: move windowNode: %{public}d", node->GetWindowId()); + WLOGFI("belowAppWindowNode_: move windowNode: %{public}u", node->GetWindowId()); belowAppWindowNode_->children_.push_back(node); layoutPolicy_->AddWindowNode(node); } diff --git a/wmserver/src/window_root.cpp b/wmserver/src/window_root.cpp index 2b262ec8..813290f6 100644 --- a/wmserver/src/window_root.cpp +++ b/wmserver/src/window_root.cpp @@ -119,7 +119,7 @@ WMError WindowRoot::SaveWindow(const sptr& node) WLOGFE("add window failed, node is nullptr"); return WMError::WM_ERROR_NULLPTR; } - WLOGFI("save windowId %{public}d", node->GetWindowId()); + WLOGFI("save windowId %{public}u", node->GetWindowId()); windowNodeMap_.insert(std::make_pair(node->GetWindowId(), node)); auto remoteObject = node->GetWindowToken()->AsObject(); windowIdMap_.insert(std::make_pair(remoteObject, node->GetWindowId())); diff --git a/wmserver/src/window_snapshot/snapshot_proxy.cpp b/wmserver/src/window_snapshot/snapshot_proxy.cpp index 654311d6..3843eb85 100644 --- a/wmserver/src/window_snapshot/snapshot_proxy.cpp +++ b/wmserver/src/window_snapshot/snapshot_proxy.cpp @@ -47,8 +47,7 @@ int32_t SnapshotProxy::GetSnapshot(const sptr &token, AAFwk::Snap std::shared_ptr pixelMap(reply.ReadParcelable()); snapshot.SetPixelMap(pixelMap); - int32_t ret = reply.ReadInt32(); - return ret; + return reply.ReadInt32(); } } } \ No newline at end of file