diff --git a/dmserver/src/screen_rotation_controller.cpp b/dmserver/src/screen_rotation_controller.cpp index 03d68c40fa3087aea0ac0aa82fabfdf53f235914..7f843b2da3d3a76e730a7156eea362933d401ca9 100644 --- a/dmserver/src/screen_rotation_controller.cpp +++ b/dmserver/src/screen_rotation_controller.cpp @@ -286,7 +286,7 @@ DeviceRotation ScreenRotationController::CalcDeviceRotation(SensorRotation senso bool ScreenRotationController::IsSensorRelatedOrientation(Orientation orientation) { - if ((orientation >= Orientation::VERTICAL && orientation <= Orientation::REVERSE_HORIZONTAL) || + if ((orientation >= Orientation::UNSPECIFIED && orientation <= Orientation::REVERSE_HORIZONTAL) || orientation == Orientation::LOCKED) { return false; } @@ -301,7 +301,6 @@ void ScreenRotationController::ProcessSwitchToSensorRelatedOrientation( } lastOrientationType_ = orientation; switch (orientation) { - case Orientation::UNSPECIFIED: case Orientation::AUTO_ROTATION_RESTRICTED: { if (isScreenRotationLocked_) { SetScreenRotation(rotationLockedRotation_); @@ -499,6 +498,10 @@ void ScreenRotationController::ProcessSwitchToSensorUnrelatedOrientation(Orienta } lastOrientationType_ = orientation; switch (orientation) { + case Orientation::UNSPECIFIED: { + SetScreenRotation(Rotation::ROTATION_0); + break; + } case Orientation::VERTICAL: { SetScreenRotation(ConvertDeviceToDisplayRotation(DeviceRotation::ROTATION_PORTRAIT)); break;