window-错误码描述优化

Signed-off-by: zhoukai <zhoukai94@huawei.com>
This commit is contained in:
zhoukai 2024-11-19 10:53:09 +08:00
parent e263313abc
commit 7f5fa86223
6 changed files with 87 additions and 86 deletions

View File

@ -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,

View File

@ -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<WMError, const char*> 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<WmErrorCode, const char*> 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";

View File

@ -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<WMError, WmErrorCode> 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 },
};
/**

View File

@ -17,34 +17,34 @@
namespace OHOS::Rosen {
const std::map<WMError, WmErrorCode> 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 },
};
}

View File

@ -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) {

View File

@ -829,7 +829,7 @@ HWTEST_F(WindowSceneSessionImplTest4, MoveToAsync01, Function | SmallTest | Leve
sptr<SessionMocker> session = sptr<SessionMocker>::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<SessionMocker> session = sptr<SessionMocker>::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));
}
/**