mirror of
https://gitee.com/openharmony/window_window_manager
synced 2025-05-13 06:41:12 +00:00
fix bug
Signed-off-by: wangzilin <wangzilin17@huawei.com>
This commit is contained in:
parent
f2a52b4aa8
commit
340bca2ef5
@ -7380,6 +7380,11 @@ napi_value JsWindow::OnSetSystemAvoidAreaEnabled(napi_env env, napi_callback_inf
|
||||
*errCodePtr = WmErrorCode::WM_ERROR_STATE_ABNORMALLY;
|
||||
return;
|
||||
}
|
||||
if (!WindowHelper::IsSystemWindow(window->GetType())) {
|
||||
TLOGNE(WmsLogTag::WMS_IMMS, "%{public}s only system window is valid", where);
|
||||
*errCodePtr = WmErrorCode::WM_ERROR_INVALID_CALLING;
|
||||
return;
|
||||
}
|
||||
uint32_t option = 0;
|
||||
*errCodePtr = WM_JS_TO_ERROR_CODE_MAP.at(window->GetAvoidAreaOption(option));
|
||||
if (*errCodePtr != WmErrorCode::WM_OK) {
|
||||
@ -7412,6 +7417,10 @@ napi_value JsWindow::OnIsSystemAvoidAreaEnabled(napi_env env, napi_callback_info
|
||||
TLOGE(WmsLogTag::WMS_IMMS, "windowToken is nullptr");
|
||||
return NapiThrowError(env, WmErrorCode::WM_ERROR_STATE_ABNORMALLY);
|
||||
}
|
||||
if (!WindowHelper::IsSystemWindow(windowToken_->GetType())) {
|
||||
TLOGE(WmsLogTag::WMS_IMMS, "%{public}s only system window is valid", where);
|
||||
return NapiThrowError(env, WmErrorCode::WM_ERROR_INVALID_CALLING);
|
||||
}
|
||||
uint32_t avoidAreaOption = 0;
|
||||
WmErrorCode ret = WM_JS_TO_ERROR_CODE_MAP.at(windowToken_->GetAvoidAreaOption(avoidAreaOption));
|
||||
if (ret != WmErrorCode::WM_OK) {
|
||||
|
@ -1801,10 +1801,6 @@ WMError WindowSessionImpl::SetAvoidAreaOption(uint32_t avoidAreaOption)
|
||||
TLOGE(WmsLogTag::WMS_IMMS, "Session is invalid");
|
||||
return WMError::WM_ERROR_INVALID_WINDOW;
|
||||
}
|
||||
if (!WindowHelper::IsMainWindow(GetType())) {
|
||||
TLOGE(WmsLogTag::WMS_IMMS, "window type is not supported, type %{public}d", GetType());
|
||||
return WMError::WM_ERROR_INVALID_CALLING;
|
||||
}
|
||||
property_->SetAvoidAreaOption(avoidAreaOption);
|
||||
TLOGI(WmsLogTag::WMS_IMMS, "win %{public}d, set option %{public}d",
|
||||
GetPersistentId(), avoidAreaOption);
|
||||
@ -1818,10 +1814,6 @@ WMError WindowSessionImpl::GetAvoidAreaOption(uint32_t& avoidAreaOption)
|
||||
TLOGE(WmsLogTag::WMS_IMMS, "Session is invalid");
|
||||
return WMError::WM_ERROR_INVALID_WINDOW;
|
||||
}
|
||||
if (!WindowHelper::IsMainWindow(GetType())) {
|
||||
TLOGE(WmsLogTag::WMS_IMMS, "window type is not supported, type %{public}d", GetType());
|
||||
return WMError::WM_ERROR_INVALID_CALLING;
|
||||
}
|
||||
avoidAreaOption = property_->GetAvoidAreaOption();
|
||||
return WMError::WM_OK;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user