mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-19 17:08:11 -04:00
fix csec, add support for animation callback
Signed-off-by: Zhang Peng <zhangpeng280@huawei.com> Change-Id: Ia4a6d78cc4aa17badfac24466a05b06b9312ef40
This commit is contained in:
@@ -63,7 +63,7 @@ public:
|
||||
bool SetRotation(ScreenId screenId, Rotation rotationAfter, bool isFromWindow);
|
||||
|
||||
bool SetScreenActiveMode(ScreenId screenId, uint32_t modeId);
|
||||
std::shared_ptr<RSDisplayNode> GetRSDisplayNodeByScreenId(ScreenId dmsScreenId) const;
|
||||
const std::shared_ptr<RSDisplayNode>& GetRSDisplayNodeByScreenId(ScreenId dmsScreenId) const;
|
||||
void UpdateRSTree(ScreenId dmsScreenId, std::shared_ptr<RSSurfaceNode>& surfaceNode, bool isAdd);
|
||||
bool MakeMirror(ScreenId, std::vector<ScreenId> screens);
|
||||
bool MakeExpand(std::vector<ScreenId> screenIds, std::vector<Point> startPoints);
|
||||
|
||||
@@ -41,9 +41,7 @@ AbstractScreenController::AbstractScreenController(std::recursive_mutex& mutex)
|
||||
controllerHandler_ = std::make_shared<AppExecFwk::EventHandler>(runner);
|
||||
}
|
||||
|
||||
AbstractScreenController::~AbstractScreenController()
|
||||
{
|
||||
}
|
||||
AbstractScreenController::~AbstractScreenController() = default;
|
||||
|
||||
void AbstractScreenController::Init()
|
||||
{
|
||||
@@ -55,8 +53,7 @@ void AbstractScreenController::RegisterRsScreenConnectionChangeListener()
|
||||
{
|
||||
WLOGFD("RegisterRsScreenConnectionChangeListener");
|
||||
auto res = rsInterface_.SetScreenChangeCallback(
|
||||
std::bind(&AbstractScreenController::OnRsScreenConnectionChange,
|
||||
this, std::placeholders::_1, std::placeholders::_2));
|
||||
[this](ScreenId rsScreenId, ScreenEvent screenEvent) { OnRsScreenConnectionChange(rsScreenId, screenEvent); });
|
||||
if (res != StatusCode::SUCCESS) {
|
||||
auto task = [this] {
|
||||
RegisterRsScreenConnectionChangeListener();
|
||||
@@ -76,8 +73,8 @@ std::vector<ScreenId> AbstractScreenController::GetAllScreenIds() const
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex_);
|
||||
std::vector<ScreenId> res;
|
||||
for (auto iter = dmsScreenMap_.begin(); iter != dmsScreenMap_.end(); iter++) {
|
||||
res.emplace_back(iter->first);
|
||||
for (const auto& iter : dmsScreenMap_) {
|
||||
res.emplace_back(iter.first);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -133,7 +130,7 @@ std::vector<ScreenId> AbstractScreenController::GetAllExpandOrMirrorScreenIds(
|
||||
return screenIds;
|
||||
}
|
||||
|
||||
std::shared_ptr<RSDisplayNode> AbstractScreenController::GetRSDisplayNodeByScreenId(ScreenId dmsScreenId) const
|
||||
const std::shared_ptr<RSDisplayNode>& AbstractScreenController::GetRSDisplayNodeByScreenId(ScreenId dmsScreenId) const
|
||||
{
|
||||
sptr<AbstractScreen> screen = GetAbstractScreen(dmsScreenId);
|
||||
if (screen == nullptr) {
|
||||
@@ -175,7 +172,7 @@ sptr<AbstractScreenGroup> AbstractScreenController::GetAbstractScreenGroup(Scree
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex_);
|
||||
auto iter = dmsScreenGroupMap_.find(dmsScreenId);
|
||||
if (iter == dmsScreenGroupMap_.end()) {
|
||||
WLOGE("didnot find screen:%{public}" PRIu64"", dmsScreenId);
|
||||
WLOGE("did not find screen:%{public}" PRIu64"", dmsScreenId);
|
||||
return nullptr;
|
||||
}
|
||||
return iter->second;
|
||||
@@ -498,7 +495,7 @@ ScreenId AbstractScreenController::CreateVirtualScreen(VirtualScreenOption optio
|
||||
}
|
||||
std::vector<ScreenId> virtualScreenIds;
|
||||
std::lock_guard<std::recursive_mutex> lock(mutex_);
|
||||
std::map<sptr<IRemoteObject>, std::vector<ScreenId>>::iterator agIter = screenAgentMap_.find(displayManagerAgent);
|
||||
auto agIter = screenAgentMap_.find(displayManagerAgent);
|
||||
if (agIter == screenAgentMap_.end()) {
|
||||
if (!RegisterVirtualScreenAgent(displayManagerAgent)) {
|
||||
return SCREEN_ID_INVALID;
|
||||
@@ -557,7 +554,7 @@ DMError AbstractScreenController::DestroyVirtualScreen(ScreenId screenId)
|
||||
}
|
||||
}
|
||||
|
||||
std::map<ScreenId, std::shared_ptr<RSDisplayNode>>::iterator iter = displayNodeMap_.find(rsScreenId);
|
||||
auto iter = displayNodeMap_.find(rsScreenId);
|
||||
if (iter == displayNodeMap_.end()) {
|
||||
WLOGFI("displayNode is nullptr");
|
||||
} else {
|
||||
@@ -970,7 +967,7 @@ bool AbstractScreenController::OnRemoteDied(const sptr<IRemoteObject>& agent)
|
||||
if (agent == nullptr) {
|
||||
return false;
|
||||
}
|
||||
std::map<sptr<IRemoteObject>, std::vector<ScreenId>>::iterator agentIter = screenAgentMap_.find(agent);
|
||||
auto agentIter = screenAgentMap_.find(agent);
|
||||
if (agentIter != screenAgentMap_.end()) {
|
||||
while (screenAgentMap_[agent].size() > 0) {
|
||||
auto diedId = screenAgentMap_[agent][0];
|
||||
|
||||
@@ -35,8 +35,8 @@ void WindowExtensionClientProxy::OnWindowReady(const std::shared_ptr<RSSurfaceNo
|
||||
WLOGFE("write token failed");
|
||||
return;
|
||||
}
|
||||
|
||||
if ((!data.WriteParcelable(surfaceNode.get()))) {
|
||||
|
||||
if ((!surfaceNode->Marshalling(data))) {
|
||||
WLOGFE("write surfaceNode failed");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ int WindowExtensionClientStub::OnRemoteRequest(uint32_t code, MessageParcel& dat
|
||||
WLOGFI(" code is %{public}d", code);
|
||||
switch (code) {
|
||||
case TRANS_ID_ON_WINDOW_READY: {
|
||||
std::shared_ptr<RSSurfaceNode> surfaceNode(data.ReadParcelable<RSSurfaceNode>());
|
||||
std::shared_ptr<RSSurfaceNode> surfaceNode = RSSurfaceNode::Unmarshalling(data);
|
||||
OnWindowReady(surfaceNode);
|
||||
break;
|
||||
}
|
||||
|
||||
+10
-12
@@ -42,7 +42,7 @@ bool WindowVisibilityInfo::Marshalling(Parcel &parcel) const
|
||||
|
||||
WindowVisibilityInfo* WindowVisibilityInfo::Unmarshalling(Parcel &parcel)
|
||||
{
|
||||
WindowVisibilityInfo* windowVisibilityInfo = new (std::nothrow) WindowVisibilityInfo();
|
||||
auto* windowVisibilityInfo = new (std::nothrow) WindowVisibilityInfo();
|
||||
if (windowVisibilityInfo == nullptr) {
|
||||
WLOGFE("window visibility info is nullptr.");
|
||||
return nullptr;
|
||||
@@ -68,7 +68,7 @@ bool WindowInfo::Marshalling(Parcel &parcel) const
|
||||
|
||||
WindowInfo* WindowInfo::Unmarshalling(Parcel &parcel)
|
||||
{
|
||||
WindowInfo* windowInfo = new (std::nothrow) WindowInfo();
|
||||
auto* windowInfo = new (std::nothrow) WindowInfo();
|
||||
if (windowInfo == nullptr) {
|
||||
WLOGFE("window info is nullptr.");
|
||||
return nullptr;
|
||||
@@ -94,7 +94,7 @@ bool AccessibilityWindowInfo::Marshalling(Parcel &parcel) const
|
||||
|
||||
AccessibilityWindowInfo* AccessibilityWindowInfo::Unmarshalling(Parcel &parcel)
|
||||
{
|
||||
AccessibilityWindowInfo* accessibilityWindowInfo = new (std::nothrow) AccessibilityWindowInfo();
|
||||
auto* accessibilityWindowInfo = new (std::nothrow) AccessibilityWindowInfo();
|
||||
if (accessibilityWindowInfo == nullptr) {
|
||||
WLOGFE("accessibility window info is nullptr.");
|
||||
return nullptr;
|
||||
@@ -117,7 +117,7 @@ bool FocusChangeInfo::Marshalling(Parcel &parcel) const
|
||||
|
||||
FocusChangeInfo* FocusChangeInfo::Unmarshalling(Parcel &parcel)
|
||||
{
|
||||
FocusChangeInfo* focusChangeInfo = new FocusChangeInfo();
|
||||
auto* focusChangeInfo = new FocusChangeInfo();
|
||||
bool res = parcel.ReadUint32(focusChangeInfo->windowId_) && parcel.ReadUint64(focusChangeInfo->displayId_) &&
|
||||
parcel.ReadInt32(focusChangeInfo->pid_) && parcel.ReadInt32(focusChangeInfo->uid_);
|
||||
if (!res) {
|
||||
@@ -150,7 +150,7 @@ public:
|
||||
static inline SingletonDelegator<WindowManager> delegator_;
|
||||
|
||||
bool isHandlerRunning_ = false;
|
||||
std::shared_ptr<EventHandler> listenertHandler_;
|
||||
std::shared_ptr<EventHandler> listenerHandler_;
|
||||
std::recursive_mutex mutex_;
|
||||
std::vector<sptr<IFocusChangedListener>> focusChangedListeners_;
|
||||
sptr<WindowManagerAgent> focusChangedListenerAgent_;
|
||||
@@ -170,11 +170,11 @@ void WindowManager::Impl::PostTask(ListenerTaskCallback &&callback, EventPriorit
|
||||
if (!isHandlerRunning_) {
|
||||
InitListenerHandler();
|
||||
}
|
||||
if (listenertHandler_ == nullptr) {
|
||||
if (listenerHandler_ == nullptr) {
|
||||
WLOGFE("listener handler is nullptr");
|
||||
return;
|
||||
}
|
||||
bool ret = listenertHandler_->PostTask([this, callback]() {
|
||||
bool ret = listenerHandler_->PostTask([this, callback]() {
|
||||
callback();
|
||||
}, name, 0, priority); // 0 is task delay time
|
||||
if (!ret) {
|
||||
@@ -191,8 +191,8 @@ void WindowManager::Impl::InitListenerHandler()
|
||||
WLOGFE("init window manager callback runner failed.");
|
||||
return;
|
||||
}
|
||||
listenertHandler_ = std::make_shared<AppExecFwk::EventHandler>(runner);
|
||||
if (listenertHandler_ == nullptr) {
|
||||
listenerHandler_ = std::make_shared<AppExecFwk::EventHandler>(runner);
|
||||
if (listenerHandler_ == nullptr) {
|
||||
WLOGFE("init window manager callback handler failed.");
|
||||
return;
|
||||
}
|
||||
@@ -287,9 +287,7 @@ WindowManager::WindowManager() : pImpl_(std::make_unique<Impl>())
|
||||
{
|
||||
}
|
||||
|
||||
WindowManager::~WindowManager()
|
||||
{
|
||||
}
|
||||
WindowManager::~WindowManager() = default;
|
||||
|
||||
void WindowManager::RegisterFocusChangedListener(const sptr<IFocusChangedListener>& listener)
|
||||
{
|
||||
|
||||
@@ -56,6 +56,7 @@ public:
|
||||
virtual void CancelStartingWindow(sptr<IRemoteObject> abilityToken) override;
|
||||
};
|
||||
|
||||
class RSUIDirector;
|
||||
class WindowManagerService : public SystemAbility, public WindowManagerStub {
|
||||
friend class DisplayChangeListener;
|
||||
friend class WindowManagerServiceHandler;
|
||||
@@ -134,7 +135,8 @@ private:
|
||||
std::unique_ptr<WindowTaskLooper> wmsTaskLooper_;
|
||||
RSInterfaces& rsInterface_;
|
||||
bool startingOpen_ = true;
|
||||
std::shared_ptr<RSUIDirector> rsUiDirector_;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace Rosen
|
||||
} // namespace OHOS
|
||||
#endif // OHOS_WINDOW_MANAGER_SERVICE_H
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "drag_controller.h"
|
||||
#include "remote_animation.h"
|
||||
#include "minimize_app.h"
|
||||
#include "ui/rs_ui_director.h"
|
||||
#include "singleton_container.h"
|
||||
#include "window_helper.h"
|
||||
#include "window_inner_manager.h"
|
||||
@@ -50,7 +51,7 @@ WindowManagerService::WindowManagerService() : SystemAbility(WINDOW_MANAGER_SERV
|
||||
rsInterface_(RSInterfaces::GetInstance())
|
||||
{
|
||||
windowRoot_ = new WindowRoot(
|
||||
std::bind(&WindowManagerService::OnWindowEvent, this, std::placeholders::_1, std::placeholders::_2));
|
||||
[this](Event event, const sptr<IRemoteObject>& remoteObject) { OnWindowEvent(event, remoteObject); });
|
||||
inputWindowMonitor_ = new InputWindowMonitor(windowRoot_);
|
||||
windowController_ = new WindowController(windowRoot_, inputWindowMonitor_);
|
||||
snapshotController_ = new SnapshotController(windowRoot_);
|
||||
@@ -59,6 +60,11 @@ WindowManagerService::WindowManagerService() : SystemAbility(WINDOW_MANAGER_SERV
|
||||
freezeDisplayController_ = new FreezeController();
|
||||
wmsTaskLooper_ = std::make_unique<WindowTaskLooper>();
|
||||
startingOpen_ = system::GetParameter("persist.window.sw.enabled", "1") == "1"; // startingWin default enabled
|
||||
|
||||
// init RSUIDirector, it will handle animation callback
|
||||
rsUiDirector_ = RSUIDirector::Create();
|
||||
rsUiDirector_->SetUITaskRunner([this](const std::function<void()>& task) { wmsTaskLooper_->PostTask(task); });
|
||||
rsUiDirector_->Init(false);
|
||||
}
|
||||
|
||||
void WindowManagerService::OnStart()
|
||||
@@ -654,4 +660,4 @@ WMError WindowManagerService::UpdateAvoidAreaListener(uint32_t windowId, bool ha
|
||||
}).get();
|
||||
}
|
||||
} // namespace Rosen
|
||||
} // namespace OHOS
|
||||
} // namespace OHOS
|
||||
|
||||
@@ -277,7 +277,7 @@ void WindowRoot::AddSurfaceNodeIdWindowNodePair(uint64_t surfaceNodeId, sptr<Win
|
||||
std::vector<std::pair<uint64_t, bool>> WindowRoot::GetWindowVisibilityChangeInfo(
|
||||
std::shared_ptr<RSOcclusionData> occlusionData)
|
||||
{
|
||||
std::vector<std::pair<uint64_t, bool>> visibityChangeInfo;
|
||||
std::vector<std::pair<uint64_t, bool>> visibilityChangeInfo;
|
||||
VisibleData& currentVisibleWindow = occlusionData->GetVisibleData();
|
||||
std::sort(currentVisibleWindow.begin(), currentVisibleWindow.end());
|
||||
VisibleData& lastVisibleWindow = lastOcclusionData_->GetVisibleData();
|
||||
@@ -285,10 +285,10 @@ std::vector<std::pair<uint64_t, bool>> WindowRoot::GetWindowVisibilityChangeInfo
|
||||
i = j = 0;
|
||||
for (; i < lastVisibleWindow.size() && j < currentVisibleWindow.size();) {
|
||||
if (lastVisibleWindow[i] < currentVisibleWindow[j]) {
|
||||
visibityChangeInfo.push_back(std::make_pair(lastVisibleWindow[i], false));
|
||||
visibilityChangeInfo.emplace_back(lastVisibleWindow[i], false);
|
||||
i++;
|
||||
} else if (lastVisibleWindow[i] > currentVisibleWindow[j]) {
|
||||
visibityChangeInfo.push_back(std::make_pair(currentVisibleWindow[j], true));
|
||||
visibilityChangeInfo.emplace_back(currentVisibleWindow[j], true);
|
||||
j++;
|
||||
} else {
|
||||
i++;
|
||||
@@ -296,20 +296,20 @@ std::vector<std::pair<uint64_t, bool>> WindowRoot::GetWindowVisibilityChangeInfo
|
||||
}
|
||||
}
|
||||
for (; i < lastVisibleWindow.size(); ++i) {
|
||||
visibityChangeInfo.push_back(std::make_pair(lastVisibleWindow[i], false));
|
||||
visibilityChangeInfo.emplace_back(lastVisibleWindow[i], false);
|
||||
}
|
||||
for (; j < currentVisibleWindow.size(); ++j) {
|
||||
visibityChangeInfo.push_back(std::make_pair(currentVisibleWindow[j], true));
|
||||
visibilityChangeInfo.emplace_back(currentVisibleWindow[j], true);
|
||||
}
|
||||
lastOcclusionData_ = occlusionData;
|
||||
return visibityChangeInfo;
|
||||
return visibilityChangeInfo;
|
||||
}
|
||||
|
||||
void WindowRoot::NotifyWindowVisibilityChange(std::shared_ptr<RSOcclusionData> occlusionData)
|
||||
{
|
||||
std::vector<std::pair<uint64_t, bool>> visibityChangeInfo = GetWindowVisibilityChangeInfo(occlusionData);
|
||||
std::vector<std::pair<uint64_t, bool>> visibilityChangeInfo = GetWindowVisibilityChangeInfo(occlusionData);
|
||||
std::vector<sptr<WindowVisibilityInfo>> windowVisibilityInfos;
|
||||
for (const auto& elem : visibityChangeInfo) {
|
||||
for (const auto& elem : visibilityChangeInfo) {
|
||||
uint64_t surfaceId = elem.first;
|
||||
bool isVisible = elem.second;
|
||||
auto iter = surfaceIdWindowNodeMap_.find(surfaceId);
|
||||
@@ -868,13 +868,13 @@ WMError WindowRoot::RequestActiveWindow(uint32_t windowId)
|
||||
return res;
|
||||
}
|
||||
|
||||
std::shared_ptr<RSSurfaceNode> WindowRoot::GetSurfaceNodeByAbilityToken(const sptr<IRemoteObject> &abilityToken) const
|
||||
std::shared_ptr<RSSurfaceNode> WindowRoot::GetSurfaceNodeByAbilityToken(const sptr<IRemoteObject>& abilityToken) const
|
||||
{
|
||||
for (auto iter = windowNodeMap_.begin(); iter != windowNodeMap_.end(); iter++) {
|
||||
if (iter->second->abilityToken_ != abilityToken) {
|
||||
for (const auto& iter : windowNodeMap_) {
|
||||
if (iter.second->abilityToken_ != abilityToken) {
|
||||
continue;
|
||||
}
|
||||
return iter->second->surfaceNode_;
|
||||
return iter.second->surfaceNode_;
|
||||
}
|
||||
WLOGFE("could not find required abilityToken!");
|
||||
return nullptr;
|
||||
@@ -980,7 +980,7 @@ std::vector<DisplayId> WindowRoot::GetAllDisplayIds() const
|
||||
std::vector<DisplayId> displayIds;
|
||||
for (auto& it : windowNodeContainerMap_) {
|
||||
if (!it.second) {
|
||||
return std::vector<DisplayId>();
|
||||
return {};
|
||||
}
|
||||
std::vector<DisplayId>& displayIdVec = const_cast<WindowRoot*>(this)->displayIdMap_[it.first];
|
||||
for (auto displayId : displayIdVec) {
|
||||
@@ -1240,19 +1240,19 @@ float WindowRoot::GetVirtualPixelRatio(DisplayId displayId) const
|
||||
|
||||
Rect WindowRoot::GetDisplayGroupRect(DisplayId displayId) const
|
||||
{
|
||||
Rect fulldisplayRect;
|
||||
Rect fullDisplayRect;
|
||||
auto container = const_cast<WindowRoot*>(this)->GetOrCreateWindowNodeContainer(displayId);
|
||||
if (container == nullptr) {
|
||||
WLOGFE("window container could not be found");
|
||||
return fulldisplayRect;
|
||||
return fullDisplayRect;
|
||||
}
|
||||
return container->GetDisplayGroupRect();
|
||||
}
|
||||
|
||||
WMError WindowRoot::GetAccessibilityWindowInfo(sptr<AccessibilityWindowInfo>& windowInfo)
|
||||
{
|
||||
for (auto iter = windowNodeContainerMap_.begin(); iter != windowNodeContainerMap_.end(); ++iter) {
|
||||
auto container = iter->second;
|
||||
for (auto& iter : windowNodeContainerMap_) {
|
||||
auto container = iter.second;
|
||||
std::vector<sptr<WindowInfo>> windowList;
|
||||
container->GetWindowList(windowList);
|
||||
for (auto window : windowList) {
|
||||
|
||||
@@ -46,7 +46,7 @@ WMError WindowManagerProxy::CreateWindow(sptr<IWindow>& window, sptr<WindowPrope
|
||||
return WMError::WM_ERROR_IPC_FAILED;
|
||||
}
|
||||
|
||||
if (!data.WriteParcelable(surfaceNode.get())) {
|
||||
if (!surfaceNode->Marshalling(data)) {
|
||||
WLOGFE("Write windowProperty failed");
|
||||
return WMError::WM_ERROR_IPC_FAILED;
|
||||
}
|
||||
@@ -537,7 +537,7 @@ WMError WindowManagerProxy::NotifyWindowTransition(sptr<WindowTransitionInfo>& f
|
||||
WLOGFE("Send request error: %{public}d", static_cast<uint32_t>(error));
|
||||
return WMError::WM_ERROR_IPC_FAILED;
|
||||
}
|
||||
WMError ret = static_cast<WMError>(reply.ReadInt32());
|
||||
auto ret = static_cast<WMError>(reply.ReadInt32());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -560,7 +560,7 @@ WMError WindowManagerProxy::GetModeChangeHotZones(DisplayId displayId, ModeChang
|
||||
return WMError::WM_ERROR_IPC_FAILED;
|
||||
}
|
||||
|
||||
WMError ret = static_cast<WMError>(reply.ReadInt32());
|
||||
auto ret = static_cast<WMError>(reply.ReadInt32());
|
||||
if (ret == WMError::WM_OK) {
|
||||
hotZones.fullscreen_.posX_ = reply.ReadInt32();
|
||||
hotZones.fullscreen_.posY_ = reply.ReadInt32();
|
||||
@@ -590,7 +590,7 @@ void WindowManagerProxy::MinimizeWindowsByLauncher(std::vector<uint32_t> windowI
|
||||
WLOGFE("WriteInterfaceToken failed");
|
||||
return;
|
||||
}
|
||||
uint32_t size = static_cast<uint32_t>(windowIds.size());
|
||||
auto size = static_cast<uint32_t>(windowIds.size());
|
||||
const uint32_t maxWindowNum = 100;
|
||||
if (size > maxWindowNum) {
|
||||
WLOGFE("windowNum cannot exceeds than 100");
|
||||
@@ -617,8 +617,8 @@ void WindowManagerProxy::MinimizeWindowsByLauncher(std::vector<uint32_t> windowI
|
||||
}
|
||||
;
|
||||
if (reply.ReadBool()) {
|
||||
sptr<IRemoteObject> finishcallbackObject = reply.ReadRemoteObject();
|
||||
finishCallback = iface_cast<RSIWindowAnimationFinishedCallback>(finishcallbackObject);
|
||||
sptr<IRemoteObject> finishCallbackObject = reply.ReadRemoteObject();
|
||||
finishCallback = iface_cast<RSIWindowAnimationFinishedCallback>(finishCallbackObject);
|
||||
} else {
|
||||
finishCallback = nullptr;
|
||||
}
|
||||
|
||||
@@ -31,13 +31,13 @@ int32_t WindowManagerStub::OnRemoteRequest(uint32_t code, MessageParcel &data, M
|
||||
WLOGFE("InterfaceToken check failed");
|
||||
return -1;
|
||||
}
|
||||
WindowManagerMessage msgId = static_cast<WindowManagerMessage>(code);
|
||||
auto msgId = static_cast<WindowManagerMessage>(code);
|
||||
switch (msgId) {
|
||||
case WindowManagerMessage::TRANS_ID_CREATE_WINDOW: {
|
||||
sptr<IRemoteObject> windowObject = data.ReadRemoteObject();
|
||||
sptr<IWindow> windowProxy = iface_cast<IWindow>(windowObject);
|
||||
sptr<WindowProperty> windowProperty = data.ReadStrongParcelable<WindowProperty>();
|
||||
std::shared_ptr<RSSurfaceNode> surfaceNode(data.ReadParcelable<RSSurfaceNode>());
|
||||
std::shared_ptr<RSSurfaceNode> surfaceNode = RSSurfaceNode::Unmarshalling(data);
|
||||
uint32_t windowId;
|
||||
sptr<IRemoteObject> token = nullptr;
|
||||
if (windowProperty && windowProperty->GetTokenState()) {
|
||||
@@ -76,21 +76,21 @@ int32_t WindowManagerStub::OnRemoteRequest(uint32_t code, MessageParcel &data, M
|
||||
}
|
||||
case WindowManagerMessage::TRANS_ID_SET_BACKGROUND_BLUR: {
|
||||
uint32_t windowId = data.ReadUint32();
|
||||
WindowBlurLevel level = static_cast<WindowBlurLevel>(data.ReadUint32());
|
||||
auto level = static_cast<WindowBlurLevel>(data.ReadUint32());
|
||||
WMError errCode = SetWindowBackgroundBlur(windowId, level);
|
||||
reply.WriteInt32(static_cast<int32_t>(errCode));
|
||||
break;
|
||||
}
|
||||
case WindowManagerMessage::TRANS_ID_GET_AVOID_AREA: {
|
||||
uint32_t windowId = data.ReadUint32();
|
||||
AvoidAreaType avoidAreaType = static_cast<AvoidAreaType>(data.ReadUint32());
|
||||
auto avoidAreaType = static_cast<AvoidAreaType>(data.ReadUint32());
|
||||
AvoidArea avoidArea = GetAvoidAreaByType(windowId, avoidAreaType);
|
||||
reply.WriteParcelable(&avoidArea);
|
||||
|
||||
break;
|
||||
}
|
||||
case WindowManagerMessage::TRANS_ID_REGISTER_WINDOW_MANAGER_AGENT: {
|
||||
WindowManagerAgentType type = static_cast<WindowManagerAgentType>(data.ReadUint32());
|
||||
auto type = static_cast<WindowManagerAgentType>(data.ReadUint32());
|
||||
sptr<IRemoteObject> windowManagerAgentObject = data.ReadRemoteObject();
|
||||
sptr<IWindowManagerAgent> windowManagerAgentProxy =
|
||||
iface_cast<IWindowManagerAgent>(windowManagerAgentObject);
|
||||
@@ -98,7 +98,7 @@ int32_t WindowManagerStub::OnRemoteRequest(uint32_t code, MessageParcel &data, M
|
||||
break;
|
||||
}
|
||||
case WindowManagerMessage::TRANS_ID_UNREGISTER_WINDOW_MANAGER_AGENT: {
|
||||
WindowManagerAgentType type = static_cast<WindowManagerAgentType>(data.ReadUint32());
|
||||
auto type = static_cast<WindowManagerAgentType>(data.ReadUint32());
|
||||
sptr<IRemoteObject> windowManagerAgentObject = data.ReadRemoteObject();
|
||||
sptr<IWindowManagerAgent> windowManagerAgentProxy =
|
||||
iface_cast<IWindowManagerAgent>(windowManagerAgentObject);
|
||||
@@ -134,13 +134,13 @@ int32_t WindowManagerStub::OnRemoteRequest(uint32_t code, MessageParcel &data, M
|
||||
break;
|
||||
}
|
||||
case WindowManagerMessage::TRANS_ID_UPDATE_LAYOUT_MODE: {
|
||||
WindowLayoutMode mode = static_cast<WindowLayoutMode>(data.ReadUint32());
|
||||
auto mode = static_cast<WindowLayoutMode>(data.ReadUint32());
|
||||
WMError errCode = SetWindowLayoutMode(mode);
|
||||
reply.WriteInt32(static_cast<int32_t>(errCode));
|
||||
break;
|
||||
}
|
||||
case WindowManagerMessage::TRANS_ID_UPDATE_PROPERTY: {
|
||||
PropertyChangeAction action = static_cast<PropertyChangeAction>(data.ReadUint32());
|
||||
auto action = static_cast<PropertyChangeAction>(data.ReadUint32());
|
||||
sptr<WindowProperty> windowProperty = new WindowProperty();
|
||||
windowProperty->Read(data, action);
|
||||
WMError errCode = UpdateProperty(windowProperty, action);
|
||||
|
||||
Reference in New Issue
Block a user