diff --git a/dm/include/display_manager_adapter.h b/dm/include/display_manager_adapter.h index 2833926a827049d4169b9fd95bfe9223644aaefa..8761ea5fddafeb9471caa4c17783f527a43fc67d 100644 --- a/dm/include/display_manager_adapter.h +++ b/dm/include/display_manager_adapter.h @@ -22,6 +22,7 @@ #include "display.h" #include "screen.h" +#include "screen_group.h" #include "dm_common.h" #include "display_manager_interface.h" #include "singleton_delegator.h" @@ -56,6 +57,10 @@ public: virtual void NotifyDisplayEvent(DisplayEvent event); virtual DMError MakeMirror(ScreenId mainScreenId, std::vector mirrorScreenId); virtual void Clear(); + virtual sptr GetScreenById(ScreenId screenId); + virtual sptr GetScreenGroupById(ScreenId screenId); + virtual std::vector> GetAllScreens(); + virtual DMError MakeExpand(std::vector screenId, std::vector startPoint); private: bool InitDMSProxyLocked(); @@ -66,6 +71,8 @@ private: sptr displayManagerServiceProxy_ = nullptr; sptr dmsDeath_ = nullptr; std::map> displayMap_; + std::map> screenMap_; + std::map> screenGroupMap_; DisplayId defaultDisplayId_; }; } // namespace OHOS::Rosen diff --git a/dm/src/display_manager_adapter.cpp b/dm/src/display_manager_adapter.cpp index 82a3ec51d5b5e41190d43bf3da763d0e27f3b1e0..1f70e01a0e43a77c121b54cbcd9199b4c826cfd1 100644 --- a/dm/src/display_manager_adapter.cpp +++ b/dm/src/display_manager_adapter.cpp @@ -257,4 +257,85 @@ DMError DisplayManagerAdapter::MakeMirror(ScreenId mainScreenId, std::vectorMakeMirror(mainScreenId, mirrorScreenId); } + +sptr DisplayManagerAdapter::GetScreenById(ScreenId screenId) +{ + std::lock_guard lock(mutex_); + if (screenId == SCREEN_ID_INVALID) { + WLOGFE("screen id is invalid"); + return nullptr; + } + auto iter = screenMap_.find(screenId); + if (iter != screenMap_.end()) { + WLOGFI("get screen in screen map"); + return iter->second; + } + + if (!InitDMSProxyLocked()) { + WLOGFE("InitDMSProxyLocked failed!"); + return nullptr; + } + sptr screenInfo = displayManagerServiceProxy_->GetScreenInfoById(screenId); + if (screenInfo == nullptr) { + WLOGFE("screenInfo is null"); + return nullptr; + } + sptr screen = new Screen(screenInfo.GetRefPtr()); + screenMap_.insert(std::make_pair(screenId, screen)); + return screen; +} + +sptr DisplayManagerAdapter::GetScreenGroupById(ScreenId screenId) +{ + std::lock_guard lock(mutex_); + if (screenId == SCREEN_ID_INVALID) { + WLOGFE("screenGroup id is invalid"); + return nullptr; + } + auto iter = screenGroupMap_.find(screenId); + if (iter != screenGroupMap_.end()) { + WLOGFI("get screenGroup in screenGroup map"); + return iter->second; + } + + if (!InitDMSProxyLocked()) { + WLOGFE("InitDMSProxyLocked failed!"); + return nullptr; + } + sptr screenGroupInfo = displayManagerServiceProxy_->GetScreenGroupInfoById(screenId); + if (screenGroupInfo == nullptr) { + WLOGFE("screenGroupInfo is null"); + return nullptr; + } + sptr screenGroup = new ScreenGroup(screenGroupInfo.GetRefPtr()); + screenGroupMap_.insert(std::make_pair(screenId, screenGroup)); + return screenGroup; +} + +std::vector> DisplayManagerAdapter::GetAllScreens() +{ + std::lock_guard lock(mutex_); + std::vector> screens; + if (!InitDMSProxyLocked()) { + WLOGFE("InitDMSProxyLocked failed!"); + return screens; + } + std::vector> screenInfos = displayManagerServiceProxy_->GetAllScreenInfos(); + for (auto info: screenInfos) { + if (info == nullptr) { + WLOGFE("screenInfo is null"); + continue; + } + screens.emplace_back(new Screen(info.GetRefPtr())); + } + return screens; +} + +DMError DisplayManagerAdapter::MakeExpand(std::vector screenId, std::vector startPoint) +{ + if (!InitDMSProxyLocked()) { + return DMError::DM_ERROR_INIT_DMS_PROXY_LOCKED; + } + return displayManagerServiceProxy_->MakeExpand(screenId, startPoint); +} } // namespace OHOS::Rosen \ No newline at end of file diff --git a/dm/src/screen.cpp b/dm/src/screen.cpp index cc9d590a018a7ac8fc27bd1776c98e3793150940..df58bc87739cc63c5adf057cf1ad4f63f6aa80fe 100644 --- a/dm/src/screen.cpp +++ b/dm/src/screen.cpp @@ -14,6 +14,7 @@ */ #include "screen.h" +#include "screen_info.h" #include "screen_group.h" @@ -30,13 +31,21 @@ public: uint32_t virtualWidth_ { 0 }; uint32_t virtualHeight_ { 0 }; float virtualPixelRatio_ { 0.0 }; - sptr parent_ { nullptr }; + ScreenId parent_ { SCREEN_ID_INVALID }; bool hasChild_ { false }; }; -Screen::Screen() +Screen::Screen(const ScreenInfo* info) + : pImpl_(new Impl()) { - pImpl_ = new Impl(); + pImpl_->id_ = info->id_; + pImpl_->width_ = info->width_; + pImpl_->height_ = info->height_; + pImpl_->virtualWidth_ = info->virtualWidth_; + pImpl_->virtualHeight_ = info->virtualHeight_; + pImpl_->virtualPixelRatio_ = info->virtualPixelRatio_; + pImpl_->parent_ = info->parent_; + pImpl_->hasChild_ = info->hasChild_; } Screen::~Screen() @@ -88,7 +97,7 @@ bool Screen::RequestRotation(Rotation rotation) return false; } -sptr Screen::GetParent() const +ScreenId Screen::GetParentId() const { return pImpl_->parent_; } diff --git a/dm/src/screen_group.cpp b/dm/src/screen_group.cpp index 680340d154d985cc6fdb46c501b7413abcf4133b..62241cf85c7cdcbe50a9e85f30a1612a23c75018 100644 --- a/dm/src/screen_group.cpp +++ b/dm/src/screen_group.cpp @@ -14,6 +14,8 @@ */ #include "screen_group.h" +#include "screen.h" +#include "screen_group_info.h" namespace OHOS::Rosen { class ScreenGroup::Impl : public RefBase { @@ -22,14 +24,17 @@ private: Impl() = default; ~Impl() = default; - std::vector> children_; + std::vector children_; std::vector position_; ScreenCombination combination_ { ScreenCombination::SCREEN_ALONE }; }; -ScreenGroup::ScreenGroup() +ScreenGroup::ScreenGroup(const ScreenGroupInfo* info) + : Screen(info), pImpl_(new Impl()) { - pImpl_ = new Impl(); + pImpl_->children_ = info->children_; + pImpl_->position_ = info->position_; + pImpl_->combination_ = info->combination_; } ScreenGroup::~ScreenGroup() @@ -41,7 +46,7 @@ ScreenCombination ScreenGroup::GetCombination() const return pImpl_->combination_; } -std::vector> ScreenGroup::GetChildren() const +std::vector ScreenGroup::GetChildrenIds() const { return pImpl_->children_; } diff --git a/dm/src/screen_manager.cpp b/dm/src/screen_manager.cpp index 1f3507d7d56b73d7a4c980d63f3ee9460827a560..eff2dbc72a91c41bbd6f905a892e8cce3a5a77e9 100644 --- a/dm/src/screen_manager.cpp +++ b/dm/src/screen_manager.cpp @@ -16,6 +16,7 @@ #include "screen_manager.h" #include "window_manager_hilog.h" #include "display_manager_adapter.h" +#include "singleton_delegator.h" #include @@ -30,8 +31,7 @@ friend class ScreenManager; private: Impl() = default; ~Impl() = default; - - std::map> monitorMap_; + static inline SingletonDelegator delegator; }; WM_IMPLEMENT_SINGLE_INSTANCE(ScreenManager) @@ -44,15 +44,19 @@ ScreenManager::~ScreenManager() { } -sptr ScreenManager::GetScreenById(ScreenId id) +sptr ScreenManager::GetScreenById(ScreenId screenId) +{ + return SingletonContainer::Get().GetScreenById(screenId); +} + +sptr ScreenManager::GetScreenGroupById(ScreenId screenId) { - return nullptr; + return SingletonContainer::Get().GetScreenGroupById(screenId); } -std::vector> ScreenManager::GetAllScreens() +std::vector> ScreenManager::GetAllScreens() { - std::vector> res; - return res; + return SingletonContainer::Get().GetAllScreens(); } void ScreenManager::RegisterScreenListener(sptr listener) @@ -61,6 +65,10 @@ void ScreenManager::RegisterScreenListener(sptr listener) ScreenId ScreenManager::MakeExpand(std::vector screenId, std::vector startPoint) { + DMError result = SingletonContainer::Get().MakeExpand(screenId, startPoint); + if (result == DMError::DM_OK) { + WLOGFI("create mirror success"); + } return SCREEN_ID_INVALID; } diff --git a/dmserver/include/abstract_screen.h b/dmserver/include/abstract_screen.h index 3c7809ad85c234837479025255b50958fd018e9b..913019228c9e5cd369590ff8137f43618287a857 100644 --- a/dmserver/include/abstract_screen.h +++ b/dmserver/include/abstract_screen.h @@ -25,6 +25,7 @@ #include "screen.h" #include "screen_group.h" +#include "screen_info.h" #include "screen_group_info.h" namespace OHOS::Rosen { diff --git a/dmserver/include/display_manager_interface.h b/dmserver/include/display_manager_interface.h index 02266cc30c22902ce1cab6ae2ea657a062b8f90b..af6662216f41bdade9adfe32aa367865c76fa943 100644 --- a/dmserver/include/display_manager_interface.h +++ b/dmserver/include/display_manager_interface.h @@ -23,6 +23,8 @@ #include "dm_common.h" #include "screen.h" #include "display_info.h" +#include "screen_info.h" +#include "screen_group_info.h" #include "zidl/display_manager_agent_interface.h" namespace OHOS::Rosen { @@ -46,8 +48,12 @@ public: TRANS_ID_NOTIFY_DISPLAY_EVENT, TRANS_ID_CREATE_VIRTUAL_SCREEN = 1000, TRANS_ID_DESTROY_VIRTUAL_SCREEN, + TRANS_ID_GET_SCREEN_INFO_BY_ID, + TRANS_ID_GET_SCREEN_GROUP_INFO_BY_ID, + TRANS_ID_GET_ALL_SCREEN_INFOS, TRANS_ID_SCREENGROUP_BASE = 1100, TRANS_ID_SCREEN_MAKE_MIRROR = TRANS_ID_SCREENGROUP_BASE, + TRANS_ID_SCREEN_MAKE_EXPAND, }; virtual DisplayId GetDefaultDisplayId() = 0; @@ -70,6 +76,10 @@ public: virtual DisplayState GetDisplayState(DisplayId displayId) = 0; virtual void NotifyDisplayEvent(DisplayEvent event) = 0; virtual DMError MakeMirror(ScreenId mainScreenId, std::vector mirrorScreenId) = 0; + virtual sptr GetScreenInfoById(ScreenId screenId) = 0; + virtual sptr GetScreenGroupInfoById(ScreenId screenId) = 0; + virtual std::vector> GetAllScreenInfos() = 0; + virtual DMError MakeExpand(std::vector screenId, std::vector startPoint) = 0; }; } // namespace OHOS::Rosen diff --git a/dmserver/include/display_manager_proxy.h b/dmserver/include/display_manager_proxy.h index 55254e6893986b99281916503d54e33a5a7b5a70..9abfa22d34372cbaa9d488fbd79350f11ad02b46 100644 --- a/dmserver/include/display_manager_proxy.h +++ b/dmserver/include/display_manager_proxy.h @@ -51,6 +51,10 @@ public: DisplayState GetDisplayState(DisplayId displayId) override; void NotifyDisplayEvent(DisplayEvent event) override; DMError MakeMirror(ScreenId mainScreenId, std::vector mirrorScreenId) override; + sptr GetScreenInfoById(ScreenId screenId) override; + sptr GetScreenGroupInfoById(ScreenId screenId) override; + std::vector> GetAllScreenInfos() override; + DMError MakeExpand(std::vector screenId, std::vector startPoint) override; private: static inline BrokerDelegator delegator_; diff --git a/dmserver/include/display_manager_service.h b/dmserver/include/display_manager_service.h index 7ee8f1878476f3ffe76c3df881ec335e4ec21041..699ea15e83ff2288d330dd3beceb79a9b29b7c0b 100644 --- a/dmserver/include/display_manager_service.h +++ b/dmserver/include/display_manager_service.h @@ -64,6 +64,10 @@ public: sptr GetAbstractScreenController(); DMError MakeMirror(ScreenId mainScreenId, std::vector mirrorScreenId) override; + sptr GetScreenInfoById(ScreenId screenId) override; + sptr GetScreenGroupInfoById(ScreenId screenId) override; + std::vector> GetAllScreenInfos() override; + DMError MakeExpand(std::vector screenId, std::vector startPoint) override; private: DisplayManagerService(); diff --git a/dmserver/src/display_manager_proxy.cpp b/dmserver/src/display_manager_proxy.cpp index 49e00ac9b83045d1d3d9e84db1b7c3fbe0e4fa47..271b3574c8a5ac407b0b247525efa57cfd33574a 100644 --- a/dmserver/src/display_manager_proxy.cpp +++ b/dmserver/src/display_manager_proxy.cpp @@ -409,4 +409,134 @@ DMError DisplayManagerProxy::MakeMirror(ScreenId mainScreenId, std::vector(reply.ReadInt32()); } + +sptr DisplayManagerProxy::GetScreenInfoById(ScreenId screenId) +{ + sptr remote = Remote(); + if (remote == nullptr) { + WLOGFW("GetScreenInfoById: remote is nullptr"); + return nullptr; + } + + MessageParcel data; + MessageParcel reply; + MessageOption option; + if (!data.WriteInterfaceToken(GetDescriptor())) { + WLOGFE("GetScreenInfoById: WriteInterfaceToken failed"); + return nullptr; + } + if (!data.WriteUint64(screenId)) { + WLOGFE("GetScreenInfoById: Write screenId failed"); + return nullptr; + } + if (remote->SendRequest(TRANS_ID_GET_SCREEN_INFO_BY_ID, data, reply, option) != ERR_NONE) { + WLOGFW("GetScreenInfoById: SendRequest failed"); + return nullptr; + } + + sptr info = reply.ReadStrongParcelable(); + if (info == nullptr) { + WLOGFW("GetScreenInfoById SendRequest nullptr."); + return nullptr; + } + return info; +} + +sptr DisplayManagerProxy::GetScreenGroupInfoById(ScreenId screenId) +{ + sptr remote = Remote(); + if (remote == nullptr) { + WLOGFW("GetScreenGroupInfoById: remote is nullptr"); + return nullptr; + } + + MessageParcel data; + MessageParcel reply; + MessageOption option; + if (!data.WriteInterfaceToken(GetDescriptor())) { + WLOGFE("GetScreenGroupInfoById: WriteInterfaceToken failed"); + return nullptr; + } + if (!data.WriteUint64(screenId)) { + WLOGFE("GetScreenGroupInfoById: Write screenId failed"); + return nullptr; + } + if (remote->SendRequest(TRANS_ID_GET_SCREEN_GROUP_INFO_BY_ID, data, reply, option) != ERR_NONE) { + WLOGFW("GetScreenGroupInfoById: SendRequest failed"); + return nullptr; + } + + sptr info = reply.ReadStrongParcelable(); + if (info == nullptr) { + WLOGFW("GetScreenGroupInfoById SendRequest nullptr."); + return nullptr; + } + return info; +} + +std::vector> DisplayManagerProxy::GetAllScreenInfos() +{ + std::vector> screenInfos; + sptr remote = Remote(); + if (remote == nullptr) { + WLOGFW("GetAllScreenInfos: remote is nullptr"); + return screenInfos; + } + + MessageParcel data; + MessageParcel reply; + MessageOption option; + if (!data.WriteInterfaceToken(GetDescriptor())) { + WLOGFE("GetAllScreenInfos: WriteInterfaceToken failed"); + return screenInfos; + } + if (remote->SendRequest(TRANS_ID_GET_ALL_SCREEN_INFOS, data, reply, option) != ERR_NONE) { + WLOGFW("GetAllScreenInfos: SendRequest failed"); + return screenInfos; + } + + uint32_t nums = reply.ReadUint32(); + for (uint32_t i = 0; i < nums; ++i) { + sptr info = reply.ReadStrongParcelable(); + screenInfos.emplace_back(info); + } + return screenInfos; +} + +DMError DisplayManagerProxy::MakeExpand(std::vector screenId, std::vector startPoint) +{ + sptr remote = Remote(); + if (remote == nullptr) { + WLOGFW("MakeExpand: remote is null"); + return DMError::DM_ERROR_REMOTE_CREATE_FAILED; + } + + MessageParcel data; + MessageParcel reply; + MessageOption option; + if (!data.WriteInterfaceToken(GetDescriptor())) { + WLOGFE("MakeExpand: WriteInterfaceToken failed"); + return DMError::DM_ERROR_WRITE_INTERFACE_TOKEN_FAILED; + } + if (!data.WriteUInt64Vector(screenId)) { + WLOGFE("MakeExpand: write screenId failed"); + return DMError::DM_ERROR_WRITE_DATA_FAILED; + } + uint32_t num = startPoint.size(); + if (!data.WriteUint32(num)) { + WLOGFE("MakeExpand: write startPoint size failed"); + return DMError::DM_ERROR_WRITE_DATA_FAILED; + } + for (auto point: startPoint) { + if (!(data.WriteInt32(point.posX_) && data.WriteInt32(point.posY_))) { + WLOGFE("MakeExpand: write startPoint failed"); + return DMError::DM_ERROR_WRITE_DATA_FAILED; + } + } + if (remote->SendRequest(TRANS_ID_SCREEN_MAKE_EXPAND, data, reply, option) != ERR_NONE) { + WLOGFE("MakeExpand: SendRequest failed"); + return DMError::DM_ERROR_IPC_FAILED; + } + return static_cast(reply.ReadInt32()); +} } // namespace OHOS::Rosen \ No newline at end of file diff --git a/dmserver/src/display_manager_service.cpp b/dmserver/src/display_manager_service.cpp index b85e54d2c2ba22099d84c7d280f21ba4adbd20ae..78e23d586e1dd3167c05bfc6a0200764141485e9 100644 --- a/dmserver/src/display_manager_service.cpp +++ b/dmserver/src/display_manager_service.cpp @@ -249,4 +249,45 @@ DMError DisplayManagerService::MakeMirror(ScreenId mainScreenId, std::vector DisplayManagerService::GetScreenInfoById(ScreenId screenId) +{ + auto screen = abstractScreenController_->GetAbstractScreen(screenId); + if (screen == nullptr) { + WLOGE("cannot find screenInfo: %{public}" PRIu64"", screenId); + return nullptr; + } + return screen->ConvertToScreenInfo(); +} + +sptr DisplayManagerService::GetScreenGroupInfoById(ScreenId screenId) +{ + auto screenGroup = abstractScreenController_->GetAbstractScreenGroup(screenId); + if (screenGroup == nullptr) { + WLOGE("cannot find screenGroupInfo: %{public}" PRIu64"", screenId); + return nullptr; + } + return screenGroup->ConvertToScreenGroupInfo(); +} + +std::vector> DisplayManagerService::GetAllScreenInfos() +{ + std::vector screenIds = abstractScreenController_->GetAllScreenIds(); + std::vector> screenInfos; + for (auto screenId: screenIds) { + auto screenInfo = GetScreenInfoById(screenId); + if (screenInfo == nullptr) { + WLOGE("cannot find screenInfo: %{public}" PRIu64"", screenId); + continue; + } + screenInfos.emplace_back(screenInfo); + } + return screenInfos; +} + +DMError DisplayManagerService::MakeExpand(std::vector screenId, std::vector startPoint) +{ + // todo: make expand + return DMError::DM_OK; +} } // namespace OHOS::Rosen \ No newline at end of file diff --git a/dmserver/src/display_manager_stub.cpp b/dmserver/src/display_manager_stub.cpp index 64486f1453aea935892f3272bb3ffd27140e1289..df9aac51783a5c10c9773c3d62ce2bdaccb7160b 100644 --- a/dmserver/src/display_manager_stub.cpp +++ b/dmserver/src/display_manager_stub.cpp @@ -146,6 +146,43 @@ int32_t DisplayManagerStub::OnRemoteRequest(uint32_t code, MessageParcel &data, reply.WriteInt32(static_cast(result)); break; } + case TRANS_ID_GET_SCREEN_INFO_BY_ID: { + ScreenId screenId = static_cast(data.ReadUint64()); + auto screenInfo = GetScreenInfoById(screenId); + reply.WriteStrongParcelable(screenInfo); + break; + } + case TRANS_ID_GET_SCREEN_GROUP_INFO_BY_ID: { + ScreenId screenId = static_cast(data.ReadUint64()); + auto screenGroupInfo = GetScreenGroupInfoById(screenId); + reply.WriteStrongParcelable(screenGroupInfo); + break; + } + case TRANS_ID_GET_ALL_SCREEN_INFOS: { + std::vector> screenInfos = GetAllScreenInfos(); + uint32_t nums = static_cast(screenInfos.size()); + reply.WriteUint32(nums); + for (uint32_t i = 0; i < nums; ++i) { + reply.WriteStrongParcelable(screenInfos[i]); + } + break; + } + case TRANS_ID_SCREEN_MAKE_EXPAND: { + std::vector screenId; + if (!data.ReadUInt64Vector(&screenId)) { + WLOGE("fail to receive expand screen in stub."); + break; + } + std::vector startPoint; + uint32_t nums = data.ReadUint32(); + for (uint32_t i = 0; i < nums; ++i) { + Point point { data.ReadInt32(), data.ReadInt32() }; + startPoint.push_back(point); + } + DMError result = MakeExpand(screenId, startPoint); + reply.WriteInt32(static_cast(result)); + break; + } default: WLOGFW("unknown transaction code"); return IPCObjectStub::OnRemoteRequest(code, data, reply, option); diff --git a/interfaces/innerkits/dm/screen.h b/interfaces/innerkits/dm/screen.h index f5dc4be812f1c8efa8dcdd15dea704cbebaad98e..c102257abdf509ac22c6070bdcb77f12d8f61a6d 100644 --- a/interfaces/innerkits/dm/screen.h +++ b/interfaces/innerkits/dm/screen.h @@ -24,7 +24,7 @@ #include "dm_common.h" namespace OHOS::Rosen { -class ScreenGroup; +class ScreenInfo; using ScreenId = uint64_t; static constexpr ScreenId SCREEN_ID_INVALID = -1ULL; @@ -44,7 +44,7 @@ struct VirtualScreenOption { class Screen : public RefBase { public: - Screen(); + Screen(const ScreenInfo* info); ~Screen(); bool IsGroup() const; ScreenId GetId() const; @@ -55,7 +55,7 @@ public: float GetVirtualPixelRatio() const; bool RequestRotation(Rotation rotation); Rotation GetRotation() const; - sptr GetParent() const; + ScreenId GetParentId() const; private: class Impl; diff --git a/interfaces/innerkits/dm/screen_group.h b/interfaces/innerkits/dm/screen_group.h index 883eff5506a17884a047fc6861b5a5a04eeff026..fd64740dfacc27c2032f5a144cae8456dfb63027 100644 --- a/interfaces/innerkits/dm/screen_group.h +++ b/interfaces/innerkits/dm/screen_group.h @@ -21,6 +21,7 @@ #include "screen.h" namespace OHOS::Rosen { +class ScreenGroupInfo; enum class ScreenCombination : uint32_t { SCREEN_ALONE, SCREEN_EXPAND, @@ -29,13 +30,12 @@ enum class ScreenCombination : uint32_t { class ScreenGroup : public Screen { public: + ScreenGroup(const ScreenGroupInfo* info); + ~ScreenGroup(); ScreenCombination GetCombination() const; - std::vector> GetChildren() const; + std::vector GetChildrenIds() const; private: - ScreenGroup(); - ~ScreenGroup(); - class Impl; sptr pImpl_; }; diff --git a/interfaces/innerkits/dm/screen_manager.h b/interfaces/innerkits/dm/screen_manager.h index 7ba3cd2f993e5492575b4b03a7fade2f000e7d68..508507a15f7895e444581c1adb3092f22e34342f 100644 --- a/interfaces/innerkits/dm/screen_manager.h +++ b/interfaces/innerkits/dm/screen_manager.h @@ -34,8 +34,9 @@ public: class ScreenManager : public RefBase { WM_DECLARE_SINGLE_INSTANCE_BASE(ScreenManager); public: - sptr GetScreenById(ScreenId id); - std::vector> GetAllScreens(); + sptr GetScreenById(ScreenId screenId); + sptr GetScreenGroupById(ScreenId screenId); + std::vector> GetAllScreens(); void RegisterScreenListener(sptr listener); ScreenId MakeExpand(std::vector screenId, std::vector startPoint); diff --git a/utils/include/screen_group_info.h b/utils/include/screen_group_info.h index f8b4436edd99d0c8c39c3684af5db8aab4152792..6a9addbf8a25b65ecb6d964371ef3ba425ec325b 100644 --- a/utils/include/screen_group_info.h +++ b/utils/include/screen_group_info.h @@ -30,7 +30,7 @@ public: void Update(sptr info); virtual bool Marshalling(Parcel& parcel) const override; - ScreenGroupInfo* Unmarshalling(Parcel& parcel); + static ScreenGroupInfo* Unmarshalling(Parcel& parcel); std::vector children_; std::vector position_;