add missionid for split event

Signed-off-by: leafly2021 <figo.yefei@huawei.com>
Change-Id: I9e100c694633f43f9fbfb514b9144b98293586d2
This commit is contained in:
leafly2021
2022-03-10 20:48:46 +08:00
parent 76bc96f7ce
commit 99c776758b
2 changed files with 9 additions and 5 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ private:
void UpdateWindowTree(sptr<WindowNode>& node);
bool UpdateRSTree(sptr<WindowNode>& node, bool isAdd);
void SendSplitScreenEvent(WindowMode mode);
void SendSplitScreenEvent(sptr<WindowNode>& node);
sptr<WindowNode> FindSplitPairNode(sptr<WindowNode>& node) const;
WMError UpdateWindowPairInfo(sptr<WindowNode>& triggerNode, sptr<WindowNode>& pairNode);
void NotifyIfSystemBarTintChanged();
+8 -4
View File
@@ -870,16 +870,20 @@ void WindowNodeContainer::MinimizeAllAppWindows()
return;
}
void WindowNodeContainer::SendSplitScreenEvent(WindowMode mode)
void WindowNodeContainer::SendSplitScreenEvent(sptr<WindowNode>& node)
{
// reset ipc identity
std::string identity = IPCSkeleton::ResetCallingIdentity();
AAFwk::Want want;
want.SetAction(SPLIT_SCREEN_EVENT_NAME);
std::string modeData = (node->GetWindowMode() == WindowMode::WINDOW_MODE_SPLIT_PRIMARY) ? "Secondary" : "Primary";
int32_t missionId = -1;
AAFwk::AbilityManagerClient::GetInstance()->GetMissionIdByToken(node->abilityToken_, missionId);
WLOGFI("split window missionId is: %{public}d", missionId);
want.SetParam("windowMode", modeData);
want.SetParam("missionId", missionId);
EventFwk::CommonEventData commonEventData;
commonEventData.SetWant(want);
std::string eventData = (mode == WindowMode::WINDOW_MODE_SPLIT_PRIMARY) ? "Secondary" : "Primary";
commonEventData.SetData(eventData);
EventFwk::CommonEventManager::PublishCommonEvent(commonEventData);
// set ipc identity to raw
IPCSkeleton::SetCallingIdentity(identity);
@@ -959,7 +963,7 @@ WMError WindowNodeContainer::EnterSplitWindowMode(sptr<WindowNode>& node)
return ret;
}
} else {
SendSplitScreenEvent(node->GetWindowMode());
SendSplitScreenEvent(node);
}
return WMError::WM_OK;
}