fix: use target version

Signed-off-by: ReCoder <jianhao2@h-partners.com>
This commit is contained in:
ReCoder
2025-03-24 10:06:53 +08:00
parent 5676a17fe4
commit 304992bee9
6 changed files with 16 additions and 16 deletions
+1
View File
@@ -247,6 +247,7 @@ public:
*/
static void UpdateConfigurationSyncForAll(const std::shared_ptr<AppExecFwk::Configuration>& configuration);
void UpdateConfigurationSync(const std::shared_ptr<AppExecFwk::Configuration>& configuration) override;
uint32_t GetApiTargetVersion() const;
private:
static sptr<Window> FindWindowById(uint32_t windowId);
+10 -1
View File
@@ -480,7 +480,7 @@ void WindowImpl::UpdateSpecificSystemBarEnabled(bool systemBarEnable, bool syste
property.enable_ = systemBarEnable;
property.enableAnimation_ = systemBarEnableAnimation;
// isolate on api 18
if (GetApiCompatibleVersion() >= API_VERSION_18) {
if (GetApiTargetVersion() >= API_VERSION_18) {
property.settingFlag_ |= SystemBarSettingFlag::ENABLE_SETTING;
}
}
@@ -1250,5 +1250,14 @@ bool WindowImpl::GetImmersiveModeEnabledState() const
{
return true;
}
uint32_t WindowImpl::GetApiTargetVersion() const
{
uint32_t version = 0;
if ((context_ != nullptr) && (context_->GetApplicationInfo() != nullptr)) {
version = context_->GetApplicationInfo()->apiTargetVersion % API_VERSION_MOD;
}
return version;
}
} // namespace Rosen
} // namespace OHOS
+1 -1
View File
@@ -353,7 +353,7 @@ public:
static void UpdateConfigurationSyncForAll(const std::shared_ptr<AppExecFwk::Configuration>& configuration);
void UpdateConfigurationSync(const std::shared_ptr<AppExecFwk::Configuration>& configuration) override;
void RegisterWindowInspectorCallback();
uint32_t GetApiCompatibleVersion() const override;
uint32_t GetApiTargetVersion() const;
/*
* Keyboard
-1
View File
@@ -389,7 +389,6 @@ public:
* Window Property
*/
WSError NotifyDisplayIdChange(DisplayId displayId);
uint32_t GetApiCompatibleVersion() const override;
/*
* Window Input Event
+3 -3
View File
@@ -973,7 +973,7 @@ void WindowImpl::UpdateSpecificSystemBarEnabled(bool systemBarEnable, bool syste
property.enable_ = systemBarEnable;
property.enableAnimation_ = systemBarEnableAnimation;
// isolate on api 18
if (GetApiCompatibleVersion() >= API_VERSION_18) {
if (GetApiTargetVersion() >= API_VERSION_18) {
property.settingFlag_ |= SystemBarSettingFlag::ENABLE_SETTING;
}
}
@@ -4465,11 +4465,11 @@ void WindowImpl::RegisterWindowInspectorCallback()
WindowInspector::GetInstance().RegisterGetWMSWindowListCallback(GetWindowId(), std::move(getWMSWindowListCallback));
}
uint32_t WindowImpl::GetApiCompatibleVersion() const
uint32_t WindowImpl::GetApiTargetVersion() const
{
uint32_t version = 0;
if ((context_ != nullptr) && (context_->GetApplicationInfo() != nullptr)) {
version = context_->GetApplicationInfo()->apiCompatibleVersion % API_VERSION_MOD;
version = context_->GetApplicationInfo()->apiTargetVersion % API_VERSION_MOD;
}
return version;
}
+1 -10
View File
@@ -4560,15 +4560,6 @@ WSError WindowSessionImpl::NotifyDisplayIdChange(DisplayId displayId)
return WSError::WS_OK;
}
uint32_t WindowSessionImpl::GetApiCompatibleVersion() const
{
uint32_t version = 0;
if ((context_ != nullptr) && (context_->GetApplicationInfo() != nullptr)) {
version = context_->GetApplicationInfo()->apiCompatibleVersion % API_VERSION_MOD;
}
return version;
}
WMError WindowSessionImpl::NotifyWatchGestureConsumeResult(int32_t keyCode, bool isConsumed)
{
TLOGD(WmsLogTag::WMS_EVENT, "keyCode:%{public}d, isConsumed:%{public}d", keyCode, isConsumed);
@@ -5111,7 +5102,7 @@ void WindowSessionImpl::UpdateSpecificSystemBarEnabled(bool systemBarEnable, boo
property.enable_ = systemBarEnable;
property.enableAnimation_ = systemBarEnableAnimation;
// isolate on api 18
if (GetApiCompatibleVersion() >= API_VERSION_18) {
if (GetTargetAPIVersion() >= API_VERSION_18) {
property.settingFlag_ |= SystemBarSettingFlag::ENABLE_SETTING;
}
}