mirror of
https://gitee.com/openharmony/window_window_manager
synced 2025-02-07 16:36:49 +00:00
dd notify system only
Signed-off-by: chaos <zhongchao26@huawei.com>
This commit is contained in:
parent
8a0949c311
commit
1f68d5d2e3
@ -118,6 +118,10 @@ enum class ScreenPropertyChangeType : uint32_t {
|
||||
ROTATION_END,
|
||||
/* Only update screen rotation property info to DMS. */
|
||||
ROTATION_UPDATE_PROPERTY_ONLY,
|
||||
/* Only update screen rotation property info not notify. */
|
||||
ROTATION_UPDATE_PROPERTY_ONLY_NOT_NOTIFY,
|
||||
/* Undefined. */
|
||||
UNDEFINED,
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -485,7 +485,7 @@ napi_value JsScreenSessionManager::OnUpdateScreenRotationProperty(napi_env env,
|
||||
ScreenPropertyChangeType type = ScreenPropertyChangeType::UNSPECIFIED;
|
||||
if (argc > ARGC_THREE) {
|
||||
if (!ConvertFromJsValue(env, argv[ARGC_THREE], type) || type < ScreenPropertyChangeType::UNSPECIFIED ||
|
||||
type > ScreenPropertyChangeType::ROTATION_UPDATE_PROPERTY_ONLY) { // 3: the 4rd argv
|
||||
type >= ScreenPropertyChangeType::UNDEFINED) {
|
||||
TLOGE(WmsLogTag::DMS, "[NAPI]screenPropertyChangeType is invalid");
|
||||
napi_throw(env, CreateJsError(env, static_cast<int32_t>(WSErrorCode::WS_ERROR_INVALID_PARAM),
|
||||
"Input parameter is missing or invalid"));
|
||||
|
@ -171,6 +171,10 @@ napi_value JsScreenUtils::CreateJsScreenPropertyChangeType(napi_env env)
|
||||
static_cast<int32_t>(ScreenPropertyChangeType::ROTATION_END)));
|
||||
napi_set_named_property(env, objValue, "ROTATION_UPDATE_PROPERTY_ONLY", CreateJsValue(env,
|
||||
static_cast<int32_t>(ScreenPropertyChangeType::ROTATION_UPDATE_PROPERTY_ONLY)));
|
||||
napi_set_named_property(env, objValue, "ROTATION_UPDATE_PROPERTY_ONLY_NOT_NOTIFY", CreateJsValue(env,
|
||||
static_cast<int32_t>(ScreenPropertyChangeType::ROTATION_UPDATE_PROPERTY_ONLY_NOT_NOTIFY)));
|
||||
napi_set_named_property(env, objValue, "UNDEFINED", CreateJsValue(env,
|
||||
static_cast<int32_t>(ScreenPropertyChangeType::UNDEFINED)));
|
||||
return objValue;
|
||||
}
|
||||
|
||||
|
@ -3002,6 +3002,10 @@ void ScreenSessionManager::UpdateScreenRotationProperty(ScreenId screenId, const
|
||||
return;
|
||||
}
|
||||
sptr<ScreenSession> screenSession = GetScreenSession(screenId);
|
||||
if (screenSession == nullptr) {
|
||||
TLOGE(WmsLogTag::DMS, "fail, cannot find screen %{public}" PRIu64"", screenId);
|
||||
return;
|
||||
}
|
||||
{
|
||||
DmsXcollie dmsXcollie("DMS:UpdateScreenRotationProperty:CacheForRotation", XCOLLIE_TIMEOUT_10S);
|
||||
if (screenPropertyChangeType == ScreenPropertyChangeType::ROTATION_BEGIN) {
|
||||
@ -3013,28 +3017,21 @@ void ScreenSessionManager::UpdateScreenRotationProperty(ScreenId screenId, const
|
||||
TLOGI(WmsLogTag::DMS, "DisableCacheForRotation");
|
||||
RSInterfaces::GetInstance().DisableCacheForRotation();
|
||||
return;
|
||||
} else if (screenPropertyChangeType == ScreenPropertyChangeType::ROTATION_UPDATE_PROPERTY_ONLY) {
|
||||
if (screenSession == nullptr) {
|
||||
TLOGE(WmsLogTag::DMS, "fail, cannot find screen "
|
||||
"%{public}" PRIu64"", screenId);
|
||||
return;
|
||||
}
|
||||
} else if (screenPropertyChangeType == ScreenPropertyChangeType::ROTATION_UPDATE_PROPERTY_ONLY ||
|
||||
screenPropertyChangeType == ScreenPropertyChangeType::ROTATION_UPDATE_PROPERTY_ONLY_NOT_NOTIFY) {
|
||||
sptr<DisplayInfo> displayInfo = screenSession->ConvertToDisplayInfo();
|
||||
TLOGI(WmsLogTag::DMS, "Update Screen Rotation Property Only");
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock_info(displayInfoMutex_);
|
||||
screenSession->UpdatePropertyOnly(bounds, rotation, GetFoldDisplayMode());
|
||||
}
|
||||
NotifyDisplayChanged(displayInfo, DisplayChangeEvent::UPDATE_ROTATION);
|
||||
NotifyScreenChanged(screenSession->ConvertToScreenInfo(), ScreenChangeEvent::UPDATE_ROTATION);
|
||||
if (screenPropertyChangeType != ScreenPropertyChangeType::ROTATION_UPDATE_PROPERTY_ONLY_NOT_NOTIFY) {
|
||||
NotifyDisplayChanged(displayInfo, DisplayChangeEvent::UPDATE_ROTATION);
|
||||
NotifyScreenChanged(screenSession->ConvertToScreenInfo(), ScreenChangeEvent::UPDATE_ROTATION);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (screenSession == nullptr) {
|
||||
TLOGE(WmsLogTag::DMS, "fail, cannot find screen %{public}" PRIu64"",
|
||||
screenId);
|
||||
return;
|
||||
}
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock_info(displayInfoMutex_);
|
||||
screenSession->UpdatePropertyAfterRotation(bounds, rotation, GetFoldDisplayMode());
|
||||
@ -5307,9 +5304,15 @@ std::string ScreenSessionManager::TransferPropertyChangeTypeToString(ScreenPrope
|
||||
case ScreenPropertyChangeType::ROTATION_END:
|
||||
screenType = "ROTATION_END";
|
||||
break;
|
||||
default:
|
||||
case ScreenPropertyChangeType::ROTATION_UPDATE_PROPERTY_ONLY:
|
||||
screenType = "ROTATION_UPDATE_PROPERTY_ONLY";
|
||||
break;
|
||||
case ScreenPropertyChangeType::ROTATION_UPDATE_PROPERTY_ONLY_NOT_NOTIFY:
|
||||
screenType = "ROTATION_UPDATE_PROPERTY_ONLY_NOT_NOTIFY";
|
||||
break;
|
||||
default:
|
||||
screenType = "UNDEFINED";
|
||||
break;
|
||||
}
|
||||
return screenType;
|
||||
}
|
||||
|
@ -345,7 +345,8 @@ void ScreenSessionManagerClient::UpdateScreenRotationProperty(ScreenId screenId,
|
||||
|
||||
// not need update property to input manager
|
||||
if (screenPropertyChangeType == ScreenPropertyChangeType::ROTATION_END ||
|
||||
screenPropertyChangeType == ScreenPropertyChangeType::ROTATION_UPDATE_PROPERTY_ONLY) {
|
||||
screenPropertyChangeType == ScreenPropertyChangeType::ROTATION_UPDATE_PROPERTY_ONLY ||
|
||||
screenPropertyChangeType == ScreenPropertyChangeType::ROTATION_UPDATE_PROPERTY_ONLY_NOT_NOTIFY) {
|
||||
return;
|
||||
}
|
||||
auto screenSession = GetScreenSession(screenId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user