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

Commit 39a4a266 authored by wilsonshih's avatar wilsonshih Committed by Wei Sheng Shih
Browse files

[PB] Do not create windowless splash screen surface...

if previous activities haven't stopped. So the previous activities
can play animation right after previous transition finish.
Also release the windowless surface in core side if the animation
was already finished.

Flag: EXEMPT bugfix
Bug: 351061106
Test: disable snapshot, trigger back gesture right after an open
activity transition, verify no windowless surface created.

Change-Id: I65c9ece1a095877e45340f6516c76850b5254812
parent 9db2f240
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -1361,6 +1361,8 @@ class BackNavigationController {
                                    synchronized (openTask.mWmService.mGlobalLock) {
                                        if (mRequestedStartingSurfaceId != INVALID_TASK_ID) {
                                            mStartingSurface = sc;
                                        } else {
                                            sc.release();
                                        }
                                    }
                                }
@@ -1599,12 +1601,20 @@ class BackNavigationController {
                    @NonNull ActivityRecord[] visibleOpenActivities) {
                boolean needsLaunchBehind = true;
                if (isSupportWindowlessSurface() && mShowWindowlessSurface && !mIsLaunchBehind) {
                    boolean activitiesAreDrawn = false;
                    for (int i = visibleOpenActivities.length - 1; i >= 0; --i) {
                        // If the activity hasn't stopped, it's window should remain drawn.
                        activitiesAreDrawn |= visibleOpenActivities[i].firstWindowDrawn;
                    }
                    final WindowContainer mainOpen = openAnimationAdaptor.mAdaptors[0].mTarget;
                    final TaskSnapshot snapshot = getSnapshot(mainOpen, visibleOpenActivities);
                    // Don't create starting surface if previous activities haven't stopped or
                    // the snapshot does not exist.
                    if (snapshot != null || !activitiesAreDrawn) {
                        openAnimationAdaptor.createStartingSurface(snapshot);
                    // set LaunchBehind if we are creating splash screen surface.
                    needsLaunchBehind = snapshot == null
                            && openAnimationAdaptor.mRequestedStartingSurfaceId != INVALID_TASK_ID;
                    }
                    // Only use LaunchBehind if snapshot does not exist.
                    needsLaunchBehind = snapshot == null;
                }
                if (needsLaunchBehind) {
                    for (int i = visibleOpenActivities.length - 1; i >= 0; --i) {