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

Commit 73786c23 authored by wilsonshih's avatar wilsonshih
Browse files

Preventing pass null animation leash in TransferSplashScreenView

In case client side crash if unable to create animation leash.

Bug: 296522125
Test: atest SplashscreenTests
Change-Id: I0c034d2666395e455328e8a9c66d844ec9f6ea2d
parent 9a619fcc
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -2716,12 +2716,14 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
     */
    void onCopySplashScreenFinish(SplashScreenViewParcelable parcelable) {
        removeTransferSplashScreenTimeout();
        // unable to copy from shell, maybe it's not a splash screen. or something went wrong.
        // either way, abort and reset the sequence.
        if (parcelable == null
        final SurfaceControl windowAnimationLeash = (parcelable == null
                || mTransferringSplashScreenState != TRANSFER_SPLASH_SCREEN_COPYING
                || mStartingWindow == null || mStartingWindow.mRemoved
                || finishing) {
                || finishing) ? null
                : TaskOrganizerController.applyStartingWindowAnimation(mStartingWindow);
        if (windowAnimationLeash == null) {
            // Unable to copy from shell, maybe it's not a splash screen, or something went wrong.
            // Either way, abort and reset the sequence.
            if (parcelable != null) {
                parcelable.clearIfNeeded();
            }
@@ -2729,9 +2731,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            removeStartingWindow();
            return;
        }
        // schedule attach splashScreen to client
        final SurfaceControl windowAnimationLeash = TaskOrganizerController
                .applyStartingWindowAnimation(mStartingWindow);
        try {
            mTransferringSplashScreenState = TRANSFER_SPLASH_SCREEN_ATTACH_TO_CLIENT;
            mAtmService.getLifecycleManager().scheduleTransaction(app.getThread(), token,