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

Commit 49079f3b authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Decompose prepareAnimationIfNeeded into smaller methods."

parents 4d990af2 312da011
Loading
Loading
Loading
Loading
+413 −288

File changed.

Preview size limit exceeded, changes collapsed.

+8 −1
Original line number Diff line number Diff line
@@ -564,6 +564,11 @@ class SurfaceAnimator {
     */
    public static final int ANIMATION_TYPE_STARTING_REVEAL = 1 << 7;

    /**
     * Animation when a back gesture animation is applied to a window container.
     * @hide
     */
    public static final int ANIMATION_TYPE_PREDICT_BACK = 1 << 8;
    /**
     * Bitmask to include all animation types. This is NOT an {@link AnimationType}
     * @hide
@@ -583,7 +588,8 @@ class SurfaceAnimator {
            ANIMATION_TYPE_WINDOW_ANIMATION,
            ANIMATION_TYPE_INSETS_CONTROL,
            ANIMATION_TYPE_TOKEN_TRANSFORM,
            ANIMATION_TYPE_STARTING_REVEAL
            ANIMATION_TYPE_STARTING_REVEAL,
            ANIMATION_TYPE_PREDICT_BACK
    })
    @Retention(RetentionPolicy.SOURCE)
    @interface AnimationType {}
@@ -602,6 +608,7 @@ class SurfaceAnimator {
            case ANIMATION_TYPE_INSETS_CONTROL: return "insets_animation";
            case ANIMATION_TYPE_TOKEN_TRANSFORM: return "token_transform";
            case ANIMATION_TYPE_STARTING_REVEAL: return "starting_reveal";
            case ANIMATION_TYPE_PREDICT_BACK: return "predict_back";
            default: return "unknown type:" + type;
        }
    }
+8 −0
Original line number Diff line number Diff line
@@ -722,6 +722,14 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub {
        return true;
    }

    boolean isSupportWindowlessStartingSurface() {
        // Enable after ag/20426257
        final ITaskOrganizer lastOrganizer = mTaskOrganizers.peekLast();
        if (lastOrganizer == null) {
            return false;
        }
        return false;
    }
    /**
     * Notify the shell ({@link com.android.wm.shell.ShellTaskOrganizer} that the client has
     * removed the splash screen view.
+2 −7
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import android.annotation.NonNull;
@@ -96,9 +95,7 @@ public class BackNavigationControllerTests extends WindowTestsBase {
                .isEqualTo(typeToString(BackNavigationInfo.TYPE_RETURN_TO_HOME));

        // verify if back animation would start.
        verify(mBackNavigationController).scheduleAnimationLocked(
                eq(BackNavigationInfo.TYPE_RETURN_TO_HOME), any(), eq(mBackAnimationAdapter),
                any());
        assertTrue("Animation scheduled", backNavigationInfo.isPrepareRemoteAnimation());
    }

    @Test
@@ -115,9 +112,7 @@ public class BackNavigationControllerTests extends WindowTestsBase {
                .isEqualTo(typeToString(BackNavigationInfo.TYPE_CROSS_TASK));

        // verify if back animation would start.
        verify(mBackNavigationController).scheduleAnimationLocked(
                eq(BackNavigationInfo.TYPE_CROSS_TASK), any(), eq(mBackAnimationAdapter),
                any());
        assertTrue("Animation scheduled", backNavigationInfo.isPrepareRemoteAnimation());

        // reset drawning status
        topTask.forAllWindows(w -> {