From 7f5fa86223617788ea3420e896bc96713406a8c0 Mon Sep 17 00:00:00 2001 From: zhoukai Date: Tue, 19 Nov 2024 10:53:09 +0800 Subject: [PATCH] =?UTF-8?q?window-=E9=94=99=E8=AF=AF=E7=A0=81=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhoukai --- interfaces/innerkits/wm/wm_common.h | 4 +- interfaces/kits/napi/common/js_err_utils.cpp | 47 +++++++-------- previewer/include/wm_common.h | 48 +++++++-------- utils/src/wm_common.cpp | 58 +++++++++---------- wm/src/window_scene_session_impl.cpp | 12 ++-- .../window_scene_session_impl_test4.cpp | 4 +- 6 files changed, 87 insertions(+), 86 deletions(-) diff --git a/interfaces/innerkits/wm/wm_common.h b/interfaces/innerkits/wm/wm_common.h index 51f9725f8b..c887a044e7 100644 --- a/interfaces/innerkits/wm/wm_common.h +++ b/interfaces/innerkits/wm/wm_common.h @@ -203,7 +203,7 @@ enum class WMError : int32_t { WM_ERROR_NO_REMOTE_ANIMATION, WM_ERROR_INVALID_DISPLAY, WM_ERROR_INVALID_PARENT, - WM_ERROR_OPER_FULLSCREEN_FAILED, + WM_ERROR_INVALID_OP_IN_CUR_STATUS, WM_ERROR_REPEAT_OPERATION, WM_ERROR_INVALID_SESSION, WM_ERROR_INVALID_CALLING, @@ -244,7 +244,7 @@ enum class WmErrorCode : int32_t { WM_ERROR_START_ABILITY_FAILED = 1300007, WM_ERROR_INVALID_DISPLAY = 1300008, WM_ERROR_INVALID_PARENT = 1300009, - WM_ERROR_OPER_FULLSCREEN_FAILED = 1300010, + WM_ERROR_INVALID_OP_IN_CUR_STATUS = 1300010, WM_ERROR_PIP_DESTROY_FAILED = 1300011, WM_ERROR_PIP_STATE_ABNORMALLY = 1300012, WM_ERROR_PIP_CREATE_FAILED = 1300013, diff --git a/interfaces/kits/napi/common/js_err_utils.cpp b/interfaces/kits/napi/common/js_err_utils.cpp index 837f59c88f..b10be61423 100644 --- a/interfaces/kits/napi/common/js_err_utils.cpp +++ b/interfaces/kits/napi/common/js_err_utils.cpp @@ -30,7 +30,7 @@ constexpr const char* WM_ERROR_MSG_NOT_SYSTEM_APP = "not system app"; constexpr const char* WM_ERROR_MSG_NO_REMOTE_ANIMATION = "no remote animation"; constexpr const char* WM_ERROR_MSG_INVALID_DISPLAY = "invalid display"; constexpr const char* WM_ERROR_MSG_INVALID_PARENT = "invalid parent"; -constexpr const char* WM_ERROR_MSG_OPER_FULLSCREEN_FAILED = "oper fullscreen failed"; +constexpr const char* WM_ERROR_MSG_INVALID_OP_IN_CUR_STATUS = "invalid operation in the current window status"; constexpr const char* WM_ERROR_MSG_REPEAT_OPERATION = "repeat operation"; constexpr const char* WM_ERROR_MSG_INVALID_SESSION = "invalid session"; constexpr const char* WM_ERROR_MSG_INVALID_CALLING = "invalid calling"; @@ -62,7 +62,7 @@ static std::map WM_ERROR_TO_ERROR_MSG_MAP { {WMError::WM_ERROR_NO_REMOTE_ANIMATION, WM_ERROR_MSG_NO_REMOTE_ANIMATION }, {WMError::WM_ERROR_INVALID_DISPLAY, WM_ERROR_MSG_INVALID_DISPLAY }, {WMError::WM_ERROR_INVALID_PARENT, WM_ERROR_MSG_INVALID_PARENT }, - {WMError::WM_ERROR_OPER_FULLSCREEN_FAILED, WM_ERROR_MSG_OPER_FULLSCREEN_FAILED }, + {WMError::WM_ERROR_INVALID_OP_IN_CUR_STATUS, WM_ERROR_MSG_INVALID_OP_IN_CUR_STATUS }, {WMError::WM_ERROR_REPEAT_OPERATION, WM_ERROR_MSG_REPEAT_OPERATION }, {WMError::WM_ERROR_INVALID_SESSION, WM_ERROR_MSG_INVALID_SESSION }, {WMError::WM_ERROR_INVALID_CALLING, WM_ERROR_MSG_INVALID_CALLING }, @@ -102,7 +102,8 @@ constexpr const char* WM_ERROR_CODE_MSG_CONTEXT_ABNORMALLY = "This window contex constexpr const char* WM_ERROR_CODE_MSG_START_ABILITY_FAILED = "Failed to start the ability."; constexpr const char* WM_ERROR_CODE_MSG_INVALID_DISPLAY = "The display device is abnormal."; constexpr const char* WM_ERROR_CODE_MSG_INVALID_PARENT = "The parent window is invalid."; -constexpr const char* WM_ERROR_CODE_MSG_OPER_FULLSCREEN_FAILED = "The operation is not supported in full-screen mode."; +constexpr const char* WM_ERROR_CODE_MSG_INVALID_OP_IN_CUR_STATUS = + "The operation in the current window status is invalid."; constexpr const char* WM_ERROR_CODE_MSG_PIP_DESTROY_FAILED = "Failed to destroy the PiP window."; constexpr const char* WM_ERROR_CODE_MSG_PIP_STATE_ABNORMALLY = "The PiP window state is abnormal."; constexpr const char* WM_ERROR_CODE_MSG_PIP_CREATE_FAILED = "Failed to create the PiP window."; @@ -110,26 +111,26 @@ constexpr const char* WM_ERROR_CODE_MSG_PIP_INTERNAL_ERROR = "PiP internal error constexpr const char* WM_ERROR_CODE_MSG_PIP_REPEAT_OPERATION = "Repeated PiP operation."; static std::map WM_ERROR_CODE_TO_ERROR_MSG_MAP { - {WmErrorCode::WM_OK, WM_ERROR_CODE_MSG_OK }, - {WmErrorCode::WM_ERROR_NO_PERMISSION, WM_ERROR_CODE_MSG_NO_PERMISSION }, - {WmErrorCode::WM_ERROR_NOT_SYSTEM_APP, WM_ERROR_CODE_MSG_NOT_SYSTEM_APP }, - {WmErrorCode::WM_ERROR_INVALID_PARAM, WM_ERROR_CODE_MSG_INVALID_PARAM }, - {WmErrorCode::WM_ERROR_DEVICE_NOT_SUPPORT, WM_ERROR_CODE_MSG_DEVICE_NOT_SUPPORT }, - {WmErrorCode::WM_ERROR_REPEAT_OPERATION, WM_ERROR_CODE_MSG_REPEAT_OPERATION }, - {WmErrorCode::WM_ERROR_STATE_ABNORMALLY, WM_ERROR_CODE_MSG_STATE_ABNORMALLY }, - {WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY, WM_ERROR_CODE_MSG_SYSTEM_ABNORMALLY }, - {WmErrorCode::WM_ERROR_INVALID_CALLING, WM_ERROR_CODE_MSG_INVALID_CALLING }, - {WmErrorCode::WM_ERROR_STAGE_ABNORMALLY, WM_ERROR_CODE_MSG_STAGE_ABNORMALLY }, - {WmErrorCode::WM_ERROR_CONTEXT_ABNORMALLY, WM_ERROR_CODE_MSG_CONTEXT_ABNORMALLY }, - {WmErrorCode::WM_ERROR_START_ABILITY_FAILED, WM_ERROR_CODE_MSG_START_ABILITY_FAILED }, - {WmErrorCode::WM_ERROR_INVALID_DISPLAY, WM_ERROR_CODE_MSG_INVALID_DISPLAY }, - {WmErrorCode::WM_ERROR_INVALID_PARENT, WM_ERROR_CODE_MSG_INVALID_PARENT }, - {WmErrorCode::WM_ERROR_OPER_FULLSCREEN_FAILED, WM_ERROR_CODE_MSG_OPER_FULLSCREEN_FAILED }, - {WmErrorCode::WM_ERROR_PIP_DESTROY_FAILED, WM_ERROR_CODE_MSG_PIP_DESTROY_FAILED }, - {WmErrorCode::WM_ERROR_PIP_STATE_ABNORMALLY, WM_ERROR_CODE_MSG_PIP_STATE_ABNORMALLY }, - {WmErrorCode::WM_ERROR_PIP_CREATE_FAILED, WM_ERROR_CODE_MSG_PIP_CREATE_FAILED }, - {WmErrorCode::WM_ERROR_PIP_INTERNAL_ERROR, WM_ERROR_CODE_MSG_PIP_INTERNAL_ERROR }, - {WmErrorCode::WM_ERROR_PIP_REPEAT_OPERATION, WM_ERROR_CODE_MSG_PIP_REPEAT_OPERATION }, + {WmErrorCode::WM_OK, WM_ERROR_CODE_MSG_OK }, + {WmErrorCode::WM_ERROR_NO_PERMISSION, WM_ERROR_CODE_MSG_NO_PERMISSION }, + {WmErrorCode::WM_ERROR_NOT_SYSTEM_APP, WM_ERROR_CODE_MSG_NOT_SYSTEM_APP }, + {WmErrorCode::WM_ERROR_INVALID_PARAM, WM_ERROR_CODE_MSG_INVALID_PARAM }, + {WmErrorCode::WM_ERROR_DEVICE_NOT_SUPPORT, WM_ERROR_CODE_MSG_DEVICE_NOT_SUPPORT }, + {WmErrorCode::WM_ERROR_REPEAT_OPERATION, WM_ERROR_CODE_MSG_REPEAT_OPERATION }, + {WmErrorCode::WM_ERROR_STATE_ABNORMALLY, WM_ERROR_CODE_MSG_STATE_ABNORMALLY }, + {WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY, WM_ERROR_CODE_MSG_SYSTEM_ABNORMALLY }, + {WmErrorCode::WM_ERROR_INVALID_CALLING, WM_ERROR_CODE_MSG_INVALID_CALLING }, + {WmErrorCode::WM_ERROR_STAGE_ABNORMALLY, WM_ERROR_CODE_MSG_STAGE_ABNORMALLY }, + {WmErrorCode::WM_ERROR_CONTEXT_ABNORMALLY, WM_ERROR_CODE_MSG_CONTEXT_ABNORMALLY }, + {WmErrorCode::WM_ERROR_START_ABILITY_FAILED, WM_ERROR_CODE_MSG_START_ABILITY_FAILED }, + {WmErrorCode::WM_ERROR_INVALID_DISPLAY, WM_ERROR_CODE_MSG_INVALID_DISPLAY }, + {WmErrorCode::WM_ERROR_INVALID_PARENT, WM_ERROR_CODE_MSG_INVALID_PARENT }, + {WmErrorCode::WM_ERROR_INVALID_OP_IN_CUR_STATUS, WM_ERROR_CODE_MSG_INVALID_OP_IN_CUR_STATUS }, + {WmErrorCode::WM_ERROR_PIP_DESTROY_FAILED, WM_ERROR_CODE_MSG_PIP_DESTROY_FAILED }, + {WmErrorCode::WM_ERROR_PIP_STATE_ABNORMALLY, WM_ERROR_CODE_MSG_PIP_STATE_ABNORMALLY }, + {WmErrorCode::WM_ERROR_PIP_CREATE_FAILED, WM_ERROR_CODE_MSG_PIP_CREATE_FAILED }, + {WmErrorCode::WM_ERROR_PIP_INTERNAL_ERROR, WM_ERROR_CODE_MSG_PIP_INTERNAL_ERROR }, + {WmErrorCode::WM_ERROR_PIP_REPEAT_OPERATION, WM_ERROR_CODE_MSG_PIP_REPEAT_OPERATION }, }; constexpr const char* DM_ERROR_MSG_OK = "ok"; diff --git a/previewer/include/wm_common.h b/previewer/include/wm_common.h index 99b88a4cbe..05d99ba96f 100644 --- a/previewer/include/wm_common.h +++ b/previewer/include/wm_common.h @@ -172,7 +172,7 @@ enum class WMError : int32_t { WM_ERROR_NO_REMOTE_ANIMATION, WM_ERROR_INVALID_DISPLAY, WM_ERROR_INVALID_PARENT, - WM_ERROR_OPER_FULLSCREEN_FAILED, + WM_ERROR_INVALID_OP_IN_CUR_STATUS, WM_ERROR_REPEAT_OPERATION, WM_ERROR_INVALID_SESSION, WM_ERROR_INVALID_CALLING, @@ -214,7 +214,7 @@ enum class WmErrorCode : int32_t { WM_ERROR_START_ABILITY_FAILED = 1300007, WM_ERROR_INVALID_DISPLAY = 1300008, WM_ERROR_INVALID_PARENT = 1300009, - WM_ERROR_OPER_FULLSCREEN_FAILED = 1300010, + WM_ERROR_INVALID_OP_IN_CUR_STATUS = 1300010, WM_ERROR_PIP_DESTROY_FAILED = 1300011, WM_ERROR_PIP_STATE_ABNORMALLY = 1300012, WM_ERROR_PIP_CREATE_FAILED = 1300013, @@ -268,28 +268,28 @@ enum class WindowUIType : uint8_t { * @brief Used to map from WMError to WmErrorCode. */ const std::map WM_JS_TO_ERROR_CODE_MAP { - {WMError::WM_OK, WmErrorCode::WM_OK }, - {WMError::WM_DO_NOTHING, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, - {WMError::WM_ERROR_DESTROYED_OBJECT, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, - {WMError::WM_ERROR_DEVICE_NOT_SUPPORT, WmErrorCode::WM_ERROR_DEVICE_NOT_SUPPORT }, - {WMError::WM_ERROR_INVALID_OPERATION, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, - {WMError::WM_ERROR_INVALID_PARAM, WmErrorCode::WM_ERROR_INVALID_PARAM }, - {WMError::WM_ERROR_INVALID_PERMISSION, WmErrorCode::WM_ERROR_NO_PERMISSION }, - {WMError::WM_ERROR_NOT_SYSTEM_APP, WmErrorCode::WM_ERROR_NOT_SYSTEM_APP }, - {WMError::WM_ERROR_INVALID_TYPE, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, - {WMError::WM_ERROR_INVALID_WINDOW, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, - {WMError::WM_ERROR_INVALID_WINDOW_MODE_OR_SIZE, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, - {WMError::WM_ERROR_IPC_FAILED, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, - {WMError::WM_ERROR_NO_MEM, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, - {WMError::WM_ERROR_NO_REMOTE_ANIMATION, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, - {WMError::WM_ERROR_INVALID_DISPLAY, WmErrorCode::WM_ERROR_INVALID_DISPLAY }, - {WMError::WM_ERROR_INVALID_PARENT, WmErrorCode::WM_ERROR_INVALID_PARENT }, - {WMError::WM_ERROR_OPER_FULLSCREEN_FAILED, WmErrorCode::WM_ERROR_OPER_FULLSCREEN_FAILED }, - {WMError::WM_ERROR_REPEAT_OPERATION, WmErrorCode::WM_ERROR_REPEAT_OPERATION }, - {WMError::WM_ERROR_NULLPTR, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, - {WMError::WM_ERROR_SAMGR, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, - {WMError::WM_ERROR_START_ABILITY_FAILED, WmErrorCode::WM_ERROR_START_ABILITY_FAILED }, - {WMError::WM_ERROR_SYSTEM_ABNORMALLY, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, + {WMError::WM_OK, WmErrorCode::WM_OK }, + {WMError::WM_DO_NOTHING, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, + {WMError::WM_ERROR_DESTROYED_OBJECT, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, + {WMError::WM_ERROR_DEVICE_NOT_SUPPORT, WmErrorCode::WM_ERROR_DEVICE_NOT_SUPPORT }, + {WMError::WM_ERROR_INVALID_OPERATION, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, + {WMError::WM_ERROR_INVALID_PARAM, WmErrorCode::WM_ERROR_INVALID_PARAM }, + {WMError::WM_ERROR_INVALID_PERMISSION, WmErrorCode::WM_ERROR_NO_PERMISSION }, + {WMError::WM_ERROR_NOT_SYSTEM_APP, WmErrorCode::WM_ERROR_NOT_SYSTEM_APP }, + {WMError::WM_ERROR_INVALID_TYPE, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, + {WMError::WM_ERROR_INVALID_WINDOW, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, + {WMError::WM_ERROR_INVALID_WINDOW_MODE_OR_SIZE, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, + {WMError::WM_ERROR_IPC_FAILED, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, + {WMError::WM_ERROR_NO_MEM, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, + {WMError::WM_ERROR_NO_REMOTE_ANIMATION, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, + {WMError::WM_ERROR_INVALID_DISPLAY, WmErrorCode::WM_ERROR_INVALID_DISPLAY }, + {WMError::WM_ERROR_INVALID_PARENT, WmErrorCode::WM_ERROR_INVALID_PARENT }, + {WMError::WM_ERROR_INVALID_OP_IN_CUR_STATUS, WmErrorCode::WM_ERROR_INVALID_OP_IN_CUR_STATUS }, + {WMError::WM_ERROR_REPEAT_OPERATION, WmErrorCode::WM_ERROR_REPEAT_OPERATION }, + {WMError::WM_ERROR_NULLPTR, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, + {WMError::WM_ERROR_SAMGR, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, + {WMError::WM_ERROR_START_ABILITY_FAILED, WmErrorCode::WM_ERROR_START_ABILITY_FAILED }, + {WMError::WM_ERROR_SYSTEM_ABNORMALLY, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, }; /** diff --git a/utils/src/wm_common.cpp b/utils/src/wm_common.cpp index 3f35425c22..e1b3a69611 100644 --- a/utils/src/wm_common.cpp +++ b/utils/src/wm_common.cpp @@ -17,34 +17,34 @@ namespace OHOS::Rosen { const std::map WM_JS_TO_ERROR_CODE_MAP { - {WMError::WM_OK, WmErrorCode::WM_OK }, - {WMError::WM_DO_NOTHING, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, - {WMError::WM_ERROR_DESTROYED_OBJECT, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, - {WMError::WM_ERROR_DEVICE_NOT_SUPPORT, WmErrorCode::WM_ERROR_DEVICE_NOT_SUPPORT }, - {WMError::WM_ERROR_INVALID_OPERATION, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, - {WMError::WM_ERROR_INVALID_PARAM, WmErrorCode::WM_ERROR_INVALID_PARAM }, - {WMError::WM_ERROR_INVALID_PERMISSION, WmErrorCode::WM_ERROR_NO_PERMISSION }, - {WMError::WM_ERROR_NOT_SYSTEM_APP, WmErrorCode::WM_ERROR_NOT_SYSTEM_APP }, - {WMError::WM_ERROR_INVALID_TYPE, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, - {WMError::WM_ERROR_INVALID_WINDOW, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, - {WMError::WM_ERROR_INVALID_WINDOW_MODE_OR_SIZE, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, - {WMError::WM_ERROR_IPC_FAILED, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, - {WMError::WM_ERROR_NO_MEM, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, - {WMError::WM_ERROR_NO_REMOTE_ANIMATION, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, - {WMError::WM_ERROR_INVALID_DISPLAY, WmErrorCode::WM_ERROR_INVALID_DISPLAY }, - {WMError::WM_ERROR_INVALID_PARENT, WmErrorCode::WM_ERROR_INVALID_PARENT }, - {WMError::WM_ERROR_OPER_FULLSCREEN_FAILED, WmErrorCode::WM_ERROR_OPER_FULLSCREEN_FAILED }, - {WMError::WM_ERROR_REPEAT_OPERATION, WmErrorCode::WM_ERROR_REPEAT_OPERATION }, - {WMError::WM_ERROR_NULLPTR, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, - {WMError::WM_ERROR_SAMGR, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, - {WMError::WM_ERROR_START_ABILITY_FAILED, WmErrorCode::WM_ERROR_START_ABILITY_FAILED }, - {WMError::WM_ERROR_PIP_DESTROY_FAILED, WmErrorCode::WM_ERROR_PIP_DESTROY_FAILED }, - {WMError::WM_ERROR_PIP_STATE_ABNORMALLY, WmErrorCode::WM_ERROR_PIP_STATE_ABNORMALLY }, - {WMError::WM_ERROR_PIP_CREATE_FAILED, WmErrorCode::WM_ERROR_PIP_CREATE_FAILED }, - {WMError::WM_ERROR_PIP_INTERNAL_ERROR, WmErrorCode::WM_ERROR_PIP_INTERNAL_ERROR }, - {WMError::WM_ERROR_PIP_REPEAT_OPERATION, WmErrorCode::WM_ERROR_PIP_REPEAT_OPERATION }, - {WMError::WM_ERROR_INVALID_CALLING, WmErrorCode::WM_ERROR_INVALID_CALLING }, - {WMError::WM_ERROR_INVALID_SESSION, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, - {WMError::WM_ERROR_SYSTEM_ABNORMALLY, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, + {WMError::WM_OK, WmErrorCode::WM_OK }, + {WMError::WM_DO_NOTHING, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, + {WMError::WM_ERROR_DESTROYED_OBJECT, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, + {WMError::WM_ERROR_DEVICE_NOT_SUPPORT, WmErrorCode::WM_ERROR_DEVICE_NOT_SUPPORT }, + {WMError::WM_ERROR_INVALID_OPERATION, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, + {WMError::WM_ERROR_INVALID_PARAM, WmErrorCode::WM_ERROR_INVALID_PARAM }, + {WMError::WM_ERROR_INVALID_PERMISSION, WmErrorCode::WM_ERROR_NO_PERMISSION }, + {WMError::WM_ERROR_NOT_SYSTEM_APP, WmErrorCode::WM_ERROR_NOT_SYSTEM_APP }, + {WMError::WM_ERROR_INVALID_TYPE, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, + {WMError::WM_ERROR_INVALID_WINDOW, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, + {WMError::WM_ERROR_INVALID_WINDOW_MODE_OR_SIZE, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, + {WMError::WM_ERROR_IPC_FAILED, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, + {WMError::WM_ERROR_NO_MEM, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, + {WMError::WM_ERROR_NO_REMOTE_ANIMATION, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, + {WMError::WM_ERROR_INVALID_DISPLAY, WmErrorCode::WM_ERROR_INVALID_DISPLAY }, + {WMError::WM_ERROR_INVALID_PARENT, WmErrorCode::WM_ERROR_INVALID_PARENT }, + {WMError::WM_ERROR_INVALID_OP_IN_CUR_STATUS, WmErrorCode::WM_ERROR_INVALID_OP_IN_CUR_STATUS }, + {WMError::WM_ERROR_REPEAT_OPERATION, WmErrorCode::WM_ERROR_REPEAT_OPERATION }, + {WMError::WM_ERROR_NULLPTR, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, + {WMError::WM_ERROR_SAMGR, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, + {WMError::WM_ERROR_START_ABILITY_FAILED, WmErrorCode::WM_ERROR_START_ABILITY_FAILED }, + {WMError::WM_ERROR_PIP_DESTROY_FAILED, WmErrorCode::WM_ERROR_PIP_DESTROY_FAILED }, + {WMError::WM_ERROR_PIP_STATE_ABNORMALLY, WmErrorCode::WM_ERROR_PIP_STATE_ABNORMALLY }, + {WMError::WM_ERROR_PIP_CREATE_FAILED, WmErrorCode::WM_ERROR_PIP_CREATE_FAILED }, + {WMError::WM_ERROR_PIP_INTERNAL_ERROR, WmErrorCode::WM_ERROR_PIP_INTERNAL_ERROR }, + {WMError::WM_ERROR_PIP_REPEAT_OPERATION, WmErrorCode::WM_ERROR_PIP_REPEAT_OPERATION }, + {WMError::WM_ERROR_INVALID_CALLING, WmErrorCode::WM_ERROR_INVALID_CALLING }, + {WMError::WM_ERROR_INVALID_SESSION, WmErrorCode::WM_ERROR_STATE_ABNORMALLY }, + {WMError::WM_ERROR_SYSTEM_ABNORMALLY, WmErrorCode::WM_ERROR_SYSTEM_ABNORMALLY }, }; } \ No newline at end of file diff --git a/wm/src/window_scene_session_impl.cpp b/wm/src/window_scene_session_impl.cpp index 3e7f9e7d52..3f2a55e53a 100644 --- a/wm/src/window_scene_session_impl.cpp +++ b/wm/src/window_scene_session_impl.cpp @@ -1501,9 +1501,9 @@ WMError WindowSceneSessionImpl::MoveWindowToGlobal(int32_t x, int32_t y) } if (GetMode() != WindowMode::WINDOW_MODE_FLOATING) { - TLOGW(WmsLogTag::WMS_LAYOUT, "FullScreen window should not move, winId:%{public}u, mode:%{public}u", + TLOGW(WmsLogTag::WMS_LAYOUT, "window should not move, winId:%{public}u, mode:%{public}u", GetWindowId(), GetMode()); - return WMError::WM_ERROR_OPER_FULLSCREEN_FAILED; + return WMError::WM_ERROR_INVALID_OP_IN_CUR_STATUS; } if (property_->GetWindowType() == WindowType::WINDOW_TYPE_PIP) { @@ -1551,9 +1551,9 @@ WMError WindowSceneSessionImpl::MoveToAsync(int32_t x, int32_t y) } if (GetMode() != WindowMode::WINDOW_MODE_FLOATING) { - TLOGW(WmsLogTag::WMS_LAYOUT, "FullScreen window should not move, winId:%{public}u, mode:%{public}u", + TLOGW(WmsLogTag::WMS_LAYOUT, "window should not move, winId:%{public}u, mode:%{public}u", GetWindowId(), GetMode()); - return WMError::WM_ERROR_OPER_FULLSCREEN_FAILED; + return WMError::WM_ERROR_INVALID_OP_IN_CUR_STATUS; } auto ret = MoveTo(x, y); if (state_ == WindowState::STATE_SHOWN) { @@ -1749,9 +1749,9 @@ WMError WindowSceneSessionImpl::ResizeAsync(uint32_t width, uint32_t height) } if (GetMode() != WindowMode::WINDOW_MODE_FLOATING) { - TLOGW(WmsLogTag::WMS_LAYOUT, "Fullscreen window should not resize, winId:%{public}u, mode:%{public}u", + TLOGW(WmsLogTag::WMS_LAYOUT, "window should not resize, winId:%{public}u, mode:%{public}u", GetWindowId(), GetMode()); - return WMError::WM_ERROR_OPER_FULLSCREEN_FAILED; + return WMError::WM_ERROR_INVALID_OP_IN_CUR_STATUS; } auto ret = Resize(width, height); if (state_ == WindowState::STATE_SHOWN) { diff --git a/wm/test/unittest/window_scene_session_impl_test4.cpp b/wm/test/unittest/window_scene_session_impl_test4.cpp index d81d31bbd3..171779b64e 100644 --- a/wm/test/unittest/window_scene_session_impl_test4.cpp +++ b/wm/test/unittest/window_scene_session_impl_test4.cpp @@ -829,7 +829,7 @@ HWTEST_F(WindowSceneSessionImplTest4, MoveToAsync01, Function | SmallTest | Leve sptr session = sptr::MakeSptr(sessionInfo); window->hostSession_ = session; window->property_->SetPersistentId(1); - ASSERT_EQ(WMError::WM_ERROR_OPER_FULLSCREEN_FAILED, window->MoveToAsync(10, 10)); + ASSERT_EQ(WMError::WM_ERROR_INVALID_OP_IN_CUR_STATUS, window->MoveToAsync(10, 10)); } /** @@ -889,7 +889,7 @@ HWTEST_F(WindowSceneSessionImplTest4, ResizeAsync01, Function | SmallTest | Leve sptr session = sptr::MakeSptr(sessionInfo); window->hostSession_ = session; window->property_->SetPersistentId(1); - ASSERT_EQ(WMError::WM_ERROR_OPER_FULLSCREEN_FAILED, window->ResizeAsync(500, 500)); + ASSERT_EQ(WMError::WM_ERROR_INVALID_OP_IN_CUR_STATUS, window->ResizeAsync(500, 500)); } /**