Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ecfc6b2 authored by Daichi Hirono's avatar Daichi Hirono
Browse files

Fix getAnimationTargets so that it returns valid animation target

AppTransitionController#getAnimationTargets traverse ancestors of
activity to find animation targets. Previously it can reach
DisplayContent#mWindowContainers which does not inherit
WindowContainer#createRemoteAnimationTarget thus cannot be a remote
animation target.

After this CL, getAnimationTargets stops traversing if it reaches
WindowContainer which cannot be a remote animation target.

Bug: 149716548
Test: None
Change-Id: Ie94ab8ecd35e9dcc28d0b8f7aaeb058e15b0f80b
parent bb4af580
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -7568,6 +7568,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                record.mStartBounds);
    }

    @Override
    boolean canCreateRemoteAnimationTarget() {
        return true;
    }

    @Override
    void getAnimationFrames(Rect outFrame, Rect outInsets, Rect outStableInsets,
            Rect outSurfaceInsets) {
+1 −1
Original line number Diff line number Diff line
@@ -446,7 +446,7 @@ public class AppTransitionController {
            siblings.add(current);
            boolean canPromote = true;

            if (parent == null) {
            if (parent == null || !parent.canCreateRemoteAnimationTarget()) {
                canPromote = false;
            } else {
                // In case a descendant of the parent belongs to the other group, we cannot promote
+5 −0
Original line number Diff line number Diff line
@@ -3087,6 +3087,11 @@ class Task extends WindowContainer<WindowContainer> {
        return activity != null ? activity.createRemoteAnimationTarget(record) : null;
    }

    @Override
    boolean canCreateRemoteAnimationTarget() {
        return true;
    }

    WindowState getTopVisibleAppMainWindow() {
        final ActivityRecord activity = getTopVisibleActivity();
        return activity != null ? activity.findMainWindow() : null;
+4 −0
Original line number Diff line number Diff line
@@ -2186,6 +2186,10 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
        return null;
    }

    boolean canCreateRemoteAnimationTarget() {
        return false;
    }

    boolean okToDisplay() {
        final DisplayContent dc = getDisplayContent();
        return dc != null && dc.okToDisplay();