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

Commit dde0d562 authored by wilsonshih's avatar wilsonshih
Browse files

Release starting_reveal leashes

When able to remove splash screen surface.

Flag: EXEMPT bugfix
Bug: 359853073
Test: launch app from Launcher, verify no starting_reveal left in
offscreen layer.

Change-Id: Ief3e353678f01f83314ff753099e550cb1d37147
parent a513c260
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4758,6 +4758,7 @@ public final class ActivityThread extends ClientTransactionHandler
        // frame.
        final SurfaceControl.Transaction transaction = new SurfaceControl.Transaction();
        transaction.hide(startingWindowLeash);
        startingWindowLeash.release();

        view.syncTransferSurfaceOnDraw();

+9 −5
Original line number Diff line number Diff line
@@ -368,8 +368,12 @@ class SplashscreenWindowCreator extends AbsSplashWindowCreator {
        mStartingWindowRecordManager.addRecord(taskId, tView);
    }

    private void removeWindowInner(@NonNull View decorView, boolean hideView) {
    private void removeWindowInner(@NonNull View decorView, StartingWindowRemovalInfo info,
            boolean hideView) {
        requestTopUi(false);
        if (info.windowAnimationLeash != null && info.windowAnimationLeash.isValid()) {
            info.windowAnimationLeash.release();
        }
        if (decorView.getParent() == null) {
            Slog.w(TAG, "This root view has no parent, never been added to a ViewRootImpl?");
            return;
@@ -452,22 +456,22 @@ class SplashscreenWindowCreator extends AbsSplashWindowCreator {
            if (mSplashView == null) {
                // shouldn't happen, the app window may be drawn earlier than starting window?
                Slog.e(TAG, "Found empty splash screen, remove!");
                removeWindowInner(mRootView, false);
                removeWindowInner(mRootView, info, false);
                return true;
            }
            if (immediately
                    || mSuggestType == STARTING_WINDOW_TYPE_LEGACY_SPLASH_SCREEN) {
                removeWindowInner(mRootView, false);
                removeWindowInner(mRootView, info, false);
            } else {
                if (info.playRevealAnimation) {
                    mSplashscreenContentDrawer.applyExitAnimation(mSplashView,
                            info.windowAnimationLeash, info.mainFrame,
                            () -> removeWindowInner(mRootView, true),
                            () -> removeWindowInner(mRootView, info, true),
                            mCreateTime, info.roundedCornerRadius);
                } else {
                    // the SplashScreenView has been copied to client, hide the view to skip
                    // default exit animation
                    removeWindowInner(mRootView, true);
                    removeWindowInner(mRootView, info, true);
                }
            }
            return true;