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

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

Merge "Fix switch task flicker from reveal animation." into sc-dev

parents e6168d76 9768747b
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -2252,6 +2252,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        }
        }


        final WindowManagerPolicy.StartingSurface surface;
        final WindowManagerPolicy.StartingSurface surface;
        final StartingData startingData = mStartingData;
        if (mStartingData != null) {
        if (mStartingData != null) {
            surface = mStartingSurface;
            surface = mStartingSurface;
            mStartingData = null;
            mStartingData = null;
@@ -2278,7 +2279,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        final Runnable removeSurface = () -> {
        final Runnable removeSurface = () -> {
            ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Removing startingView=%s", surface);
            ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Removing startingView=%s", surface);
            try {
            try {
                surface.remove(prepareAnimation);
                surface.remove(prepareAnimation && startingData.needRevealAnimation());
            } catch (Exception e) {
            } catch (Exception e) {
                Slog.w(TAG_WM, "Exception when removing starting window", e);
                Slog.w(TAG_WM, "Exception when removing starting window", e);
            }
            }
+5 −0
Original line number Original line Diff line number Diff line
@@ -40,6 +40,11 @@ class SnapshotStartingData extends StartingData {
                mSnapshot);
                mSnapshot);
    }
    }


    @Override
    boolean needRevealAnimation() {
        return false;
    }

    @Override
    @Override
    boolean hasImeSurface() {
    boolean hasImeSurface() {
        return mSnapshot.hasImeSurface();
        return mSnapshot.hasImeSurface();
+5 −0
Original line number Original line Diff line number Diff line
@@ -58,4 +58,9 @@ class SplashScreenStartingData extends StartingData {
                mLogo, mWindowFlags, mMergedOverrideConfiguration,
                mLogo, mWindowFlags, mMergedOverrideConfiguration,
                activity.getDisplayContent().getDisplayId());
                activity.getDisplayContent().getDisplayId());
    }
    }

    @Override
    boolean needRevealAnimation() {
        return true;
    }
}
}
+5 −0
Original line number Original line Diff line number Diff line
@@ -47,6 +47,11 @@ public abstract class StartingData {
     */
     */
    abstract StartingSurface createStartingSurface(ActivityRecord activity);
    abstract StartingSurface createStartingSurface(ActivityRecord activity);


    /**
     * @return Whether to apply reveal animation when exiting the starting window.
     */
    abstract boolean needRevealAnimation();

    /** @see android.window.TaskSnapshot#hasImeSurface() */
    /** @see android.window.TaskSnapshot#hasImeSurface() */
    boolean hasImeSurface() {
    boolean hasImeSurface() {
        return false;
        return false;
+1 −0
Original line number Original line Diff line number Diff line
@@ -197,6 +197,7 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub {
                                ANIMATION_TYPE_STARTING_REVEAL);
                                ANIMATION_TYPE_STARTING_REVEAL);
                        windowAnimationLeash = adaptor.mAnimationLeash;
                        windowAnimationLeash = adaptor.mAnimationLeash;
                        mainFrame = mainWindow.getRelativeFrame();
                        mainFrame = mainWindow.getRelativeFrame();
                        t.setPosition(windowAnimationLeash, mainFrame.left, mainFrame.top);
                    }
                    }
                }
                }
            }
            }