mirror of
https://gitee.com/openharmony/window_window_manager
synced 2024-11-23 06:50:40 +00:00
PC窗口接口稳定性修改:getWindowsByCoordinate、setWindowTopmost、removeStartingWindow
Signed-off-by: 万孝国 <wanxiaoguo@huawei.com>
This commit is contained in:
parent
91db42dfb6
commit
926b8efbe9
@ -38,6 +38,7 @@ using namespace AbilityRuntime;
|
||||
namespace {
|
||||
constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "JsWindowManager"};
|
||||
const std::string PIP_WINDOW = "pip_window";
|
||||
constexpr size_t INDEX_ZERO = 0;
|
||||
constexpr size_t ARGC_ONE = 1;
|
||||
constexpr size_t ARGC_TWO = 2;
|
||||
constexpr size_t ARGC_THREE = 3;
|
||||
@ -1207,13 +1208,13 @@ napi_value JsWindowManager::OnGetVisibleWindowInfo(napi_env env, napi_callback_i
|
||||
napi_value JsWindowManager::OnGetWindowsByCoordinate(napi_env env, napi_callback_info info)
|
||||
{
|
||||
size_t argc = ARGC_FOUR;
|
||||
napi_value argv[ARGC_FOUR] = {nullptr};
|
||||
napi_value argv[ARGC_FOUR] = { nullptr };
|
||||
napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr);
|
||||
if (argc < ARGC_ONE || argc > ARGC_FOUR) { // min param num 1, max param num 4
|
||||
return NapiThrowError(env, WmErrorCode::WM_ERROR_INVALID_PARAM);
|
||||
}
|
||||
int64_t displayId = static_cast<int64_t>(DISPLAY_ID_INVALID);
|
||||
if (!ConvertFromJsValue(env, argv[0], displayId)) {
|
||||
if (!ConvertFromJsValue(env, argv[INDEX_ZERO], displayId)) {
|
||||
TLOGE(WmsLogTag::DEFAULT, "Failed to convert parameter to displayId");
|
||||
return NapiThrowError(env, WmErrorCode::WM_ERROR_INVALID_PARAM);
|
||||
}
|
||||
@ -1235,28 +1236,29 @@ napi_value JsWindowManager::OnGetWindowsByCoordinate(napi_env env, napi_callback
|
||||
y = INVALID_COORDINATE;
|
||||
}
|
||||
napi_value result = nullptr;
|
||||
NapiAsyncTask::CompleteCallback complete =
|
||||
[displayId, windowNumber, x, y](napi_env env, NapiAsyncTask& task, int32_t status) {
|
||||
std::vector<int32_t> windowIds;
|
||||
WmErrorCode ret = WM_JS_TO_ERROR_CODE_MAP.at(SingletonContainer::Get<WindowManager>().
|
||||
GetWindowIdsByCoordinate(static_cast<uint64_t>(displayId), windowNumber, x, y, windowIds));
|
||||
if (ret == WmErrorCode::WM_OK) {
|
||||
std::vector<sptr<Window>> windows(windowIds.size());
|
||||
for (size_t i = 0; i < windowIds.size(); i++) {
|
||||
sptr<Window> window = Window::GetWindowWithId(windowIds[i]);
|
||||
windows[i] = window;
|
||||
}
|
||||
task.Resolve(env, CreateJsWindowArrayObject(env, windows));
|
||||
} else {
|
||||
task.Reject(env, JsErrUtils::CreateJsError(env, ret, "OnGetWindowsByCoordinate failed"));
|
||||
std::shared_ptr<NapiAsyncTask> napiAsyncTask = CreateEmptyAsyncTask(env, nullptr, &result);
|
||||
auto asyncTask = [displayId, windowNumber, x, y, env, task = napiAsyncTask] {
|
||||
std::vector<int32_t> windowIds;
|
||||
WmErrorCode ret = WM_JS_TO_ERROR_CODE_MAP.at(SingletonContainer::Get<WindowManager>().
|
||||
GetWindowIdsByCoordinate(static_cast<uint64_t>(displayId), windowNumber, x, y, windowIds));
|
||||
if (ret == WmErrorCode::WM_OK) {
|
||||
std::vector<sptr<Window>> windows(windowIds.size());
|
||||
for (size_t i = 0; i < windowIds.size(); i++) {
|
||||
sptr<Window> window = Window::GetWindowWithId(windowIds[i]);
|
||||
windows[i] = window;
|
||||
}
|
||||
};
|
||||
NapiAsyncTask::Schedule("JsWindowManager::OnGetWindowsByCoordinate",
|
||||
env, CreateAsyncTaskWithLastParam(env, nullptr, nullptr, std::move(complete), &result));
|
||||
task->Resolve(env, CreateJsWindowArrayObject(env, windows));
|
||||
} else {
|
||||
task->Reject(env, JsErrUtils::CreateJsError(env, ret, "getWindowsByCoordinate failed"));
|
||||
}
|
||||
};
|
||||
if (napi_status::napi_ok != napi_send_event(env, asyncTask, napi_eprio_high)) {
|
||||
napiAsyncTask->Reject(env,
|
||||
CreateJsError(env, static_cast<int32_t>(WmErrorCode::WM_ERROR_STATE_ABNORMALLY), "send event failed"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
napi_value JsWindowManagerInit(napi_env env, napi_value exportObj)
|
||||
{
|
||||
WLOGFD("JsWindowManagerInit");
|
||||
|
@ -160,7 +160,7 @@ napi_value JsWindow::HideWithAnimation(napi_env env, napi_callback_info info)
|
||||
|
||||
napi_value JsWindow::Recover(napi_env env, napi_callback_info info)
|
||||
{
|
||||
WLOGI("Recover");
|
||||
TLOGD(WmsLogTag::WMS_LAYOUT, "[NAPI]");
|
||||
JsWindow* me = CheckParamsAndGetThis<JsWindow>(env, info);
|
||||
return (me != nullptr) ? me->OnRecover(env, info) : nullptr;
|
||||
}
|
||||
@ -568,7 +568,7 @@ napi_value JsWindow::SetTouchableAreas(napi_env env, napi_callback_info info)
|
||||
|
||||
napi_value JsWindow::SetResizeByDragEnabled(napi_env env, napi_callback_info info)
|
||||
{
|
||||
WLOGI("SetResizeByDragEnabled");
|
||||
TLOGD(WmsLogTag::DEFAULT, "[NAPI]");
|
||||
JsWindow* me = CheckParamsAndGetThis<JsWindow>(env, info);
|
||||
return (me != nullptr) ? me->OnSetResizeByDragEnabled(env, info) : nullptr;
|
||||
}
|
||||
@ -773,7 +773,7 @@ napi_value JsWindow::SetWaterMarkFlag(napi_env env, napi_callback_info info)
|
||||
|
||||
napi_value JsWindow::SetHandwritingFlag(napi_env env, napi_callback_info info)
|
||||
{
|
||||
WLOGI("SetHandwritingFlag");
|
||||
TLOGD(WmsLogTag::DEFAULT, "[NAPI]");
|
||||
JsWindow* me = CheckParamsAndGetThis<JsWindow>(env, info);
|
||||
return (me != nullptr) ? me->OnSetHandwritingFlag(env, info) : nullptr;
|
||||
}
|
||||
@ -794,14 +794,14 @@ napi_value JsWindow::ResetAspectRatio(napi_env env, napi_callback_info info)
|
||||
|
||||
napi_value JsWindow::Minimize(napi_env env, napi_callback_info info)
|
||||
{
|
||||
WLOGI("[NAPI]Minimize");
|
||||
TLOGD(WmsLogTag::WMS_LAYOUT, "[NAPI]");
|
||||
JsWindow* me = CheckParamsAndGetThis<JsWindow>(env, info);
|
||||
return (me != nullptr) ? me->OnMinimize(env, info) : nullptr;
|
||||
}
|
||||
|
||||
napi_value JsWindow::Maximize(napi_env env, napi_callback_info info)
|
||||
{
|
||||
WLOGI("[NAPI]Maximize");
|
||||
TLOGD(WmsLogTag::WMS_LAYOUT, "[NAPI]");
|
||||
JsWindow* me = CheckParamsAndGetThis<JsWindow>(env, info);
|
||||
return (me != nullptr) ? me->OnMaximize(env, info) : nullptr;
|
||||
}
|
||||
@ -846,7 +846,7 @@ napi_value JsWindow::SetWindowLimits(napi_env env, napi_callback_info info)
|
||||
|
||||
napi_value JsWindow::SetWindowDecorVisible(napi_env env, napi_callback_info info)
|
||||
{
|
||||
WLOGI("[NAPI]SetWindowDecorVisible");
|
||||
TLOGD(WmsLogTag::DEFAULT, "[NAPI]");
|
||||
JsWindow* me = CheckParamsAndGetThis<JsWindow>(env, info);
|
||||
return (me != nullptr) ? me->OnSetWindowDecorVisible(env, info) : nullptr;
|
||||
}
|
||||
@ -860,28 +860,28 @@ napi_value JsWindow::SetWindowTitleMoveEnabled(napi_env env, napi_callback_info
|
||||
|
||||
napi_value JsWindow::SetSubWindowModal(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TLOGI(WmsLogTag::WMS_SUB, "[NAPI]");
|
||||
TLOGD(WmsLogTag::WMS_SUB, "[NAPI]");
|
||||
JsWindow* me = CheckParamsAndGetThis<JsWindow>(env, info);
|
||||
return (me != nullptr) ? me->OnSetSubWindowModal(env, info) : nullptr;
|
||||
}
|
||||
|
||||
napi_value JsWindow::SetWindowDecorHeight(napi_env env, napi_callback_info info)
|
||||
{
|
||||
WLOGI("[NAPI]SetWindowDecorHeight");
|
||||
TLOGD(WmsLogTag::DEFAULT, "[NAPI]");
|
||||
JsWindow* me = CheckParamsAndGetThis<JsWindow>(env, info);
|
||||
return (me != nullptr) ? me->OnSetWindowDecorHeight(env, info) : nullptr;
|
||||
}
|
||||
|
||||
napi_value JsWindow::GetWindowDecorHeight(napi_env env, napi_callback_info info)
|
||||
{
|
||||
WLOGI("[NAPI]GetWindowDecorHeight");
|
||||
TLOGD(WmsLogTag::DEFAULT, "[NAPI]");
|
||||
JsWindow* me = CheckParamsAndGetThis<JsWindow>(env, info);
|
||||
return (me != nullptr) ? me->OnGetWindowDecorHeight(env, info) : nullptr;
|
||||
}
|
||||
|
||||
napi_value JsWindow::GetTitleButtonRect(napi_env env, napi_callback_info info)
|
||||
{
|
||||
WLOGI("[NAPI]GetTitleButtonsRect");
|
||||
TLOGD(WmsLogTag::DEFAULT, "[NAPI]");
|
||||
JsWindow* me = CheckParamsAndGetThis<JsWindow>(env, info);
|
||||
return (me != nullptr) ? me->OnGetTitleButtonRect(env, info) : nullptr;
|
||||
}
|
||||
@ -895,14 +895,14 @@ napi_value JsWindow::SetWindowContainerColor(napi_env env, napi_callback_info in
|
||||
|
||||
napi_value JsWindow::SetWindowMask(napi_env env, napi_callback_info info)
|
||||
{
|
||||
WLOGI("[NAPI]SetWindowMask");
|
||||
TLOGD(WmsLogTag::DEFAULT, "[NAPI]");
|
||||
JsWindow* me = CheckParamsAndGetThis<JsWindow>(env, info);
|
||||
return (me != nullptr) ? me->OnSetWindowMask(env, info) : nullptr;
|
||||
}
|
||||
|
||||
napi_value JsWindow::SetTitleButtonVisible(napi_env env, napi_callback_info info)
|
||||
{
|
||||
TLOGI(WmsLogTag::WMS_LAYOUT, "[NAPI]SetTitleButtonVisible");
|
||||
TLOGD(WmsLogTag::WMS_LAYOUT, "[NAPI]");
|
||||
JsWindow* me = CheckParamsAndGetThis<JsWindow>(env, info);
|
||||
return (me != nullptr) ? me->OnSetTitleButtonVisible(env, info) : nullptr;
|
||||
}
|
||||
@ -3838,39 +3838,40 @@ napi_value JsWindow::OnSetWindowTopmost(napi_env env, napi_callback_info info)
|
||||
}
|
||||
|
||||
size_t argc = FOUR_PARAMS_SIZE;
|
||||
napi_value argv[FOUR_PARAMS_SIZE] = {nullptr};
|
||||
napi_value argv[FOUR_PARAMS_SIZE] = { nullptr };
|
||||
napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr);
|
||||
if (argc != 1 || argv[0] == nullptr) {
|
||||
bool isMainWindowTopmost = false;
|
||||
if (argc != 1 || !ConvertFromJsValue(env, argv[INDEX_ZERO], isMainWindowTopmost)) {
|
||||
TLOGE(WmsLogTag::WMS_HIERARCHY,
|
||||
"Argc is invalid: %{public}zu. Failed to convert parameter to topmost", argc);
|
||||
return NapiThrowError(env, WmErrorCode::WM_ERROR_INVALID_PARAM);
|
||||
}
|
||||
bool isMainWindowTopmost = false;
|
||||
napi_get_value_bool(env, argv[0], &isMainWindowTopmost);
|
||||
|
||||
std::shared_ptr<WmErrorCode> errCodePtr = std::make_shared<WmErrorCode>(WmErrorCode::WM_OK);
|
||||
NapiAsyncTask::ExecuteCallback execute = [weakToken = wptr(windowToken_), isMainWindowTopmost, errCodePtr] {
|
||||
napi_value result = nullptr;
|
||||
std::shared_ptr<NapiAsyncTask> napiAsyncTask = CreateEmptyAsyncTask(env, nullptr, &result);
|
||||
const char* const where = __func__;
|
||||
auto asyncTask = [weakToken = wptr<Window>(windowToken_), isMainWindowTopmost, env,
|
||||
task = napiAsyncTask, where] {
|
||||
auto window = weakToken.promote();
|
||||
if (window == nullptr) {
|
||||
TLOGNE(WmsLogTag::WMS_HIERARCHY, "window is nullptr");
|
||||
*errCodePtr = WmErrorCode::WM_ERROR_STATE_ABNORMALLY;
|
||||
TLOGNE(WmsLogTag::WMS_HIERARCHY, "%{public}s window is nullptr", where);
|
||||
WmErrorCode wmErrorCode = WmErrorCode::WM_ERROR_STATE_ABNORMALLY;
|
||||
task->Reject(env, JsErrUtils::CreateJsError(env, wmErrorCode, "window is nullptr"));
|
||||
return;
|
||||
}
|
||||
*errCodePtr = WM_JS_TO_ERROR_CODE_MAP.at(window->SetMainWindowTopmost(isMainWindowTopmost));
|
||||
TLOGND(WmsLogTag::WMS_HIERARCHY, "Window [%{public}u, %{public}s] set success",
|
||||
window->GetWindowId(), window->GetWindowName().c_str());
|
||||
auto ret = WM_JS_TO_ERROR_CODE_MAP.at(window->SetMainWindowTopmost(isMainWindowTopmost));
|
||||
if (ret != WmErrorCode::WM_OK) {
|
||||
task->Reject(env, JsErrUtils::CreateJsError(env, ret, "Window set main window topmost failed"));
|
||||
return;
|
||||
}
|
||||
task->Resolve(env, NapiGetUndefined(env));
|
||||
TLOGNI(WmsLogTag::WMS_HIERARCHY,
|
||||
"%{public}s id: %{public}u, name: %{public}s, isMainWindowTopmost: %{public}d",
|
||||
where, window->GetWindowId(), window->GetWindowName().c_str(), isMainWindowTopmost);
|
||||
};
|
||||
NapiAsyncTask::CompleteCallback complete =
|
||||
[errCodePtr](napi_env env, NapiAsyncTask& task, int32_t status) {
|
||||
if (*errCodePtr == WmErrorCode::WM_OK) {
|
||||
task.Resolve(env, NapiGetUndefined(env));
|
||||
} else {
|
||||
task.Reject(env, JsErrUtils::CreateJsError(env, *errCodePtr, "Window set main window topmost failed"));
|
||||
}
|
||||
};
|
||||
napi_value result = nullptr;
|
||||
NapiAsyncTask::Schedule("JsWindow::OnSetWindowTopmost",
|
||||
env, CreateAsyncTaskWithLastParam(env, nullptr, std::move(execute), std::move(complete), &result));
|
||||
if (napi_status::napi_ok != napi_send_event(env, asyncTask, napi_eprio_high)) {
|
||||
napiAsyncTask->Reject(env,
|
||||
CreateJsError(env, static_cast<int32_t>(WmErrorCode::WM_ERROR_STATE_ABNORMALLY), "send event failed"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -5907,11 +5908,7 @@ napi_value JsWindow::OnMinimize(napi_env env, napi_callback_info info)
|
||||
return NapiThrowError(env, WmErrorCode::WM_ERROR_INVALID_PARAM);
|
||||
}
|
||||
|
||||
if (windowToken_ == nullptr) {
|
||||
TLOGE(WmsLogTag::WMS_LAYOUT, "WindowToken is nullptr");
|
||||
return NapiThrowError(env, WmErrorCode::WM_ERROR_STATE_ABNORMALLY);
|
||||
}
|
||||
if (WindowHelper::IsSubWindow(windowToken_->GetType())) {
|
||||
if (windowToken_ != nullptr && WindowHelper::IsSubWindow(windowToken_->GetType())) {
|
||||
TLOGI(WmsLogTag::WMS_LAYOUT, "subWindow use hide");
|
||||
return HideWindowFunction(env, info, WmErrorCode::WM_OK);
|
||||
}
|
||||
|
@ -568,7 +568,7 @@ napi_value JsWindowStage::OnSetWindowModal(napi_env env, napi_callback_info info
|
||||
return NapiGetUndefined(env);
|
||||
}
|
||||
size_t argc = FOUR_PARAMS_SIZE;
|
||||
napi_value argv[FOUR_PARAMS_SIZE];
|
||||
napi_value argv[FOUR_PARAMS_SIZE] = { nullptr };
|
||||
napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr);
|
||||
if (argc != 1) {
|
||||
TLOGE(WmsLogTag::WMS_MAIN, "Argc is invalid: %{public}zu", argc);
|
||||
@ -582,7 +582,7 @@ napi_value JsWindowStage::OnSetWindowModal(napi_env env, napi_callback_info info
|
||||
return NapiGetUndefined(env);
|
||||
}
|
||||
napi_value result = nullptr;
|
||||
std::shared_ptr<AbilityRuntime::NapiAsyncTask> napiAsyncTask = CreateEmptyAsyncTask(env, nullptr, &result);
|
||||
std::shared_ptr<NapiAsyncTask> napiAsyncTask = CreateEmptyAsyncTask(env, nullptr, &result);
|
||||
const char* const where = __func__;
|
||||
auto asyncTask = [where, weakWindow = wptr(window), isModal, env, task = napiAsyncTask] {
|
||||
auto window = weakWindow.promote();
|
||||
@ -592,13 +592,13 @@ napi_value JsWindowStage::OnSetWindowModal(napi_env env, napi_callback_info info
|
||||
return;
|
||||
}
|
||||
WMError ret = window->SetWindowModal(isModal);
|
||||
if (ret == WMError::WM_OK) {
|
||||
task->Resolve(env, NapiGetUndefined(env));
|
||||
} else {
|
||||
if (ret != WMError::WM_OK) {
|
||||
WmErrorCode wmErrorCode = WM_JS_TO_ERROR_CODE_MAP.at(ret);
|
||||
TLOGNE(WmsLogTag::WMS_MAIN, "%{public}s failed, ret is %{public}d", where, wmErrorCode);
|
||||
task->Reject(env, JsErrUtils::CreateJsError(env, wmErrorCode, "Set main window modal failed"));
|
||||
return;
|
||||
}
|
||||
task->Resolve(env, NapiGetUndefined(env));
|
||||
TLOGNI(WmsLogTag::WMS_MAIN, "%{public}s id:%{public}u, name:%{public}s, isModal:%{public}d",
|
||||
where, window->GetWindowId(), window->GetWindowName().c_str(), isModal);
|
||||
};
|
||||
@ -787,32 +787,34 @@ napi_value JsWindowStage::OnRemoveStartingWindow(napi_env env, napi_callback_inf
|
||||
return NapiGetUndefined(env);
|
||||
}
|
||||
|
||||
const char* const where = __func__;
|
||||
NapiAsyncTask::CompleteCallback complete =
|
||||
[where, windowScene](napi_env env, NapiAsyncTask& task, int32_t status) {
|
||||
auto window = windowScene->GetMainWindow();
|
||||
if (window == nullptr) {
|
||||
TLOGNE(WmsLogTag::WMS_MAIN, "%{public}s [NAPI]Get main window failed", where);
|
||||
task.Reject(env,
|
||||
JsErrUtils::CreateJsError(env, WmErrorCode::WM_ERROR_STATE_ABNORMALLY, "Get main window failed"));
|
||||
return;
|
||||
}
|
||||
WmErrorCode ret = WM_JS_TO_ERROR_CODE_MAP.at(window->NotifyRemoveStartingWindow());
|
||||
if (ret == WmErrorCode::WM_OK) {
|
||||
task.Resolve(env, NapiGetUndefined(env));
|
||||
} else {
|
||||
task.Reject(env, JsErrUtils::CreateJsError(env, ret, "Notify remove starting window failed"));
|
||||
}
|
||||
};
|
||||
|
||||
size_t argc = FOUR_PARAMS_SIZE;
|
||||
napi_value argv[FOUR_PARAMS_SIZE] = {nullptr};
|
||||
napi_value argv[FOUR_PARAMS_SIZE] = { nullptr };
|
||||
napi_get_cb_info(env, info, &argc, argv, nullptr, nullptr);
|
||||
napi_value lastParam = (argc == 0) ? nullptr :
|
||||
(argv[INDEX_ZERO] != nullptr && GetType(env, argv[INDEX_ZERO]) == napi_function ? argv[INDEX_ZERO] : nullptr);
|
||||
napi_value result = nullptr;
|
||||
NapiAsyncTask::Schedule("JsWindow::OnRemoveStartingWindow",
|
||||
env, CreateAsyncTaskWithLastParam(env, lastParam, nullptr, std::move(complete), &result));
|
||||
std::shared_ptr<NapiAsyncTask> napiAsyncTask = CreateEmptyAsyncTask(env, lastParam, &result);
|
||||
auto window = windowScene->GetMainWindow();
|
||||
const char* const where = __func__;
|
||||
auto asyncTask = [weakWindow = wptr(window), where, env, task = napiAsyncTask] {
|
||||
auto window = weakWindow.promote();
|
||||
if (window == nullptr) {
|
||||
TLOGNE(WmsLogTag::WMS_MAIN, "%{public}s window is nullptr", where);
|
||||
task->Reject(env, JsErrUtils::CreateJsError(env,
|
||||
WmErrorCode::WM_ERROR_STATE_ABNORMALLY, "window is nullptr."));
|
||||
return;
|
||||
}
|
||||
WmErrorCode ret = WM_JS_TO_ERROR_CODE_MAP.at(window->NotifyRemoveStartingWindow());
|
||||
if (ret == WmErrorCode::WM_OK) {
|
||||
task->Resolve(env, NapiGetUndefined(env));
|
||||
} else {
|
||||
task->Reject(env, JsErrUtils::CreateJsError(env, ret, "Notify remove starting window failed"));
|
||||
}
|
||||
};
|
||||
if (napi_status::napi_ok != napi_send_event(env, asyncTask, napi_eprio_immediate)) {
|
||||
napiAsyncTask->Reject(env,
|
||||
CreateJsError(env, static_cast<int32_t>(WmErrorCode::WM_ERROR_STATE_ABNORMALLY), "send event failed"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -833,7 +835,7 @@ napi_value JsWindowStage::OnSetWindowRectAutoSave(napi_env env, napi_callback_in
|
||||
napi_throw(env, JsErrUtils::CreateJsError(env, WmErrorCode::WM_ERROR_INVALID_PARAM));
|
||||
return NapiGetUndefined(env);
|
||||
}
|
||||
bool enabled;
|
||||
bool enabled = false;
|
||||
if (!ConvertFromJsValue(env, argv[INDEX_ZERO], enabled)) {
|
||||
TLOGE(WmsLogTag::WMS_MAIN, "[NAPI]Failed to convert parameter to enabled");
|
||||
napi_throw(env, JsErrUtils::CreateJsError(env, WmErrorCode::WM_ERROR_INVALID_PARAM));
|
||||
|
Loading…
Reference in New Issue
Block a user