diff --git a/dm/src/zidl/display_manager_agent_stub.cpp b/dm/src/zidl/display_manager_agent_stub.cpp index 10894823e8..20416ddde3 100644 --- a/dm/src/zidl/display_manager_agent_stub.cpp +++ b/dm/src/zidl/display_manager_agent_stub.cpp @@ -99,8 +99,8 @@ int32_t DisplayManagerAgentStub::OnRemoteRequest(uint32_t code, MessageParcel& d case TRANS_ID_ON_DISPLAY_DISCONNECT: { DisplayId displayId; if (!data.ReadUint64(displayId)) { - return -1; WLOGFE("Read DisplayId failed"); + return -1; } OnDisplayDestroy(displayId); break; diff --git a/dmserver/src/screen_rotation_controller.cpp b/dmserver/src/screen_rotation_controller.cpp index b6a8081e2e..576363e0a6 100644 --- a/dmserver/src/screen_rotation_controller.cpp +++ b/dmserver/src/screen_rotation_controller.cpp @@ -278,8 +278,11 @@ DeviceRotation ScreenRotationController::CalcDeviceRotation(SensorRotation senso } if (defaultDeviceRotation_ == 1) { deviceRotationValue += defaultDeviceRotation_; - // if device's default rotation is landscape, swap 0 and 90, 180 and 270, use %2 to adjust range. - (deviceRotationValue % 2 == 0) && (deviceRotationValue -= 2); + // %2 to determine whether the rotation is horizontal or vertical. + if (deviceRotationValue % 2 == 0) { + // if device's default rotation is landscape, use -2 to swap 0 and 90, 180 and 270. + deviceRotationValue -= 2; + } } return static_cast(deviceRotationValue); } diff --git a/wmserver/src/display_zoom_controller.cpp b/wmserver/src/display_zoom_controller.cpp index 9d67c0e8bc..e96962a2f1 100644 --- a/wmserver/src/display_zoom_controller.cpp +++ b/wmserver/src/display_zoom_controller.cpp @@ -325,7 +325,6 @@ void DisplayZoomController::HandleUpdateWindowZoomInfo(sptr node) return; } Transform zoomTrans; - Transform animateTrans = node->GetWindowProperty()->GetTransform(); if (node->GetWindowProperty()->IsAnimateWindow()) { zoomTrans = CalcuAnimateZoomTrans(node); } else { diff --git a/wmserver/src/window_dumper.cpp b/wmserver/src/window_dumper.cpp index a7a267144b..4069f4dfb9 100644 --- a/wmserver/src/window_dumper.cpp +++ b/wmserver/src/window_dumper.cpp @@ -277,7 +277,6 @@ void WindowDumper::ShowHelpInfo(std::string& dumpInfo) const void WindowDumper::ShowAceDumpHelp(std::string& dumpInfo) const { - std::vector infos; auto node = windowRoot_->GetWindowForDumpAceHelpInfo(); if (node == nullptr) { WLOGFE("invalid window");