mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-21 12:35:22 -04:00
add more logs for RemoteAnimation&StartingWindow
Signed-off-by: chyyy0213 <chenhaiying3@huawei.com> Change-Id: I273a0807b72a330ba3d58809259d55016e66f486
This commit is contained in:
@@ -37,7 +37,7 @@ std::map<TransitionReason, TransitionEvent> eventMap_ = {
|
||||
|
||||
WMError RemoteAnimation::SetWindowAnimationController(const sptr<RSIWindowAnimationController>& controller)
|
||||
{
|
||||
WLOGFD("RSWindowAnimation: set window animation controller!");
|
||||
WLOGFI("RSWindowAnimation: set window animation controller!");
|
||||
if (controller == nullptr) {
|
||||
WLOGFE("RSWindowAnimation: failed to set window animation controller, controller is null!");
|
||||
return WMError::WM_ERROR_NULLPTR;
|
||||
@@ -55,14 +55,17 @@ bool RemoteAnimation::CheckTransition(sptr<WindowTransitionInfo> srcInfo, const
|
||||
sptr<WindowTransitionInfo> dstInfo, const sptr<WindowNode>& dstNode)
|
||||
{
|
||||
if (srcNode != nullptr && !srcNode->leashWinSurfaceNode_ && !srcNode->surfaceNode_) {
|
||||
WLOGFI("RSWindowAnimation: srcNode has no surface!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (dstNode != nullptr && !dstNode->leashWinSurfaceNode_ && !dstNode->surfaceNode_) {
|
||||
WLOGFI("RSWindowAnimation: dstNode has no surface!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (windowAnimationController_ == nullptr) {
|
||||
WLOGFI("RSWindowAnimation: windowAnimationController_ null!");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -70,7 +73,7 @@ bool RemoteAnimation::CheckTransition(sptr<WindowTransitionInfo> srcInfo, const
|
||||
|
||||
void RemoteAnimation::OnRemoteDie(const sptr<IRemoteObject>& remoteObject)
|
||||
{
|
||||
WLOGFD("RSWindowAnimation: OnRemoteDie!");
|
||||
WLOGFI("RSWindowAnimation: OnRemoteDie!");
|
||||
if (windowAnimationController_ != nullptr && windowAnimationController_->AsObject() == remoteObject) {
|
||||
windowAnimationController_ = nullptr;
|
||||
}
|
||||
@@ -103,10 +106,14 @@ WMError RemoteAnimation::NotifyAnimationTransition(sptr<WindowTransitionInfo> sr
|
||||
sptr<WindowTransitionInfo> dstInfo, const sptr<WindowNode>& srcNode,
|
||||
const sptr<WindowNode>& dstNode, bool needMinimizeSrcNode)
|
||||
{
|
||||
WLOGFD("RSWindowAnimation: nofity animation transition!");
|
||||
if (!dstNode || !dstNode->startingWindowShown_) {
|
||||
WLOGFE("RSWindowAnimation: no startingWindow for dst window id:%{public}u!", dstNode->GetWindowId());
|
||||
return WMError::WM_ERROR_NO_REMOTE_ANIMATION;
|
||||
}
|
||||
WLOGFI("RSWindowAnimation: nofity animation transition with dst currId:%{public}u!", dstNode->GetWindowId());
|
||||
sptr<RSWindowAnimationFinishedCallback> finishedCallback = new(std::nothrow) RSWindowAnimationFinishedCallback(
|
||||
[srcNode, dstNode, needMinimizeSrcNode]() {
|
||||
WLOGFD("RSWindowAnimation: on finish transition!");
|
||||
WLOGFI("RSWindowAnimation: on finish transition!");
|
||||
if (needMinimizeSrcNode && srcNode != nullptr && srcNode->abilityToken_ != nullptr) {
|
||||
WLOGFI("RSWindowAnimation minimize windowId: %{public}u, name:%{public}s",
|
||||
srcNode->GetWindowId(), srcNode->GetWindowName().c_str());
|
||||
@@ -131,26 +138,27 @@ WMError RemoteAnimation::NotifyAnimationTransition(sptr<WindowTransitionInfo> sr
|
||||
auto srcTarget = CreateWindowAnimationTarget(srcInfo, srcNode);
|
||||
srcNode->isPlayAnimationHide_ = true;
|
||||
|
||||
WLOGFD("RSWindowAnimation: app transition!");
|
||||
WLOGFI("RSWindowAnimation: app transition from id:%{public}u to id:%{public}u!",
|
||||
srcNode->GetWindowId(), dstNode->GetWindowId());
|
||||
windowAnimationController_->OnAppTransition(srcTarget, dstTarget, finishedCallback);
|
||||
return WMError::WM_OK;
|
||||
}
|
||||
// start app from launcher
|
||||
if (srcNode != nullptr && srcNode->GetWindowType() == WindowType::WINDOW_TYPE_DESKTOP) {
|
||||
WLOGFD("RSWindowAnimation: start app from launcher!");
|
||||
WLOGFI("RSWindowAnimation: start app id:%{public}u from launcher!", dstNode->GetWindowId());
|
||||
windowAnimationController_->OnStartApp(StartingAppType::FROM_LAUNCHER, dstTarget, finishedCallback);
|
||||
return WMError::WM_OK;
|
||||
}
|
||||
|
||||
// start app from recent
|
||||
if (srcInfo != nullptr && srcInfo->GetIsRecent()) {
|
||||
WLOGFD("RSWindowAnimation: start app from recent!");
|
||||
WLOGFI("RSWindowAnimation: start app id:%{public}u from recent!", dstNode->GetWindowId());
|
||||
windowAnimationController_->OnStartApp(StartingAppType::FROM_RECENT, dstTarget, finishedCallback);
|
||||
return WMError::WM_OK;
|
||||
}
|
||||
|
||||
// start app from other
|
||||
WLOGFD("RSWindowAnimation: start app from other!");
|
||||
WLOGFI("RSWindowAnimation: start app id:%{public}u from other!", dstNode->GetWindowId());
|
||||
windowAnimationController_->OnStartApp(StartingAppType::FROM_OTHER, dstTarget, finishedCallback);
|
||||
return WMError::WM_OK;
|
||||
}
|
||||
@@ -158,10 +166,10 @@ WMError RemoteAnimation::NotifyAnimationTransition(sptr<WindowTransitionInfo> sr
|
||||
WMError RemoteAnimation::NotifyAnimationMinimize(sptr<WindowTransitionInfo> srcInfo, const sptr<WindowNode>& srcNode)
|
||||
{
|
||||
sptr<RSWindowAnimationTarget> srcTarget = CreateWindowAnimationTarget(srcInfo, srcNode);
|
||||
|
||||
if (srcTarget == nullptr) {
|
||||
return WMError::WM_ERROR_NO_MEM;
|
||||
}
|
||||
WLOGFI("RSWindowAnimation: nofity animation minimize Id:%{public}u!", srcNode->GetWindowId());
|
||||
srcNode->isPlayAnimationHide_ = true;
|
||||
auto minimizeFunc = [srcNode]() {
|
||||
if (srcNode != nullptr && srcNode->abilityToken_ != nullptr) {
|
||||
@@ -183,10 +191,10 @@ WMError RemoteAnimation::NotifyAnimationMinimize(sptr<WindowTransitionInfo> srcI
|
||||
WMError RemoteAnimation::NotifyAnimationClose(sptr<WindowTransitionInfo> srcInfo, const sptr<WindowNode>& srcNode)
|
||||
{
|
||||
sptr<RSWindowAnimationTarget> srcTarget = CreateWindowAnimationTarget(srcInfo, srcNode);
|
||||
|
||||
if (srcTarget == nullptr) {
|
||||
return WMError::WM_ERROR_NO_MEM;
|
||||
}
|
||||
WLOGFI("RSWindowAnimation: nofity animation close id:%{public}u!", srcNode->GetWindowId());
|
||||
srcNode->isPlayAnimationHide_ = true;
|
||||
auto closeFunc = [srcNode]() {
|
||||
if (srcNode != nullptr && srcNode->abilityToken_ != nullptr) {
|
||||
|
||||
@@ -114,7 +114,7 @@ void StartingWindow::HandleClientWindowCreate(sptr<WindowNode>& node, sptr<IWind
|
||||
|
||||
// Register FirstFrame Callback to rs, replace startwin
|
||||
auto firstFrameCompleteCallback = [node]() {
|
||||
WLOGFI("Replace surfaceNode, id: %{public}u", node->GetWindowId());
|
||||
WLOGFI("StartingWindow::Replace surfaceNode, id: %{public}u", node->GetWindowId());
|
||||
node->leashWinSurfaceNode_->RemoveChild(node->startingWinSurfaceNode_);
|
||||
node->leashWinSurfaceNode_->AddChild(node->surfaceNode_, -1);
|
||||
AAFwk::AbilityManagerClient::GetInstance()->CompleteFirstFrameDrawing(node->abilityToken_);
|
||||
|
||||
@@ -55,7 +55,7 @@ bool WindowController::IsWindowNeedMinimizedByOther(const sptr<WindowNode>& targ
|
||||
void WindowController::StartingWindow(sptr<WindowTransitionInfo> info, sptr<Media::PixelMap> pixelMap,
|
||||
uint32_t bkgColor, bool isColdStart)
|
||||
{
|
||||
if (!info || info->GetAbilityToken() == nullptr || info->GetBundleName().find("permission") != std::string::npos) {
|
||||
if (!info || info->GetAbilityToken() == nullptr) {
|
||||
WLOGFE("info or AbilityToken is nullptr!");
|
||||
return;
|
||||
}
|
||||
@@ -122,7 +122,6 @@ WMError WindowController::NotifyWindowTransition(sptr<WindowTransitionInfo>& src
|
||||
return WMError::WM_ERROR_NO_REMOTE_ANIMATION;
|
||||
}
|
||||
// Minimize Other judge need : isMinimizedByOtherWindow_, self type.mode
|
||||
WLOGFI("NotifyWindowTransition Success!");
|
||||
return WMError::WM_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user