mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-18 16:24:27 -04:00
修复告警
Signed-off-by: chenqinxin <chenqinxin1@huawei.com> Change-Id: I339eaf94f38f27e3e3dce808d899f80430a258df
This commit is contained in:
@@ -27,7 +27,8 @@ namespace {
|
||||
bool DisplayPowerController::SuspendBegin(PowerStateChangeReason reason)
|
||||
{
|
||||
WLOGFI("reason:%{public}u", reason);
|
||||
DisplayManagerService::GetInstance().NotifyDisplayStateChange(DISPLAY_ID_INVALD, DisplayStateChangeType::BEFORE_SUSPEND);
|
||||
DisplayManagerService::GetInstance().NotifyDisplayStateChange(DISPLAY_ID_INVALD,
|
||||
DisplayStateChangeType::BEFORE_SUSPEND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,57 +32,56 @@ constexpr int32_t INDEX_TWO = 2;
|
||||
constexpr int32_t INDEX_THREE = 3;
|
||||
constexpr int32_t RGB_LENGTH = 6;
|
||||
constexpr int32_t RGBA_LENGTH = 8;
|
||||
namespace {
|
||||
enum class ApiWindowType : uint32_t {
|
||||
TYPE_BASE,
|
||||
TYPE_APP = TYPE_BASE,
|
||||
TYPE_APP_SUB_WINDOW,
|
||||
TYPE_SYSTEM_ALERT,
|
||||
TYPE_INPUT_METHOD,
|
||||
TYPE_STATUS_BAR,
|
||||
TYPE_PANEL,
|
||||
TYPE_KEYGUARD,
|
||||
TYPE_VOLUME_OVERLAY,
|
||||
TYPE_NAVIGATION_BAR,
|
||||
TYPE_END = TYPE_NAVIGATION_BAR,
|
||||
};
|
||||
const std::map<WindowType, ApiWindowType> NATIVE_JS_TO_WINDOW_TYPE_MAP {
|
||||
{ WindowType::APP_SUB_WINDOW_BASE, ApiWindowType::TYPE_APP },
|
||||
{ WindowType::WINDOW_TYPE_SYSTEM_ALARM_WINDOW, ApiWindowType::TYPE_SYSTEM_ALERT },
|
||||
{ WindowType::WINDOW_TYPE_INPUT_METHOD_FLOAT, ApiWindowType::TYPE_INPUT_METHOD },
|
||||
{ WindowType::WINDOW_TYPE_STATUS_BAR, ApiWindowType::TYPE_STATUS_BAR },
|
||||
{ WindowType::WINDOW_TYPE_PANEL, ApiWindowType::TYPE_PANEL },
|
||||
{ WindowType::WINDOW_TYPE_KEYGUARD, ApiWindowType::TYPE_KEYGUARD },
|
||||
{ WindowType::WINDOW_TYPE_VOLUME_OVERLAY, ApiWindowType::TYPE_VOLUME_OVERLAY },
|
||||
{ WindowType::WINDOW_TYPE_NAVIGATION_BAR, ApiWindowType::TYPE_NAVIGATION_BAR },
|
||||
{ WindowType::WINDOW_TYPE_APP_SUB_WINDOW, ApiWindowType::TYPE_APP_SUB_WINDOW },
|
||||
};
|
||||
const std::map<ApiWindowType, WindowType> JS_TO_NATIVE_WINDOW_TYPE_MAP {
|
||||
{ ApiWindowType::TYPE_APP, WindowType::APP_SUB_WINDOW_BASE },
|
||||
{ ApiWindowType::TYPE_SYSTEM_ALERT, WindowType::WINDOW_TYPE_SYSTEM_ALARM_WINDOW},
|
||||
{ ApiWindowType::TYPE_INPUT_METHOD, WindowType::WINDOW_TYPE_INPUT_METHOD_FLOAT },
|
||||
{ ApiWindowType::TYPE_STATUS_BAR, WindowType::WINDOW_TYPE_STATUS_BAR },
|
||||
{ ApiWindowType::TYPE_PANEL, WindowType::WINDOW_TYPE_PANEL },
|
||||
{ ApiWindowType::TYPE_KEYGUARD, WindowType::WINDOW_TYPE_KEYGUARD },
|
||||
{ ApiWindowType::TYPE_VOLUME_OVERLAY, WindowType::WINDOW_TYPE_VOLUME_OVERLAY },
|
||||
{ ApiWindowType::TYPE_NAVIGATION_BAR, WindowType::WINDOW_TYPE_NAVIGATION_BAR },
|
||||
{ ApiWindowType::TYPE_APP_SUB_WINDOW, WindowType::WINDOW_TYPE_APP_SUB_WINDOW },
|
||||
};
|
||||
enum class ApiWindowMode : uint32_t {
|
||||
UNDEFINED = 1,
|
||||
FULLSCREEN,
|
||||
PRIMARY,
|
||||
SECONDARY,
|
||||
FLOATING
|
||||
};
|
||||
const std::map<WindowMode, ApiWindowMode> NATIVE_TO_JS_WINDOW_MODE_MAP {
|
||||
{ WindowMode::WINDOW_MODE_UNDEFINED, ApiWindowMode::UNDEFINED },
|
||||
{ WindowMode::WINDOW_MODE_FULLSCREEN, ApiWindowMode::FULLSCREEN },
|
||||
{ WindowMode::WINDOW_MODE_SPLIT_PRIMARY, ApiWindowMode::PRIMARY },
|
||||
{ WindowMode::WINDOW_MODE_SPLIT_SECONDARY, ApiWindowMode::SECONDARY },
|
||||
{ WindowMode::WINDOW_MODE_FLOATING, ApiWindowMode::FLOATING },
|
||||
};
|
||||
}
|
||||
enum class ApiWindowType : uint32_t {
|
||||
TYPE_BASE,
|
||||
TYPE_APP = TYPE_BASE,
|
||||
TYPE_APP_SUB_WINDOW,
|
||||
TYPE_SYSTEM_ALERT,
|
||||
TYPE_INPUT_METHOD,
|
||||
TYPE_STATUS_BAR,
|
||||
TYPE_PANEL,
|
||||
TYPE_KEYGUARD,
|
||||
TYPE_VOLUME_OVERLAY,
|
||||
TYPE_NAVIGATION_BAR,
|
||||
TYPE_END = TYPE_NAVIGATION_BAR,
|
||||
};
|
||||
const std::map<WindowType, ApiWindowType> NATIVE_JS_TO_WINDOW_TYPE_MAP {
|
||||
{ WindowType::APP_SUB_WINDOW_BASE, ApiWindowType::TYPE_APP },
|
||||
{ WindowType::WINDOW_TYPE_SYSTEM_ALARM_WINDOW, ApiWindowType::TYPE_SYSTEM_ALERT },
|
||||
{ WindowType::WINDOW_TYPE_INPUT_METHOD_FLOAT, ApiWindowType::TYPE_INPUT_METHOD },
|
||||
{ WindowType::WINDOW_TYPE_STATUS_BAR, ApiWindowType::TYPE_STATUS_BAR },
|
||||
{ WindowType::WINDOW_TYPE_PANEL, ApiWindowType::TYPE_PANEL },
|
||||
{ WindowType::WINDOW_TYPE_KEYGUARD, ApiWindowType::TYPE_KEYGUARD },
|
||||
{ WindowType::WINDOW_TYPE_VOLUME_OVERLAY, ApiWindowType::TYPE_VOLUME_OVERLAY },
|
||||
{ WindowType::WINDOW_TYPE_NAVIGATION_BAR, ApiWindowType::TYPE_NAVIGATION_BAR },
|
||||
{ WindowType::WINDOW_TYPE_APP_SUB_WINDOW, ApiWindowType::TYPE_APP_SUB_WINDOW },
|
||||
};
|
||||
const std::map<ApiWindowType, WindowType> JS_TO_NATIVE_WINDOW_TYPE_MAP {
|
||||
{ ApiWindowType::TYPE_APP, WindowType::APP_SUB_WINDOW_BASE },
|
||||
{ ApiWindowType::TYPE_SYSTEM_ALERT, WindowType::WINDOW_TYPE_SYSTEM_ALARM_WINDOW},
|
||||
{ ApiWindowType::TYPE_INPUT_METHOD, WindowType::WINDOW_TYPE_INPUT_METHOD_FLOAT },
|
||||
{ ApiWindowType::TYPE_STATUS_BAR, WindowType::WINDOW_TYPE_STATUS_BAR },
|
||||
{ ApiWindowType::TYPE_PANEL, WindowType::WINDOW_TYPE_PANEL },
|
||||
{ ApiWindowType::TYPE_KEYGUARD, WindowType::WINDOW_TYPE_KEYGUARD },
|
||||
{ ApiWindowType::TYPE_VOLUME_OVERLAY, WindowType::WINDOW_TYPE_VOLUME_OVERLAY },
|
||||
{ ApiWindowType::TYPE_NAVIGATION_BAR, WindowType::WINDOW_TYPE_NAVIGATION_BAR },
|
||||
{ ApiWindowType::TYPE_APP_SUB_WINDOW, WindowType::WINDOW_TYPE_APP_SUB_WINDOW },
|
||||
};
|
||||
enum class ApiWindowMode : uint32_t {
|
||||
UNDEFINED = 1,
|
||||
FULLSCREEN,
|
||||
PRIMARY,
|
||||
SECONDARY,
|
||||
FLOATING
|
||||
};
|
||||
const std::map<WindowMode, ApiWindowMode> NATIVE_TO_JS_WINDOW_MODE_MAP {
|
||||
{ WindowMode::WINDOW_MODE_UNDEFINED, ApiWindowMode::UNDEFINED },
|
||||
{ WindowMode::WINDOW_MODE_FULLSCREEN, ApiWindowMode::FULLSCREEN },
|
||||
{ WindowMode::WINDOW_MODE_SPLIT_PRIMARY, ApiWindowMode::PRIMARY },
|
||||
{ WindowMode::WINDOW_MODE_SPLIT_SECONDARY, ApiWindowMode::SECONDARY },
|
||||
{ WindowMode::WINDOW_MODE_FLOATING, ApiWindowMode::FLOATING },
|
||||
};
|
||||
|
||||
NativeValue* GetRectAndConvertToJsValue(NativeEngine& engine, const Rect rect);
|
||||
NativeValue* CreateJsWindowPropertiesObject(NativeEngine& engine, sptr<Window>& window);
|
||||
bool SetSystemBarPropertiesFromJs(NativeEngine& engine, NativeObject* jsObject,
|
||||
|
||||
@@ -536,7 +536,7 @@ WMError WindowImpl::Create(const std::string& parentName, const std::shared_ptr<
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
windowMap_.insert({ name_, std::pair<uint32_t, sptr<Window>>(windowId, this) });
|
||||
windowMap_.insert(std::make_pair(name_, std::pair<uint32_t, sptr<Window>>(windowId, this)));
|
||||
if (parentName != "") { // add to subWindowMap_
|
||||
subWindowMap_[property_->GetParentId()].push_back(this);
|
||||
}
|
||||
|
||||
@@ -111,11 +111,11 @@ void WindowManager::Impl::NotifySystemBarChanged(DisplayId displayId, const Syst
|
||||
void WindowManager::Impl::NotifyWindowUpdate(const sptr<WindowInfo>& windowInfo, WindowUpdateType type) const
|
||||
{
|
||||
WLOGFI("NotifyWindowUpdate: wid[%{public}d],width[%{public}d], \
|
||||
height[%{public}d],positionX[%{public}d],positionY[%{public}d],\
|
||||
isFocused[%{public}d],mode[%{public}d],type[%{public}d]",
|
||||
windowInfo->wid_, windowInfo->windowRect_.width_,windowInfo->windowRect_.height_,
|
||||
windowInfo->windowRect_.posX_,windowInfo->windowRect_.posY_,
|
||||
windowInfo->focused_,windowInfo->mode_,windowInfo->type_);
|
||||
height[%{public}d],positionX[%{public}d],positionY[%{public}d],\
|
||||
isFocused[%{public}d],mode[%{public}d],type[%{public}d]",
|
||||
windowInfo->wid_, windowInfo->windowRect_.width_, windowInfo->windowRect_.height_,
|
||||
windowInfo->windowRect_.posX_, windowInfo->windowRect_.posY_,
|
||||
windowInfo->focused_, windowInfo->mode_, windowInfo->type_);
|
||||
for (auto& listener : windowUpdateListeners_) {
|
||||
listener->OnWindowUpdate(windowInfo, type);
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ Rect WindowLayoutPolicyCascade::GetCurCascadeRect(const sptr<WindowNode>& node)
|
||||
(*iter)->GetWindowId() != node->GetWindowId()) {
|
||||
cascadeRect = (*iter)->GetWindowProperty()->GetWindowRect();
|
||||
WLOGFI("get current cascadeRect :[%{public}d, %{public}d, %{public}d, %{public}d]",
|
||||
cascadeRect.posX_, cascadeRect.posY_, cascadeRect.width_, cascadeRect.height_);
|
||||
cascadeRect.posX_, cascadeRect.posY_, cascadeRect.width_, cascadeRect.height_);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ sptr<WindowNodeContainer> WindowRoot::GetOrCreateWindowNodeContainer(DisplayId d
|
||||
abstractDisplay->GetWidth(), abstractDisplay->GetHeight(), abstractDisplay->GetId());
|
||||
sptr<WindowNodeContainer> container = new WindowNodeContainer(abstractDisplay->GetId(),
|
||||
static_cast<uint32_t>(abstractDisplay->GetWidth()), static_cast<uint32_t>(abstractDisplay->GetHeight()));
|
||||
windowNodeContainerMap_.insert({ displayId, container });
|
||||
windowNodeContainerMap_.insert(std::make_pair(displayId, container));
|
||||
return container;
|
||||
}
|
||||
|
||||
@@ -95,9 +95,9 @@ WMError WindowRoot::SaveWindow(const sptr<WindowNode>& node)
|
||||
return WMError::WM_ERROR_NULLPTR;
|
||||
}
|
||||
WLOGFI("save windowId %{public}d", node->GetWindowId());
|
||||
windowNodeMap_.insert({ node->GetWindowId(), node });
|
||||
windowNodeMap_.insert(std::make_pair(node->GetWindowId(), node));
|
||||
auto remoteObject = node->GetWindowToken()->AsObject();
|
||||
windowIdMap_.insert({ remoteObject, node->GetWindowId() });
|
||||
windowIdMap_.insert(std::make_pair(remoteObject, node->GetWindowId()));
|
||||
|
||||
if (windowDeath_ == nullptr) {
|
||||
WLOGFI("failed to create death Recipient ptr WindowDeathRecipient");
|
||||
|
||||
@@ -15,9 +15,6 @@
|
||||
|
||||
#include "inative_test.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
namespace OHOS::Rosen {
|
||||
void INativeTest::VisitTests(VisitTestFunc func)
|
||||
{
|
||||
|
||||
@@ -25,9 +25,7 @@ using VisitTestFunc = std::function<void(INativeTest *)>;
|
||||
|
||||
class INativeTest {
|
||||
public:
|
||||
enum {
|
||||
LAST_TIME_FOREVER = 999999999,
|
||||
};
|
||||
static constexpr uint32_t LAST_TIME_FOREVER = 999999999,
|
||||
|
||||
static void VisitTests(VisitTestFunc func);
|
||||
INativeTest();
|
||||
|
||||
Reference in New Issue
Block a user