mirror of
https://github.com/openharmony/window_window_manager.git
synced 2026-08-24 15:55:05 -04:00
fix: use target version
Signed-off-by: ReCoder <jianhao2@h-partners.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -389,7 +389,6 @@ public:
|
||||
* Window Property
|
||||
*/
|
||||
WSError NotifyDisplayIdChange(DisplayId displayId);
|
||||
uint32_t GetApiCompatibleVersion() const override;
|
||||
|
||||
/*
|
||||
* Window Input Event
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user